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

[Feature] Switch from tsc to swc #19

Closed
1 task done
barthofu opened this issue Aug 16, 2022 · 1 comment · Fixed by #21
Closed
1 task done

[Feature] Switch from tsc to swc #19

barthofu opened this issue Aug 16, 2022 · 1 comment · Fixed by #21
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@barthofu
Copy link
Owner

barthofu commented Aug 16, 2022

Feature

swc is way much faster and would permit HMR.

Sources

Todo

  • Test the CI/CD with Github Actions
@barthofu barthofu added the enhancement New feature or request label Aug 16, 2022
@barthofu barthofu self-assigned this Aug 16, 2022
@barthofu barthofu added this to the v2 milestone Aug 16, 2022
@barthofu
Copy link
Owner Author

barthofu commented Aug 17, 2022

Started the implementation, first results so far on the two same codebase:

Build

npm run build

tsc swc
11.71s 6.53s
-44.23%
  • These results where calculated using the time unix command (e.g: time npm run build)
  • The swc build includes a tsc type-check with no emit, which is taking the most important part of the total time. The transpilation itself is almost instantaneous! The swc team is currently working on a type checker written in Go, waiting for it to come over (open sourced we hope 🙏)

Dev

npm run dev

ts-node swc-node
10.67s 5.02s
-52.95%
  • Results calculated by hand (yes, not the best solution ik). Chrono was started when entering the command, and stopped when the console stated the bot as online
  • The dev command uses swc-node, an alternative to the ts-node/register/transpile-only node loader

@barthofu barthofu changed the title [Feature] Switch from ts-node/tsc to swc [Feature] Switch from tsc to swc Aug 17, 2022
barthofu added a commit that referenced this issue Aug 17, 2022
@barthofu barthofu linked a pull request Aug 17, 2022 that will close this issue
barthofu added a commit that referenced this issue Aug 17, 2022
@barthofu barthofu modified the milestones: v2, v1.1 Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant