Skip to content
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

docs: warn about using useRequestHeaders in useFetch #24321

Closed
wants to merge 1 commit into from

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

resolves #23900

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This updates documentation to avoid using useRequestHeaders in useFetch calls, following #23462.

We could also consider reverting that change.

Thoughts welcome. πŸ™

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

stackblitz bot commented Nov 15, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

nuxt-studio bot commented Nov 15, 2023

βœ… Live Preview ready!

Name Edit Preview Latest Commit
Nuxt Docs Edit on Studio β†—οΈŽ View Live Preview 235dc52

@manniL
Copy link
Member

manniL commented Nov 16, 2023

We could also consider reverting that change.

I think that'd be a bit better as it seems like a potential footgun πŸ€”
The problem is that this would be a breaking change, no?

Alternatively we should add an ESLint rule to disallow it somehow (if possible)

@webfansplz
Copy link
Contributor

We could also consider reverting that change.

I agree that we should revert the changes. IMO, #23462 's case is even rarer than between the client and server have different request headers. For this case, we recommend that users add a key manually to avoid issues.

@danielroe
Copy link
Member Author

I think that's reasonable. Let's go ahead and revert adding headers to the auto-generated key. PR welcome πŸ™

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

Successfully merging this pull request may close these issues.

useRequestHeaders and useFetch are incompatible in 3.8.0
3 participants