Skip to content

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

Closed
@ryanflorence

Description

@ryanflorence

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions