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
fix(nuxt): await async payload revivers #25222
Conversation
Run & review this pull request in StackBlitz Codeflow. |
@CernyMatej There are tests in place though, see nuxt/test/fixtures/basic/plugins/custom-type-registration.ts Lines 3 to 4 in 629461b
|
@manniL thanks for pointing that out! Didn't notice them. However, those are only fixtures. Where are they used in tests? I'd be happy to write a test case for it if you could tell me where to put it. |
@CernyMatej That's it! the first link shows where it is set up and the 2nd link shows where it is checked in the fixture, throwing an error and failing tests when the reviving would fail |
I noticed that I had made changes to the At the moment, Changing |
@CernyMatej I think it would unless introducing a parseAsync function π |
π Linked issue
β Type of change
π Description
This PR resolves an issue where the payload reviver was not awaited if it was an asynchronous function. This could be useful for creating more versatile payload revivers (utilizing dynamic imports), for example. However, prior to this change, the revived value on the client would be a promise instead of its resolved value.
It would probably also be a good idea to add tests for this issue. However, I noticed that
definePayloadReducer
anddefinePayloadReviver
are listed inskippedComposables
in the tests. Is there a reason why they are not tested?π Checklist