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

Allow returning undefined from loaders/actions since turbo-stream allows it #11651

Closed
ryanflorence opened this issue Jun 10, 2024 · 1 comment
Assignees
Labels

Comments

@ryanflorence
Copy link
Member

See #11513

The idea here is that we probably only didn't want to allow undefined previously because it's stripped from JSON.stringify. So we added our own error - which we then also added to defer for consistency (no resolving a defer promise with undefined).

With single fetch - turbo-stream can stream undefined without issue and can handle resolving promises with undefined. Folks have also specifically filed bugs that resolving with undefined crashes/hangs because we no longer have a defer place to detect and throw.

So it seems simpler overall to just let them return whatever they want/ resolve with whatever they want, and stream it down untouched.

This should be done in Remix v2 behind the future flag (removing the error from loaders/actions) and then copied into v7

@brophdawg11
Copy link
Contributor

#11680

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

No branches or pull requests

3 participants