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 |
Thanks @xc2! I tried forcing the resolution of |
sry, a new PR is open for this tested in jupyterlab codebase - at least the rspack building tasks are competed. still waiting for the canary release finished upd: 0.6.2-canary-9f58a91-20240417174925 |
This seems to be fixing it, thanks @xc2! |
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 |
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: