Enhancing React Router Framework Mode with Faster Compilers (Expanding on #12405) #14056
JacobNWolf
started this conversation in
Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This proposal is a continuation of the discussion in #12405, aiming to provide a bit more detail on a potential improvement for React Router's framework mode. The idea is to explore supporting faster Rust-based compilers, such as
@vitejs/plugin-react-swc
and the upcoming@vitejs/plugin-react-oxc
.Currently, the
@react-router/dev
Vite plugin that enables framework mode uses Babel for compilation, much like the default@vitejs/plugin-react
in standard Vite React projects. While this works, Babel, being built in TypeScript/JavaScript, can be notoriously slow for compiling larger React projects. The difference in Hot Module Replacement (HMR) speeds during local development can be quite noticeable. Many large projects using React with Vite have found significant benefits in opting for faster Rust-based compilers, like@vitejs/plugin-react-swc
, which offers similar functionality but with development HMR speeds that can be up to 20 times faster.With the impending release of Rolldown, which is eventually set to become the default for Vite apps, the VoidZero team is encouraging the use of their new
@vitejs/plugin-react-oxc
. This plugin shares similar characteristics to the SWC implementation but is built in-house by their team with full Rolldown compatibility in mind. It's worth noting that Rolldown is very close to stable and has already seen use in large production projects such as Excalidraw, Outline, and Linear.It seems that by supporting the use of these alternative, faster compilers in framework mode, it could genuinely speed up development time for React Router 7 users. This could be a really valuable enhancement for developers working with larger codebases.
Beta Was this translation helpful? Give feedback.
All reactions