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(build): switch to esbuild #511

Merged
merged 14 commits into from
Aug 4, 2022
Merged

chore(build): switch to esbuild #511

merged 14 commits into from
Aug 4, 2022

Conversation

sranka
Copy link
Contributor

@sranka sranka commented Aug 3, 2022

This PR modernizes the client build system to transpile the source code with esbuild. The client build time is thus reduced to 40% of the original time with equivalent build results.

More specifically:

  • it replaces rollup (with tsc compiler) with tsup (relies upon esbuild instead)
  • tsup still uses tsc compiler to produce typescript definition files (index.d.ts), there is no support to do so directly with esbuild (and also swc)
  • esbuild is customized in order to
    • create core's browser builds by replacing node transport with browser transport
    • gzip output js files (to keep the same results as previous rollup builds)
    • output UMD files in browser distributions, UMD is not supported by esbuild OOTB; UMD builds are still required in older build pipelines and web workers

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • yarn test completes successfully
  • Commit messages are conventional

@sranka sranka added this to the 1.29.0 milestone Aug 3, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #511 (44bb05c) into master (40e62c9) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #511   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           33        33           
  Lines         1256      1256           
  Branches       302       302           
=========================================
  Hits          1256      1256           
Impacted Files Coverage Δ
packages/core/src/util/currentTime.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 40e62c9...44bb05c. Read the comment docs.

@sranka sranka marked this pull request as ready for review August 3, 2022 13:55
@sranka
Copy link
Contributor Author

sranka commented Aug 3, 2022

All examples were tried manually as well as the built files.

@sranka sranka self-assigned this Aug 3, 2022
@sranka sranka requested review from vlastahajek and bednar August 3, 2022 13:56
Copy link
Contributor

@bednar bednar left a comment

Choose a reason for hiding this comment

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

LGTM 🍻

@sranka sranka merged commit e1e8b72 into master Aug 4, 2022
@sranka sranka deleted the chore/switch_to_esbuild branch August 4, 2022 06:37
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.

3 participants