-
Notifications
You must be signed in to change notification settings - Fork 39
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
Replace vite-node-miniflare with cloudflareDevProxy from @react-router/dev #44
Conversation
@ariofrio with this change does the d1 example actually still work? |
Ah, great catch. The
I'm unsure how to make this work with
|
Would it be worth in that case, having this PR just updates the cloudflare template, and open an issue with the above? |
I'm super new to both Cloudflare and Remix run but am really interested in getting set up with best practices while I'm learning. Seeing all of the complex vite plugin config get removed in this PR definitely seems appealing but I'm not fully understanding how I would go about using D1 with these changes. |
@WonderPanda I opened a PR on react-router-hono plugin that shows how simple is to use cloudflare and react router powered by a hono server, which claims to be the faster server for workers. Here is the example project |
Thanks, this looks really cool. I'll play around with on my end and see if fixes the issues I've been running into trying to ramp up on this stack. |
Let me know how it goes, also don't hesitate to reach out for any help, good luck! |
@ariofrio I went ahead and merged #6 in, which didn't update the If you want to try to update the d1 template that'd be great, but as pointed out this solution does not work as is because it does not actually setup the d1 connection
|
I think a few of these things will end up being dependent on this new WIP plugin from Cloudflare. I believe this works with Vite's new environments API and will allow dev to go through a worker instead of just bindings |
This looks really promising! Thanks for sharing I'll definitely be keeping an eye on progress here now |
Nice, thanks @dan-gamble. Yeah, I'm inclined to close this PR in the meantime and keep #52 open until a better plugin/approach becomes available @ariofrio I went ahead and opened #63 if you (or anyone) would like to take a look and see if you can suggest improvements |
Issues with Cloudflare Templates
wrangler.toml
andvite.config.ts
for dev modevite.config.ts
requiring manual CJS dependency configuration inssr.optimizeDeps.include
to work in dev mode@hiogawa/vite-node-miniflare
for local dev modeSolution
Using
cloudflareDevProxy
from@react-router/dev
:wrangler.toml
for developmentssr
options or makes them unnecessarycloudflare
andcloudflare-d1
templates updated@jacob-ebey: Any thoughts on why the templates weren't using
cloudflareDevProxy
initially?Note: This supersedes #6 (does this for
cloudflare
template and also addswrangler types
support). That should be separate since we need to decide on npm scripts and.gitignore
handling.