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

Upgrade to Webpack 5 (or Vite, or something else for local playgrounds) #119

Closed
coolsoftwaretyler opened this issue Sep 19, 2024 · 5 comments

Comments

@coolsoftwaretyler
Copy link
Collaborator

In #115 and #116, we upgraded Node and chromedriver, which breaks older versions of Webpack.

We have monkey patched the hashing function, but it would be preferable to update the Webpack config to a modern version.

I'm also open to Vite, which I personally have used for browser extensions before and like a lot. Open to other suggestions or PRs!

@coolsoftwaretyler coolsoftwaretyler added this to the 2024 Dev Readiness milestone Sep 19, 2024
@coolsoftwaretyler
Copy link
Collaborator Author

Hey @grvv - are you interested in working on this as a follow up to #121 and #122? I'd be happy to either let you take it on, work on it together, or I can just pick it up myself if you won't have time in the next couple of weeks.

Overall, the goal is to be able to package up the source code into a browser extension. I think it's simplest to keep targeting Manifest v2 and save the v3 migration for a separate step. But I can see a scenario where that work is too interlinked to separate.

As far as the Webpack/Vite upgrade goes, I think there are three options:

  1. Step up one major version at a time in separate commits or PRs, following the migration path directions from Webpack.
  2. Jump all the way to Webpack 5 in one go and just rewrite all the configurations to be compatible.
  3. We could also migrate entirely away from Webpack and use Vite instead. I've had a lot of success with this browser extension boilerplate in my day job, and they use Vite for extensions.

I don't have a strong opinion yet, I think whatever gets us to a modern bundler (Webpack 5 or Vite) and preserves the current build scripts/playground tests is a good thing to aim for.

@grvv
Copy link
Contributor

grvv commented Oct 15, 2024

@coolsoftwaretyler
Yeah, I can definitely take this one. Let’s sync up and make a plan on how we want to approach it. A walkthrough of the repo and any future plans would be super helpful, as it’ll guide me in making more informed technical decisions.

As for the bundler, I’ve had good experiences with both Webpack and Vite, but I also think RSpack could be a viable option to explore, as it’s designed to be a drop-in replacement for Webpack. If we go with Vite, we’ll need to consider migrating the test setup as well, which might add some overhead. I’m happy to explore any of these options and see what fits best for the project.

Let’s aim for whatever gets us to a modern setup (whether Webpack 5, Vite, or RSpack) while keeping the current build scripts and playground tests intact.

@coolsoftwaretyler
Copy link
Collaborator Author

Awesome. I have heard of RSpack and would be excited to try it.

I'll send you an email today and we can chat more in depth. Thanks!

@grvv
Copy link
Contributor

grvv commented Oct 23, 2024

here we go:

#127

@coolsoftwaretyler
Copy link
Collaborator Author

Phenomenal. Closed with #127

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

No branches or pull requests

2 participants