-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Switch from webpack
to rspack
for bundling
#16005
base: main
Are you sure you want to change the base?
Conversation
Thanks for making a pull request to jupyterlab! |
Opening early to:
|
7032cc7
to
9446adf
Compare
e64a82d
to
a158954
Compare
Hi @jtpio , how to migrate custom widget library with custom webpack.config.js? |
Rspack 0.6.0 now supports it: https://www.rspack.dev/blog/announcing-0.6.html#built-in-support-for-mini-css-extract-plugin |
@jtpio I want to join your work, should I continue contributing to the jupyterlab-rspack project? |
Thanks @FoSuCloud! https://github.com/jtpio/jupyterlab-rspack might be lagging a bit behind now. Maybe we could work on this PR directly instead? If you are able to open PRs against this branch I would be happy to merge your contributions. There are still a few items listed in the top comment that we should check / re-enable, that can serve as a good starting point for continuing this work. Thank you again for offering your help! |
@erkin98 for now this is not ready yet. But hopefully the custom |
Looks like updating to the Rspack 0.6.1 release introduces the following error in the dev tools console: |
web-infra-dev/rspack#6230 this might be the same cause. Could you please try out the nightly version? seems not help the current nightly version |
Thanks @xc2 for chiming in! Also updating to the latest
|
Thanks! @ahabhgk fixes it in web-infra-dev/rspack#6265 please try 0.6.2-canary-4b8f4a6-20240417094517 |
Status update: there seems to be only 3 failing CI checks remaining:
diff-mathjax-rspack.webmrspack-failing-ui-tests.webmThere is also still some commented code related to the watch mode, and our use of |
@FoSuCloud I just posted a summary of where we currently are with the latest updates on this PR: #16005 (comment). In case you would still like to help with this, that would be really appreciated, thanks! |
I would be happy to contribute to this, thank you very much for the invitation |
Thanks @FoSuCloud! I rebased the PR to fix the conflicts. |
Ah,
cc @xc2 who may know what the issue could be? |
@ahabhgk can you help to check this Rspack panic ❤️ |
I have tested both versions 0.6.4 and 0.6.5, and found that the panic is gone in 0.6.5. It should have been fixed in web-infra-dev/rspack#6473. Btw, if you got type error regarding |
@@ -15,6 +15,7 @@ | |||
"preserveWatchOutput": true, | |||
"resolveJsonModule": true, | |||
"sourceMap": true, | |||
"skipLibCheck": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: remove
Ah it looks like there is a Segmentation fault again with the latest releases: https://github.com/jupyterlab/jupyterlab/actions/runs/9500757565/job/26184590724?pr=16005 |
f8ced7c
to
e0976c9
Compare
For reference, Rspack 1.0 is now available: https://rspack.dev/blog/announcing-1-0 |
Building an Jupyter frontend application with rspack 1.0 which includes a large part of the core I saw a speedup from 140s to 12-14s so a full order of magnitude. That said, it initially crashed with a cryptic error messagewhen there was something wrong in my rspack config so there are still some trade-offs. |
Do you recall what issue it was in the config? The Rspack devs who commented on this PR have been really helpful so far and helped fix some issues. Maybe we could report it to them? |
References
#15035
List of supported webpack plugins: https://www.rspack.dev/plugins/webpack/
Code changes
rspack
instead ofwebpack
for bundlingwebpack.config.js
torspack.config.js
. Or keep the existingwebpack.config.js
and userspack --config
@rspack/cli
and@rspack/core
when a new version is released, to grab the fix for [Feature]: add support for generator.dataUrl as a function in loader config web-infra-dev/rspack#5640license-webpack-plugin
works as expected. Normally it should be supported: https://www.rspack.dev/blog/announcing-0.2#license-webpack-plugin@type/webpack-sources
: fix: fix: remove@types/webpack-sources
and add declaration ofwebpack-sources
(close: #5867) web-infra-dev/rspack#5868experiments.css
(set totrue
by default), or keep the currentcss-loader
,style-loader
,mini-css-extract-plugin
. Might need support mini-css-extract-plugin web-infra-dev/rspack#3210User-facing changes
None
Backwards-incompatible changes
Should be none for most users and administrators using a stock JupyterLab with prebuilt extensions. Rspack supports module federation so existing extensions are compatible with JupyterLab built with Rspack and don't need to be updated.
Below is a screenshot showing JupyterLab running in dev mode from this branch, picking up the
jupyterlab-execute-time
prebuilt extension: