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): build time improvements #352

Merged
merged 6 commits into from
Oct 27, 2021
Merged

chore(build): build time improvements #352

merged 6 commits into from
Oct 27, 2021

Conversation

atabel
Copy link
Contributor

@atabel atabel commented Oct 7, 2021

Changes:

  • Use swc instead of babel. Code transpilation goes from ~10s to ~500ms.
  • Combine all jscodeshift transforms into a single one

Some timings:

Dell Laptop Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz

Master This branch
yarn build 129s 41s
yarn storybook 37s 17s
yarn playroom 28s 11s
yarn test 39s / 17s * 17s
yarn test-acceptance 248s 185s

Desktop AMD Ryzen 7 3700X 8-Core Processor

Master This branch
yarn build 61s 27s
yarn storybook 26s 11s
yarn playroom 18s 8s
yarn test 26s / 11s * 9s
yarn test-acceptance 112s 71s

*yarn test is faster on second run because of babel cache

@github-actions
Copy link

github-actions bot commented Oct 7, 2021

Deploy preview for mistica-web ready!

✅ Preview
https://mistica-web-4nglbahd8-tuentisre.vercel.app

Built with commit ec4ae30.
This pull request is being automatically deployed with vercel-action

@atabel atabel changed the title WEB-351 use swc instad of babel build time improvements Oct 7, 2021
@github-actions
Copy link

github-actions bot commented Oct 8, 2021

Screenshot tests report

✔️ All passing

@github-actions
Copy link

github-actions bot commented Oct 8, 2021

Accessibility report
✔️ No issues found

ℹ️ You can run this locally by executing yarn audit-accessibility.

@atabel atabel marked this pull request as ready for review October 8, 2021 11:31
@atabel atabel requested review from anabelengp and pladaria October 8, 2021 11:31
Comment on lines +21 to +23
].forEach((dirName) => {
rimraf.sync(`dist-es/${dirName}`);
});
Copy link
Member

@pladaria pladaria Oct 13, 2021

Choose a reason for hiding this comment

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

why don't you use the --ignore param?

https://swc.rs/docs/usage-swc-cli#--ignore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried. The ignored files are not compiled but they are copied to output folder :(

Comment on lines +11 to +13
transforms.forEach((transform) => {
transform(root, j);
});
Copy link
Member

Choose a reason for hiding this comment

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

nice!

@pladaria
Copy link
Member

great!

@anabelengp
Copy link
Member

is some tsc type checking needed now we are using swc??

@atabel
Copy link
Contributor Author

atabel commented Oct 14, 2021

is some tsc type checking needed now we are using swc??

No, type checking is independent of transpiling, typechecking is done by tsc and transpiling is done by babel or swc now.

@atabel atabel changed the title build time improvements chore(build): build time improvements Oct 27, 2021
@atabel atabel merged commit a30cd72 into master Oct 27, 2021
@atabel atabel deleted the atoledano-swc branch October 27, 2021 11:09
@tuentisre
Copy link
Collaborator

🎉 This PR is included in version 10.9.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants