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

chore: convert to esbuild #2579

Merged
merged 7 commits into from
Oct 22, 2020
Merged

chore: convert to esbuild #2579

merged 7 commits into from
Oct 22, 2020

Conversation

straker
Copy link
Contributor

@straker straker commented Oct 21, 2020

Esbuild is a "newer" javascript bundler that I've been interested in trying out. It runs super fast (benchmarks on their repo) and looking at the output does Rollup style resolving where it concats the functions by use instead of using webpack style resolve (resulting in cleaner and smaller output). Even better, esbuild works out of the box to resolve node_module style webpack paths and doesn't have the same problem I was facing with Rollup and having to add a few plugins for that (and still ran into issues with Axios).

Doing this resulted in a filesize decrease of 15 kB gzipped.

Webpack stats:

File Minified Gzip
axe.js 1.29 MB 188 kB
axe.min.js 561 kB 125 kB

Esbuild stats

File Minified Gzip
axe.js 940 kB 164 kB
axe.min.js 421 kB 110 kB

Part of issue: #2357

Reviewer checks

Required fields, to be filled out by PR reviewer(s)

  • Follows the commit message policy, appropriate for next version
  • Code is reviewed for security

@straker straker requested a review from a team as a code owner October 21, 2020 17:32
Copy link
Member

@stephenmathieson stephenmathieson left a comment

Choose a reason for hiding this comment

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

LGTM, but should get approval from Wilco or Dylan on this one.

@jeeyyy
Copy link
Contributor

jeeyyy commented Oct 22, 2020

Nice one @straker

bundle: true
})
.then(done)
.catch(done);
Copy link
Member

Choose a reason for hiding this comment

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

Should be calling done(false) here according to the Grunt docs

Copy link
Contributor Author

@straker straker Oct 22, 2020

Choose a reason for hiding this comment

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

Error also is valid:

Either false or an Error object may be passed to the done function to instruct Grunt that the task has failed.

I checked and esbuild gives an error in the catch and a success object in the then.

Copy link
Member

Choose a reason for hiding this comment

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

Ah cool, ok 👍

@straker straker merged commit c627d54 into develop Oct 22, 2020
@straker straker deleted the esbuild branch October 22, 2020 19:30
@straker straker mentioned this pull request Nov 2, 2020
2 tasks
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.

4 participants