remix
                                
                                 remix copied to clipboard
                                
                                    remix copied to clipboard
                            
                            
                            
                        WIP: vite-plugin-react-swc integration
See https://github.com/vitejs/vite-plugin-react-swc/pull/191
⚠️ No Changeset found
Latest commit: cef3e66cad89e31b5550b1c3ab51fbb311251353
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
For React plugin to function correctly, we need to only create ?client-route virtual modules in production, not in development. Currently, the React plugin will only add React Refresh header/footer to files that define React components (which is correct), but the virtual modules re-export React components defined in their corresponding route modules. We used to manually inject React Refresh header/footer for these vmods too when we vendored/modified the React plugin.
?client-route vmods exist solely to guarantee same production-mode treeshaking from classic (esbuild-based) Remix compiler still happens when migrating to Remix Vite. Originally, I was opposed to having ?client-route vmods exist only in the prod module graph, but since they exist solely to power optimizations like treeshaking that only get applied in prod, its ok for that part of the module graph to be different. Especially since these vmods are one-liners that just re-export client-safe exports, so there isn't a bunch of complexity that could trip us up.
@pcattori I've merged main into this PR with https://github.com/remix-run/remix/pull/9395 so usage of ?client-route=1 has been removed in dev.
This cleanup will be in RRv7, so no need to force it into Remix at the moment