-
-
Notifications
You must be signed in to change notification settings - Fork 705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plan for migrating to unplugin
to make the router-plugin compatible with other bundlers
#1756
Comments
unplugin
for making the router-plugin compatible with other bundlersunplugin
to make the router-plugin compatible with other bundlers
Tasks 1 and 2 are done (Start logic has been moved from the router-plugin into its own plugin). Had a minor setback where CI was broken because nx wasn't upgraded 😅 (#9412432), but otherwise all good 👍🏼.
Tomorrow I'll begin setting up "unplugin". |
Tasks 3 and 4 are done.
With just a preliminary search, I'm finding it difficult to find basic webpack react starter repos. I may just have to target rspack as the next bundler supported instead 🤔. |
Tasks 5 and 6 are done. The rspack/rsbuild plugin doesn't support the experimental code-splitting functionality yet due some limitations in using the Community contributions and anyone with knowledge on creating plugins for rspack would greatly be appreciated here. |
@ScriptedAlchemy might have some ideas about rspack. |
I'm happy to hear em |
Hi, love your work, it’s great to unplugin being used here. Is there any plan for supporting webpack as well? Rspack is cool but wasn’t the main point of this issue to make this plugin widely available? Webpack still has 300x more users than rspack 👀 |
If you are able to make a contribution to this I'd be more than happy to help out with the PR 💪🏼. If you are unable, a link to a decent starter bare-bones Webpack React starter with HMR would be appreciated 🙌🏼 (for testing, etc.) Realistically, I could just add a |
@SeanCassiere I was able to put together a webpack quickstart example. Unfortunately, the plugin doesn't "just work"™️ for webpack. Please have a look at #1864 if you find some time. When I change anything in the [webpack-dev-middleware] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at new NodeError (node:internal/errors:405:5)
at validateString (node:internal/validators:162:11)
at isAbsolute (node:path:1156:5)
at handleFile (file:///Users/honza/Sites/router/packages/router-plugin/dist/esm/router-generator.js:37:33)
at file:///Users/honza/Sites/router/packages/router-plugin/dist/esm/router-generator.js:51:15
at run (file:///Users/honza/Sites/router/packages/router-plugin/dist/esm/router-generator.js:44:13)
at Object.watchChange (file:///Users/honza/Sites/router/packages/router-plugin/dist/esm/router-generator.js:50:13)
at file:///Users/honza/Sites/router/node_modules/.pnpm/unplugin@1.10.2/node_modules/unplugin/dist/index.mjs:1862:80
at Set.forEach (<anonymous>)
at file:///Users/honza/Sites/router/node_modules/.pnpm/unplugin@1.10.2/node_modules/unplugin/dist/index.mjs:1861:41 {
code: 'ERR_INVALID_ARG_TYPE' |
Down with the flu ATM. Will look into this in a couple days. |
Currently, the router plugin is only available for vite. This leaves people who use bundlers like
webpack
androllup
having to install the@tanstack/router-cli
package and run it every time they start up their dev server. This is not the most optimal experience. Additionally, it also makes features likeexperimental.enableCodeSplitting
only available to thevite
users.The intention here is to begin the migration to using unplugin so the router plugin can be made available for other bundlers like
webpack
,rspack
, etc. in the future.Currently, the router plugin packages are:
@tanstack/router-generator
@tanstack/router-cli
@tanstack/router-vite-plugin
And by the end of this migration, it should be:
@tanstack/router-generator
@tanstack/router-cli
@tanstack/router-plugin
@tanstack/router-vite-plugin
@tanstack/start-vite-plugin
For this task to be considered complete, the following milestones need to be achieved.
Note
Each of these major tasks (like
1, 2, ...
), should go through in separate PRs to make reverts easier, whilst minor tasks (like2.1, 2.2, ...
) would be batched together under their respective majors.Migration tasks
For now, I've included
rspack
as the only bundler we're targeting to support next. The plugins for the other bundlers can be added in the future either through community contributions or when maintainers get more bandwidth 😅.The text was updated successfully, but these errors were encountered: