Thanks to visit codestin.com
Credit goes to github.com

Skip to content

use swc-loader instead of ts-loader #525

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

Merged
merged 5 commits into from
Mar 11, 2022
Merged

use swc-loader instead of ts-loader #525

merged 5 commits into from
Mar 11, 2022

Conversation

julianocomg
Copy link
Contributor

@julianocomg julianocomg commented Mar 10, 2022

SWC is much faster and robust than TSC. It's written in Rust and can be used with webpack by using their swc-loader.

What was changed

Replaced ts-loader by swc-loader.

Why?

Checklist

  1. Closes

  2. How was this tested:

  • We've been testing it in dev for a while by using "npm patch-package" and no errors so far.
  1. Any docs updates needed?

@CLAassistant
Copy link

CLAassistant commented Mar 10, 2022

CLA assistant check
All committers have signed the CLA.

@bergundy
Copy link
Member

@julianocomg don't you need to change the webpack config too?

@julianocomg
Copy link
Contributor Author

@julianocomg don't you need to change the webpack config too?

Yeah, my bad. I forgot to push the webpack config change. Fixed now.

@bergundy
Copy link
Member

Thanks!

Out of curiosity, how much does it actually improve build times?

@julianocomg
Copy link
Contributor Author

Thanks!

Out of curiosity, how much does it actually improve build times?

Our workers were taking ~1.5 min to compile on our dev's machine. It now takes 5 seconds (not kidding).

@julianocomg
Copy link
Contributor Author

Just added the missing @swc/core dependency. swc-loader needs it to work.

@julianocomg
Copy link
Contributor Author

@bergundy Does the CI for the last commit need to be triggered again?

@bergundy
Copy link
Member

@julianocomg I just triggered it

@julianocomg
Copy link
Contributor Author

@julianocomg I just triggered it

Seems that the last 2 CIs are stuck :(

@lorensr
Copy link
Contributor

lorensr commented Mar 11, 2022

Our workers were taking ~1.5 min to compile on our dev's machine. It now takes 5 seconds (not kidding).

Wow, thanks! 😄

Seems that the last 2 CIs are stuck :(

image

Yeah that's a long test! 😆 Since it's in progress, I can't manually re-run them. Try merging with latest main? Also, I recommend setting this in future: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork#enabling-repository-maintainer-permissions-on-existing-pull-requests

@julianocomg
Copy link
Contributor Author

julianocomg commented Mar 11, 2022

@lorensr Unfortunately that option is not appearing to me for this existing PR, but I merged main, let's see what happens. The "sdk-features-test" job seems to be failing already but I don't think the error is related to my change 🤔

@julianocomg
Copy link
Contributor Author

julianocomg commented Mar 11, 2022

@lorensr oh... now seems that a lot of things are failing after that merge. none of them seem to be related to swc/tsc

@lorensr
Copy link
Contributor

lorensr commented Mar 11, 2022

Sorry about that! For now, I figured out how to manually restart. I'll work on fixing the sdk-features action soon, and the windows built-and-test is intermittent—haven't looked into that one yet, tracking here: #496 (comment)

@lorensr
Copy link
Contributor

lorensr commented Mar 11, 2022

Okay the windows build-and-test failure is much less intermittent than it used to be! I'll look into it tomorrow.

@lorensr lorensr added this to the 0.19.0 milestone Mar 11, 2022
@lorensr
Copy link
Contributor

lorensr commented Mar 11, 2022

Fixed test in #526. Merged w/ latest main locally and tests pass.
image

@lorensr lorensr merged commit 1f16716 into temporalio:main Mar 11, 2022
lorensr pushed a commit that referenced this pull request Mar 11, 2022
* use swc-loader instead of ts-loader

* change webpack config to use swc-loader

* add @swc/core as dependency of worker package

* Update package-lock.json
@julianocomg
Copy link
Contributor Author

@lorensr that's awesome! thanks dude!! 🥳

@lorensr
Copy link
Contributor

lorensr commented Mar 12, 2022

Thank you! ☺️

lorensr pushed a commit that referenced this pull request Mar 12, 2022
* use swc-loader instead of ts-loader

* change webpack config to use swc-loader

* add @swc/core as dependency of worker package

* Update package-lock.json
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