Skip to content

Commit

Permalink
perf: rewrite react demo swc plugin in rust (umijs#1579)
Browse files Browse the repository at this point in the history
* chore: init rust swc plugin and cargo workspace

* feat: rewrite rect demo swc plugin in rust

* refactor: replace ts react plugin with swc react plugin

* ci: add rust toolchain for build crates

* ci: custom rust install for vercel deploy

* build: correct cargo release config

* ci: update custom-install for vercel deploy

* ci: update scripts for vercel deploy

* ci: update build script for vercel

* refactor: correct swc plugin path

* refactor: improve implementation for swc plugin

Co-authored-by: Xiadong Zhu <[email protected]>

* ci: enable cache for cargo

---------

Co-authored-by: Xiadong Zhu <[email protected]>
  • Loading branch information
PeachScript and xdatcloud authored Mar 27, 2023
1 parent 589a55f commit dfc01d0
Show file tree
Hide file tree
Showing 14 changed files with 2,471 additions and 261 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org/'
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
# specific manually because action not support rust-toolchain.toml
toolchain: nightly-2022-09-23
target: wasm32-wasi

- name: Install pnpm
uses: pnpm/[email protected]
Expand All @@ -56,15 +62,26 @@ jobs:
restore-keys: |
${{ runner.os }}-pnpm-store-node${{ matrix.node-version }}-
- name: Setup cargo cache
uses: actions/cache@v3
with:
# ref: https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
path: |
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-store-node${{ matrix.node-version }}-${{ hashFiles('**/Cargo.lock') }}

- name: Install dependencies
run: pnpm i

- name: Lint code
run: pnpm lint:es

- name: Run build
run: pnpm build

- name: Run tests
run: pnpm test
env:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
/examples/*/.dumi/tmp-production
/docs/.upstream
.idea
/target
/compiled/crates
.swc
Loading

0 comments on commit dfc01d0

Please sign in to comment.