-
-
Notifications
You must be signed in to change notification settings - Fork 172
fix(nuxt-client, nuxt): various nuxt client bugs #2054
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
base: main
Are you sure you want to change the base?
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2054 +/- ##
=======================================
Coverage 22.64% 22.64%
=======================================
Files 253 253
Lines 21513 21513
Branches 818 818
=======================================
Hits 4872 4872
Misses 16635 16635
Partials 6 6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@mrlubos, just FYI, guessing you may want to switch from pulling from raw.githubusercontent.com (that or pull authenticated), since it looks like you're hitting rate limits here: Guessing it's related to the recent changes GH made to unauthenticated calls. Also curious if any of the testing logic in |
@hey-api/client-axios
@hey-api/client-fetch
@hey-api/client-next
@hey-api/client-nuxt
@hey-api/nuxt
@hey-api/openapi-ts
@hey-api/vite-plugin
commit: |
699c510
to
463439a
Compare
…package Signed-off-by: Liam Stanley <[email protected]>
Signed-off-by: Liam Stanley <[email protected]>
463439a
to
c4e72cc
Compare
Hey, ready ready to review? I'm not seeing any issues with hitting the rate limits in CI elsewhere btw |
@lrstanley Do you think merging this will fix the broken initial release run? It currently causes to miss publishing changelogs/releases to GitHub https://github.com/hey-api/openapi-ts/actions/runs/15206388350/job/42770418494 |
🚀 Changes proposed by this PR
This is a refactor of the Nuxt client, to make it more reliably support reactive (ref, computed, getter, etc) variables in the body, query params, and path params.
Security Note
I have also removed the usage of
ref()
, due to the potential for Cross-Request State Pollution (CRSP) when using within SSR. The usage ofref()
was fairly restricted so it's unlikely a user would run into an issue in the real world, however, removing it ensures there is never a potential attack vector.This is a breaking change. Users will need to restructure how they pass in reactive data, though it shouldn't be a large change. See the updated
examples/openapi-ts-nuxt
example.Old method:
New method:
Detailed Changes
ref()
due to above security concerns.headers
in request options can now be reactive (config is still non-reactive).query
,path
, andbody
are no longer recursively reactive, only the first level (including in the types).computed()
call, and changesomeRef
(typed asRef
) tosomeRef.value
(the underlying un-reactive type) when inside ofcomputed()
. Essentially, treat computed like any other Vue usecase.KeysOf
).utils.ts
functions from directly mutating passed-in state, returning their desired state, and letting the client (and thus interceptors) decide how to merge that in.client-nuxt
doesn't invoke the actual request function itself, it wraps a "request" in a Nuxt composable, and the composable decides when to invoke the request (and potentially reinvoke it when changes happen).Ref
's are made unreactive and then potentially never updated again.@hey-api/test-utils
internal package. Currently holds the newmsw
logic for testing. It's split in 2 parts:client-nuxt
which uses that new mock server, that should also replicate/include all of the original tests.🔗 Related bug reports/feature requests
Package import specifier "#build/nuxt.config.mjs" is not defined in package
#1660 - only when using the nuxt module, but not forclient-nuxt
directly.🧰 Type of change
📝 Notes to reviewer
Still some TODO items.
Package import specifier "#build/nuxt.config.mjs" is not defined in package
#1660 -- going to look into this more.