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

Move from Webpack to Esbuild #18447

Merged
merged 4 commits into from
Mar 27, 2023
Merged

Move from Webpack to Esbuild #18447

merged 4 commits into from
Mar 27, 2023

Conversation

KKoukiou
Copy link
Contributor

@KKoukiou KKoukiou commented Mar 3, 2023

Dependencies:

TODO:

@KKoukiou KKoukiou added the no-test For doc/workflow changes, or experiments which don't need a full CI run, label Mar 3, 2023
@KKoukiou KKoukiou force-pushed the esbuild branch 4 times, most recently from 3c8148d to c0dccb9 Compare March 8, 2023 17:44
pkg/build Outdated Show resolved Hide resolved
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I'm excited to see some progress here. Happy to help with the Debian copyright generation etc.

pkg/lib/cockpit-components-table.scss Show resolved Hide resolved
pkg/lib/esbuild-eslint-plugin.js Outdated Show resolved Hide resolved
packit.yaml Outdated Show resolved Hide resolved
tools/esbuild-make Outdated Show resolved Hide resolved
@martinpitt

This comment was marked as resolved.

@martinpitt martinpitt force-pushed the esbuild branch 2 times, most recently from 4b2f9cd to 9712875 Compare March 15, 2023 07:03
@martinpitt martinpitt added the .github-changes Set by a reviewer just before landing to acknowledge that a PR changes github workflows label Mar 15, 2023
@github-actions github-actions bot removed the .github-changes Set by a reviewer just before landing to acknowledge that a PR changes github workflows label Mar 15, 2023
@martinpitt martinpitt temporarily deployed to cockpit-dist March 15, 2023 07:05 — with GitHub Actions Inactive
@martinpitt martinpitt added the .github-changes Set by a reviewer just before landing to acknowledge that a PR changes github workflows label Mar 15, 2023
@github-actions github-actions bot removed the .github-changes Set by a reviewer just before landing to acknowledge that a PR changes github workflows label Mar 15, 2023
@martinpitt martinpitt temporarily deployed to cockpit-dist March 15, 2023 08:00 — with GitHub Actions Inactive
@martinpitt martinpitt temporarily deployed to cockpit-dist March 15, 2023 10:00 — with GitHub Actions Inactive
@martinpitt martinpitt temporarily deployed to cockpit-dist March 15, 2023 12:42 — with GitHub Actions Inactive
@martinpitt martinpitt temporarily deployed to cockpit-dist March 15, 2023 13:08 — with GitHub Actions Inactive
@martinpitt martinpitt temporarily deployed to cockpit-dist March 15, 2023 13:51 — with GitHub Actions Inactive
@martinpitt martinpitt temporarily deployed to cockpit-dist March 16, 2023 05:07 — with GitHub Actions Inactive
@martinpitt martinpitt temporarily deployed to cockpit-dist March 16, 2023 05:45 — with GitHub Actions Inactive
@KKoukiou KKoukiou temporarily deployed to cockpit-dist March 16, 2023 11:31 — with GitHub Actions Inactive
@martinpitt
Copy link
Member

Yay, there's a new esbuild: https://github.com/evanw/esbuild/releases/tag/v0.17.13

I confirmed that wasm can now build this just fine, without the mega-commit 6a6d298 (saving the link here in case we need it again)

@KKoukiou : I squashed this again, as it needed a force-push anyway. Looks much cleaner now!

@KKoukiou

This comment was marked as outdated.

@martinpitt

This comment was marked as outdated.

@KKoukiou
Copy link
Contributor Author

all the rest pixel tests failures from This run don't look like regressions, rather are expected changes because of the breakpoints redefinition approach change.

@martinpitt

This comment was marked as outdated.

@martinpitt martinpitt force-pushed the esbuild branch 2 times, most recently from 053b612 to f92ea3c Compare March 26, 2023 23:03
@martinpitt
Copy link
Member

martinpitt commented Mar 26, 2023

I implemented a proper watch mode like in cockpit-project/cockpit-podman#1243 . Pushing it as a separate commit for review and history, but I'll squash it now, update pixel tests, and drop no-test. This will be the first push which has a chance to actually land.

@martinpitt martinpitt removed the no-test For doc/workflow changes, or experiments which don't need a full CI run, label Mar 26, 2023
@martinpitt

This comment was marked as resolved.

The Python bridge stitches these files together with manifests.js. But
esbuild does not auto-terminate the chunks with semicolons, so the call
ended up as `cockpit.locale(...)cockpit.locale(...)`, which is invalid.
Ensure to always terminate the cockpit.locale() call to fix that.
@martinpitt martinpitt marked this pull request as ready for review March 27, 2023 08:32
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went through this again with my reviewer goggles on, and found a few small cleanups. But before I push again, I want to see a fully green test set.

build.js Outdated Show resolved Hide resolved
build.js Outdated Show resolved Hide resolved
Comment on lines +44 to +45
tests: [
"base1/test-base64",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up: Replace with a glob.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.. except that node.js does not have an API for globbing, meh..

build.js Show resolved Hide resolved
We don't need the `$ESLINT`/`$STYLELINT` env variables any more to
coordinate between build.js and webpack-config.js, as everything is in
build.js now. Update HACKING.md accordingly.

Implement our own watch mode due to the deficiencies of esbuild's [1].
This is similar to podman's [2], but with recursive watching.

Because the approach for redefining breakpoints changed, update pixel
tests for the spacing noise.

Co-Authored-By: Martin Pitt <mpitt@redhat.com>

Fixes cockpit-project#17629

[1] evanw/esbuild#1204 (comment)
[2] cockpit-project/cockpit-podman#1243
Patternfly-react is in freeze right now, essentially till June when v5
is first released. This is a super hacky work around - but better than
having UI regressions.

This can be undone once patternfly with
patternfly/patternfly-react#8864 is released.
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy enough with this now, but of course I messed around with this heavily. Anything from your side still, @KKoukiou ?

@mvollmer , do you want to take a quick look?

".sh": "text",
},
};

const parser = (await import('argparse')).default.ArgumentParser();
parser.add_argument('-c', '--config', { help: "Path to webpack.config.js", default: "webpack.config.js" });
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops this option can now be dropped.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's wait for @mvollmer 's review, as this is otherwise green, and rather "expensive" (pixel tests, node_modules rebuild). I want to do a follow-up anyway to simplify tests in files.js, happy to clean it up then. Of course, when Marius finds other issues, we can fix this right away.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #18565

@KKoukiou KKoukiou merged commit 584c9a3 into cockpit-project:main Mar 27, 2023
@KKoukiou KKoukiou deleted the esbuild branch March 27, 2023 13:22
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.

None yet

3 participants