Skip to content
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

Experimental: Migrate to Rspack #156

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft

Conversation

cezaraugusto
Copy link
Member

No description provided.

@cezaraugusto
Copy link
Member Author

Updates Aug, 24th

Reloader plugin isn't working, which means manifest.json, service_worker and content_scripts are not reloading. Can't connect to the websocket server and requires a full migration of https://github.com/awesome-webextension/webpack-target-webextension to Rspack. I made a few adjustments to make it compile but it's far from working. Migration is doing well so far during tests and almost everything else works including the multiple CSS/JS integrations.

@cezaraugusto cezaraugusto force-pushed the rspack-experimental branch 2 times, most recently from 549757a to 5931a35 Compare August 27, 2024 18:57
@cezaraugusto
Copy link
Member Author

Updates Aug, 27th

Reloader plugin is working partially. Websocket server work is done. The manifest.json, service_worker and content_scripts files are still not reloading and requires a full migration of https://github.com/awesome-webextension/webpack-target-webextension to Rspack.

The manifest.json file should be working already given it's not part of webpack-target-webextension but it isn't for some reason.

Having the reload step done this PR will be ready to merge. I plan to have it in the final version of 2.0.0.

Copy link

codecov bot commented Aug 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Files Coverage Δ
programs/develop/webpack/lib/messages.ts 22.43% <ø> (ø)
programs/develop/webpack/lib/utils.ts 31.20% <ø> (ø)
...on/feature-resolve/steps/transform-source/index.ts 11.66% <ø> (ø)

@cezaraugusto
Copy link
Member Author

cc @OSpoon are you familiar with Rspack? I need a hand figuring out why Rspack isn't watching the manifest.json file (I'm testing with the content-react template). I'm currently trying to make the new rspack-target-webextension a thing. These are the two items left to make Extension.js fully migrated.

@OSpoon
Copy link
Member

OSpoon commented Aug 28, 2024

Are you planning to abandon Webpack and fully embrace Rspack? I'm not familiar with Rspack, but I can try to learn about it. This would be helpful for me in the future.

@cezaraugusto
Copy link
Member Author

@OSpoon if all works well, yes. Rspack has some advantages like a faster cold start, faster compilation time (for our templates, time is reduced by 2x/3x), overall smaller package sizes, and decent integration with the webpack ecosystem.

The plan for v2 is that users are requesting a way to extend Extension.js via config files and exposing webpack once would make it very hard to migrate later.

@OSpoon
Copy link
Member

OSpoon commented Aug 28, 2024

@cezaraugusto
How to confirm where the log should be printed when Rspack detects the manifest.json file?

I found that compiler.modifiedFiles does not return the manifest.json file in reload:create-web-socket-server, and it will not return in Webpack as well.

I might not fully understand the exact reason why it doesn't work.

Copy link

pkg-pr-new bot commented Sep 3, 2024

Open in Stackblitz

yarn add https://pkg.pr.new/extension-js/extension.js/extension@156.tgz
yarn add https://pkg.pr.new/extension-js/extension.js/extension-create@156.tgz
yarn add https://pkg.pr.new/extension-js/extension.js/extension-develop@156.tgz

commit: 70aaee7

Copy link

pkg-pr-new bot commented Sep 3, 2024

Open in Stackblitz

yarn add https://pkg.pr.new/extension-js/extension.js/extension@156.tgz
yarn add https://pkg.pr.new/extension-js/extension.js/extension-create@156.tgz
yarn add https://pkg.pr.new/extension-js/extension.js/extension-develop@156.tgz

commit: 70aaee7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants