You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Similar to Next.js, this PR updates force to use the Rust-based SWC compiler for compilation performance. Still need to run the numbers a bit more and compare against a few things as the results so far are milder than I'd expect. However, that said, everything is just about working! Force compiles and things run as one would expect.
Given the bleeding-edge nature of this work, the time savings need to be substantial enough en-masse to justify moving away from Babel. That Next.js is using it as its main compiler is promising, though.
Update (8/5/2022):
Turning this flag on by default, which should apply to both tests and local development. To opt-out, set this flag in your .env:
EXPERIMENTAL_SWC_COMPILER_DISABLED=true
A handful of tests (~12) were disabled in this commit and flagged with a comment:
// FIXME: SWC_COMPILER_MIGRATION
Many of these tests were anomalous; we should go through and resolve but not hold up the performance wins in this PR in the meantime.
Also note that SWC compilation is not enabled in prod; this is only a dev-time DX / CI test runner performance improvement.
⚠️ To use this feature be sure to prepend the EXPERIMENTAL_SWC_COMPILER=true env flag to any commands
The reason will be displayed to describe this comment to others. Learn more.
Very nice! When testing this locally I’m seeing significant time savings with yarn build and yarn jest => down from 36s to 16s for yarn build and 20s to 16s for yarn jest. 🎉
@araujobarret - this surprised me too 😄. Not many hacks, but it was quite hard to find how all the pieces fit together since there are no docs. I need to open a PR to the SWC repo giving an example.
* test: extract RTL-based test helpers for artwork filters
* refactor: convert SizeFilter spec to use new helpers
* refactor: convert KeywordFilter spec to use new helpers
* test: un-pend KeywordFilter specs
Follow up to #10598
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The type of this PR is: Experiment
Description
Similar to Next.js, this PR updates force to use the Rust-based SWC compiler for compilation performance. Still need to run the numbers a bit more and compare against a few things as the results so far are milder than I'd expect. However, that said, everything is just about working! Force compiles and things run as one would expect.
Given the bleeding-edge nature of this work, the time savings need to be substantial enough en-masse to justify moving away from Babel. That Next.js is using it as its main compiler is promising, though.
Update (8/5/2022):
Turning this flag on by default, which should apply to both tests and local development. To opt-out, set this flag in your
.env
:A handful of tests (~12) were disabled in this commit and flagged with a comment:
Many of these tests were anomalous; we should go through and resolve but not hold up the performance wins in this PR in the meantime.
Also note that SWC compilation is not enabled in prod; this is only a dev-time DX / CI test runner performance improvement.
Changes:
@swc/jest
for compiling Jest tests with SWC@swc/plugin-relay
for compilingrelay
graphql tags@swc/plugin-styled-components
for extracting styled-components style tags for SSR renderingHave also added a new CI job (
test-swc
) so that we can compare the old against the new)Issues:
Some Test Commands:
EXPERIMENTAL_SWC_COMPILER=true yarn start
, then make changes here and there and resaveEXPERIMENTAL_SWC_COMPILER=true yarn build:client:dev
EXPERIMENTAL_SWC_COMPILER=true yarn jest Apps/Auction
EXPERIMENTAL_SWC_COMPILER=false yarn start
EXPERIMENTAL_SWC_COMPILER=false yarn build:client:dev
EXPERIMENTAL_SWC_COMPILER=false yarn jest Apps/Auction
Initial Results:
yarn jest Apps/Auction
: 35s babel, 18s SWC. With cache 13syarn build:client:dev
: 75s babel, 38s SWC. With cache 12s