Reddit-Enhancement-Suite icon indicating copy to clipboard operation
Reddit-Enhancement-Suite copied to clipboard

Replace webpack with esbuild

Open larsjohnsen opened this issue 1 year ago • 8 comments

This PR removes the Webpack build system, replacing it with the simpler esbuild.

The main difference from the webpack setup is how resources are loaded. The build process is initiated by build.js, which prepares manifests, distributed files, and bundling the javascript and CSS. Resources must now be referenced explicitly where used (mainly references in manifest.json). Additionally, all module files and media hosts must now be explicitly referenced.

Some of the dev dependencies are removed, like nyc, postcss, and autoprefixer since they apparently are not needed anymore. The main babel dependency is kept due toeslint requiring it when the code is flowtype annotated, although it is not used in the main build process.

All other dependencies except for flow-bin and nightwatch are now up to date. These requires a fair amount of work to get up to date.

nodejs 21 is required to build this.

Tested in browser: Firefox 121, Chrome 122

larsjohnsen avatar Jan 12 '24 15:01 larsjohnsen

Can we remove nightwatch? I think saucelabs stopped working for us years ago?

benmcgarry avatar Jan 12 '24 20:01 benmcgarry

Can we remove nightwatch? I think saucelabs stopped working for us years ago?

The test suite is still valuable and can be run locally, though many of the tests are now failing due to changes in the browsers' control interface. Probably not too hard to fix for someone familiar with Nightwatch / webdriver, so I think we should keep it.

larsjohnsen avatar Jan 12 '24 22:01 larsjohnsen

Is the blocker for updating nightwatch our setup? Guessing we need to re-write it all.

benmcgarry avatar Jan 12 '24 22:01 benmcgarry

From what I could figure out from attempting to run the tests locally: some changes in nightwatch.conf.js would be required and some of the methods used in the tests are removed. This seems to be completely independent of the build system, however.

larsjohnsen avatar Jan 12 '24 22:01 larsjohnsen

We still have free access to browserstack as a OSS project, i'll take this as something for me to do to try move to it. From a quick search I think we can quickly flip our tests over.

benmcgarry avatar Jan 12 '24 23:01 benmcgarry

Whats blocking on flow-bin?

benmcgarry avatar Jan 13 '24 01:01 benmcgarry

Whats blocking on flow-bin?

Upgrading past flow-bin 84 requires a lot of additional annotation.

larsjohnsen avatar Jan 13 '24 10:01 larsjohnsen

After this i'll try mv3 again, as i think this may make it easier to get that all updated.

benmcgarry avatar Jan 16 '24 17:01 benmcgarry

Is this all good from your side @larsjohnsen ?

benmcgarry avatar Feb 14 '24 20:02 benmcgarry

Yes, it appears to be running fine. I've mainly been running this in Firefox though.

larsjohnsen avatar Feb 14 '24 20:02 larsjohnsen