Skip to content

Commit

Permalink
Migrate to swc_core (#9131)
Browse files Browse the repository at this point in the history
* Migrate to swc_core

Using `swc_ecmascript` etc directly is deprecated and the recommendation
is to migrate to swc_core instead as a meta-pacakge.

This change makes that migration - it's mostly a case of updating a lot
of imports, but also as a side-effect of bumping a few versions of SWC
to pick up bugfixes there were some deprecated fields where code changes
were needed.

One major change with the latest SWC is that it currently requires Rust
nightly to build. I've updated the `rust-toolchain` to reflect this, but
I'm not sure if there are any broader implications.

* Update Rust toolchain file

This ensures correct tools are available in GH actions.

---------

Co-authored-by: David Alsh <12656294+alshdavid@users.noreply.github.com>
  • Loading branch information
marcins and alshdavid committed Jul 16, 2023
1 parent d84385d commit 631d280
Show file tree
Hide file tree
Showing 19 changed files with 514 additions and 407 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ jobs:
with:
cache: yarn
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rustfmt
- uses: Swatinem/rust-cache@v1
# use `--frozen-lockfile` to fail immediately if the committed yarn.lock needs updates
# https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-frozen-lockfile
Expand Down Expand Up @@ -55,6 +59,10 @@ jobs:
cache: yarn
node-version: ${{matrix.node}}
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rustfmt
- uses: Swatinem/rust-cache@v1
- name: Bump max inotify watches (Linux only)
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p;
Expand All @@ -80,6 +88,10 @@ jobs:
cache: yarn
node-version: ${{matrix.node}}
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rustfmt
- uses: Swatinem/rust-cache@v1
- name: Bump max inotify watches (Linux only)
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p;
Expand All @@ -95,13 +107,12 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: Integration tests (${{matrix.os}}, node ${{matrix.node}})
path: "**/junit-*.xml"
path: '**/junit-*.xml'

test_report:
name: Test report
runs-on: ubuntu-latest
needs:
[unit_tests, integration_tests]
needs: [unit_tests, integration_tests]
if: always()
steps:
- name: Create test report
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: nightly
profile: minimal
override: true
- uses: bahmutov/npm-install@v1.1.0
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: nightly
profile: minimal
override: true
- uses: bahmutov/npm-install@v1.1.0
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: nightly
profile: minimal
override: true
target: ${{ matrix.target }}
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: nightly
profile: minimal
override: true
target: ${{ matrix.target }}
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: nightly
profile: minimal
override: true
target: aarch64-apple-darwin
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: nightly
profile: minimal
override: true
- uses: bahmutov/npm-install@v1.1.0
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: nightly
profile: minimal
override: true
- uses: bahmutov/npm-install@v1.1.0
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: nightly
profile: minimal
override: true
target: ${{ matrix.target }}
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: nightly
profile: minimal
override: true
target: ${{ matrix.target }}
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: nightly
profile: minimal
override: true
target: aarch64-apple-darwin
Expand Down

0 comments on commit 631d280

Please sign in to comment.