Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Nuxt3 module & plugin #562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Denoder wants to merge 8 commits into nuxt-community:main
base: main
Choose a base branch
Loading
from Denoder:Nuxt3-Module

Conversation

@Denoder
Copy link

@Denoder Denoder commented Feb 5, 2022
edited
Loading

Applying what I did here: #536 (comment)
to the actual module.

Lycoon, lacorde, pi0, BobbieGoede, ABartelt, apgapg, Intevel, nklsw, calebanthony, duboiss, and kyumoon reacted with thumbs up emoji Lycoon, lacorde, BobbieGoede, d3473r, Intevel, and calebanthony reacted with hooray emoji
Copy link

nklsw commented Mar 6, 2022

Would love to see this merged 👀

Intevel, calebanthony, TomMiller-mas, tomlewis0, duboiss, lacorde, and djames-rms reacted with thumbs up emoji

Copy link

d3473r commented Mar 16, 2022
edited
Loading

duboiss, nklsw, danielrjames, command-tab, lacorde, anteriovieira, and imadreamerboy reacted with thumbs up emoji

Copy link
Contributor

atinux commented Apr 4, 2022

Thank you for the PR @teranode

Actually this is more complex that it seems since in Nuxt 3 we do have direct function call when making local request to the server.

See more on https://v3.nuxtjs.org/docs/migration/component-options#isomorphic-fetch

What are the features that you need from axios that you cannot do with $fetch in Nuxt 3?

Copy link
Author

Denoder commented Apr 4, 2022

@atinux Wasn't about features that I needed, the auth module used this module to function, and the auth module itself is taking long to release so ended up having to convert that too.

https://github.com/Teranode/nuxt-module-alternatives

Copy link
Contributor

Intevel commented Apr 4, 2022

@teranode A new auth module for Nuxt 3 is planned in Q2 2022

Copy link
Author

Denoder commented Apr 4, 2022

@Intevel I am aware of that.

Intevel reacted with thumbs up emoji

Copy link
Member

pi0 commented Apr 4, 2022

@teranode Thanks for your initiative and efforts for Nuxt 3 compatibility of this module.

I'm the author of axios, proxy, and auth modules (as well as Nuxt3!). All 3 modules were deeply designed to work well with the Nuxt 2 server architecture and even if we make our best to make them "just working" with Nuxt 3, they are not close to Nuxt 3 compatibility. Base URL handling, ESM and fetch support (for non-node.js servers) are essentially missing features from the axios module.

Regardless, I agree, that we should have basic compatibility for popular modules like axios and proxy, making migration easier.

Copy link
Contributor

Intevel commented Apr 4, 2022

In general I think it would be too much work to update the auth-module to be Nuxt 3 compatible. I understand the idea, the axios module is the third most installed.

Copy link
Author

Denoder commented Apr 4, 2022
edited
Loading

@pi0 It was a fun experience for me. On a side not, I do wonder how the proxy module will work considering that when using the function-based approach it wont work and had to resort to generating files inside the server folder (using the vite settings also had the same issue.).

@Intevel It works for the most part, there are a few bugs here and there (if people tell me what they are), the one glaring issue that I'm facing currently is that axios, pinia, and auth (or really any plugin that also has server sided capabilities) aren't available on the client side when using global middleware

Copy link
Author

Denoder commented Apr 4, 2022
edited
Loading

fetch support (for non-node.js servers)

Also (besides nuxt3's built in functions) wouldn't nuxt/http work for that?
@pi0

Copy link

djames-rms commented Apr 4, 2022
edited
Loading

What are the features that you need from axios that you cannot do with $fetch in Nuxt 3?

@atinux it would nice for $fetch to have a global set token function like $axios has.

Intevel reacted with thumbs up emoji

Copy link
Author

Denoder commented Apr 20, 2022

Should I close this, seeing as you are going to be using Nuxt's isomorphic fetch api?

Copy link
Member

pi0 commented Apr 20, 2022
edited
Loading

Hi @teranode. Please keep it open i would love to continue on your work for at least basic compatibility with Nuxt3. Sorry it took long. There was tons of other stuff to work on.

BTW yes, please consider using Nuxt 3 native fetch/$fetch whenever possible!

Intevel and noopurphalak reacted with thumbs up emoji

Copy link

If we want to switch from axios to Nuxt 3 fetch, what do we need to change in our code? Where's the docs on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

3 more reviewers

@brhx brhx brhx approved these changes

@lacorde lacorde lacorde approved these changes

@Intevel Intevel Intevel approved these changes

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /