remix-run / remix

Build Better Websites. Create modern, resilient user experiences with web fundamentals.
https://remix.run
MIT License
28.28k stars 2.37k forks source link

Clean redundant `?client-route=1` usage in dev #9395

Closed markdalgleish closed 1 month ago

markdalgleish commented 1 month ago

This PR is aiming to address two things: 1) Support the move to vite-plugin-react-swc: https://github.com/remix-run/remix/pull/9092 2) Potentially unlock this fix in Hydrogen: https://github.com/Shopify/hydrogen/pull/2078

The ?client-route=1 virtual modules that wrap all client routes are only necessary for a build optimisation that removes unused exports from route files on the client. The only reason these virtual modules were used in development was to keep the dev and build code paths as similar as possible. However, since it's causing other issues, and it also necessitated extra code in dev to special-case HMR for these files, we're opting to remove ?client-route=1 usage in dev entirely.

changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: 93ca5d717baaf8c162ab6f03784240e7bd8edd8e

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