Export node-adapter’s fromNodeRequest and toNodeRequest from @react-router/dev/vite/cloudflare #12774
+1
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
there’s a great project called Superflare that describes itself as a “full-stack toolkit for Cloudflare Workers” and offers user auth, an ORM and DB migration management for D1, and a bunch of other useful things. it provides a package specifically for integrating with Remix, which exports a vite dev proxy plugin that is a drop-in replacement for the
cloudflareDevProxy
plugin provided by Remix/RR v7 to automatically handle sessions and auth and provide it to the app load context. that plugin uses thefromNodeRequest
andtoNodeRequest
utils from the vite/node-adapter.ts file (imported here).i am currently working on making Superflare compatible with React Router v7, but the node-adapter.ts file is not available in the published
dist/
directory of@react-router/dev
. this one-line change to thevite/cloudflare.ts
file will enable importing everything we need for the cloudflare dev proxy plugin in @superflare/remix like so:i hope this change is amenable to you all. regardless, thank you all for such a great project/community resource! the greatly improved types for route files from RR v7 are most excellent, and more generally, i’ve found working with Remix and now RR v7 truly a pleasure.