Skip to content

Commit dfc01d0

Browse files
perf: rewrite react demo swc plugin in rust (#1579)
* 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]>
1 parent 589a55f commit dfc01d0

File tree

14 files changed

+2471
-261
lines changed

14 files changed

+2471
-261
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ jobs:
3737
with:
3838
node-version: ${{ matrix.node-version }}
3939
registry-url: 'https://registry.npmjs.org/'
40+
- name: Install rust toolchain
41+
uses: actions-rs/toolchain@v1
42+
with:
43+
# specific manually because action not support rust-toolchain.toml
44+
toolchain: nightly-2022-09-23
45+
target: wasm32-wasi
4046

4147
- name: Install pnpm
4248
uses: pnpm/[email protected]
@@ -56,15 +62,26 @@ jobs:
5662
restore-keys: |
5763
${{ runner.os }}-pnpm-store-node${{ matrix.node-version }}-
5864
65+
- name: Setup cargo cache
66+
uses: actions/cache@v3
67+
with:
68+
# ref: https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
69+
path: |
70+
~/.cargo/.crates.toml
71+
~/.cargo/.crates2.json
72+
~/.cargo/bin/
73+
~/.cargo/registry/index/
74+
~/.cargo/registry/cache/
75+
~/.cargo/git/db/
76+
target/
77+
key: ${{ runner.os }}-cargo-store-node${{ matrix.node-version }}-${{ hashFiles('**/Cargo.lock') }}
78+
5979
- name: Install dependencies
6080
run: pnpm i
6181

6282
- name: Lint code
6383
run: pnpm lint:es
6484

65-
- name: Run build
66-
run: pnpm build
67-
6885
- name: Run tests
6986
run: pnpm test
7087
env:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@
1414
/examples/*/.dumi/tmp-production
1515
/docs/.upstream
1616
.idea
17+
/target
18+
/compiled/crates
19+
.swc

0 commit comments

Comments
 (0)