Skip to content

vite: cloudflare preset load context - #8649

Merged
pcattori merged 5 commits into
release-nextfrom
pedro/release-cloudflare-preset-load-context
Jan 31, 2024
Merged

pcattori merged 5 commits into
release-nextfrom
pedro/release-cloudflare-preset-load-context

Conversation

@pcattori

@pcattori pcattori commented Jan 31, 2024 •

Copy link
Copy Markdown
Contributor

Closes: #

  • Docs
  • Tests

Testing Strategy:

@changeset-bot

changeset-bot Bot commented Jan 31, 2024 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1917bc3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@remix-run/dev Patch
create-remix Patch
remix Patch
@remix-run/architect Patch
@remix-run/cloudflare Patch
@remix-run/cloudflare-pages Patch
@remix-run/cloudflare-workers Patch
@remix-run/css-bundle Patch
@remix-run/deno Patch
@remix-run/eslint-config Patch
@remix-run/express Patch
@remix-run/node Patch
@remix-run/react Patch
@remix-run/serve Patch
@remix-run/server-runtime Patch
@remix-run/testing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

since we dropped the term "adapter" in favor of "preset" its needs
less clarification
@pcattori
pcattori merged commit 45e28ed into release-next Jan 31, 2024
@pcattori
pcattori deleted the pedro/release-cloudflare-preset-load-context branch January 31, 2024 20:47
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Hello there,

We just published version 2.6.0-pre.1 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions

github-actions Bot commented Feb 1, 2024

Copy link
Copy Markdown
Contributor

🤖 Hello there,

We just published version 2.6.0-pre.2 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@kiliman

kiliman commented Feb 1, 2024

Copy link
Copy Markdown
Contributor

@pcattori Is setRemixDevLoadContext considered a public API?

I'm using a custom Express server, so it would be nice if I could set the load context in the Vite dev server as well.

@pcattori

pcattori commented Feb 1, 2024 •

Copy link
Copy Markdown
Contributor Author

@kiliman : no, its not considerd public API.

The idea is that for Node-based custom servers, you can use the same server for both dev and prod where you can choose to delegate asset handling and route handling to Vite in dev. In that world, you already have direct access to createRequestHandler where you can do whatever you'd like with loadContext. And the best part is that your load context is automatically consistent in dev and prod.

The issue with CF is that (as of today) Vite can't delegate server code execution to other runtimes (like workerd) so you can't run the same server for dev and prod (yet). So setRemixDevLoadContext is a temporary stopgap for CF to approach parity with Node-based custom servers.

@kiliman

kiliman commented Feb 1, 2024

Copy link
Copy Markdown
Contributor

True. Thanks!

@github-actions

github-actions Bot commented Feb 1, 2024

Copy link
Copy Markdown
Contributor

🤖 Hello there,

We just published version 2.6.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants