Skip to content

Commit

Permalink
RSC: Vite plugin for route loading (#10252)
Browse files Browse the repository at this point in the history
**Problem**
We have to be smarter about how we automatically load route pages during
dev. As a result, we have refactored out the logic into a vite plugin
which has access to knowledge about whether it is being built for (or
served for) SSR.

**Changes**
1. Removed babel plugins for the RSC server and client route loading
2. Added a vite plugin which uses babel to automatically import the
route pages
3. Refactored the `react` vite plugin back into the root config in
`index.ts` as it no longer has to be specifically applied in the various
vite build or create calls.
  • Loading branch information
Josh-Walker-GM authored Mar 17, 2024
1 parent b7d3cfc commit 43ca27a
Show file tree
Hide file tree
Showing 17 changed files with 631 additions and 566 deletions.
2 changes: 1 addition & 1 deletion __fixtures__/test-project/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
"autoprefixer": "^10.4.18",
"postcss": "^8.4.35",
"postcss": "^8.4.36",
"postcss-loader": "^8.1.1",
"prettier-plugin-tailwindcss": "^0.5.12",
"tailwindcss": "^3.4.1"
Expand Down
3 changes: 0 additions & 3 deletions packages/babel-config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,3 @@ export {
parseTypeScriptConfigFiles,
registerBabel,
} from './common'

export { redwoodRoutesAutoLoaderRscClientPlugin } from './plugins/babel-plugin-redwood-routes-auto-loader-rsc-client'
export { redwoodRoutesAutoLoaderRscServerPlugin } from './plugins/babel-plugin-redwood-routes-auto-loader-rsc-server'

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 43ca27a

Please sign in to comment.