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

Replace webpack with esbuild #5488

Merged
merged 13 commits into from
Feb 15, 2024
Merged

Conversation

larsjohnsen
Copy link
Collaborator

@larsjohnsen larsjohnsen commented Jan 12, 2024

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

@benmcgarry
Copy link
Collaborator

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

@larsjohnsen
Copy link
Collaborator Author

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.

@benmcgarry
Copy link
Collaborator

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

@larsjohnsen
Copy link
Collaborator Author

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.

@benmcgarry
Copy link
Collaborator

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
Copy link
Collaborator

Whats blocking on flow-bin?

@larsjohnsen
Copy link
Collaborator Author

Whats blocking on flow-bin?

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

This removes ava's broken dependency transpiling using babel. Instead it strips the flow type definitions, and runs the ava tests on native code.

Running the code natively also requires explitic extensions on imports, so '.js' is added where necessary.
@benmcgarry
Copy link
Collaborator

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

@benmcgarry
Copy link
Collaborator

Is this all good from your side @larsjohnsen ?

@larsjohnsen
Copy link
Collaborator Author

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

@benmcgarry benmcgarry merged commit 7fd526f into honestbleeps:master Feb 15, 2024
5 checks passed
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