Skip to content

Commit

Permalink
feat(node-swc): Reduce binary size (#1418)
Browse files Browse the repository at this point in the history
  • Loading branch information
LongYinan authored Feb 20, 2021
1 parent db85d12 commit 9d896c7
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 25 deletions.
46 changes: 23 additions & 23 deletions .github/workflows/publish-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ env:
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

Expand All @@ -25,6 +26,12 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 14

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true

- name: Install node dependencies
run: npm i
Expand Down Expand Up @@ -57,6 +64,7 @@ jobs:
run: |
choco install nodejs-lts --x86 -y --force
refreshenv
- name: Set 32bit NodeJS path
run: |
echo "C:\\Program Files (x86)\\nodejs" >> $GITHUB_PATH
Expand All @@ -65,15 +73,12 @@ jobs:
- name: NodeJS arch
run: node -e "console.log(process.arch)"

- name: Install
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Install i686 toolchain
run: rustup target add i686-pc-windows-msvc
target: i686-pc-windows-msvc

- name: Install node dependencies
run: npm i
Expand Down Expand Up @@ -117,6 +122,7 @@ jobs:
run: |
docker pull docker.pkg.github.com/napi-rs/napi-rs/nodejs-rust:10-alpine
docker tag docker.pkg.github.com/napi-rs/napi-rs/nodejs-rust:10-alpine builder
- name: "Install dependencies"
run: npm i

Expand All @@ -142,15 +148,12 @@ jobs:
with:
node-version: 14

- name: Install
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Install aarch64 toolchain
run: rustup target add aarch64-apple-darwin
target: aarch64-apple-darwin

- name: Cache
uses: actions/cache@v2
Expand Down Expand Up @@ -185,15 +188,12 @@ jobs:
with:
node-version: 14

- name: Install
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Install aarch64 toolchain
run: rustup target add aarch64-unknown-linux-gnu
target: aarch64-unknown-linux-gnu

- name: Cache
uses: actions/cache@v2
Expand All @@ -202,7 +202,6 @@ jobs:
target/
key: aarch64-linux-gnu-publish-integration


- name: Install cross compile toolchain
run: |
sudo apt-get update
Expand Down Expand Up @@ -234,15 +233,12 @@ jobs:
with:
node-version: 14

- name: Install
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Install aarch64 toolchain
run: rustup target add armv7-unknown-linux-gnueabihf
target: armv7-unknown-linux-gnueabihf

- name: Cache
uses: actions/cache@v2
Expand Down Expand Up @@ -279,8 +275,12 @@ jobs:
with:
node-version: 14

- name: Install aarch64 toolchain
run: rustup target add aarch64-linux-android
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
target: aarch64-linux-android

- name: Install node dependencies
run: npm i
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cargo-features = ["strip"]

[workspace]
members = ["ecmascript", "ecmascript/jsdoc", "native", "spack", "wasm"]

Expand Down Expand Up @@ -55,6 +57,7 @@ name = "usage"
[profile.release]
codegen-units = 1
lto = true
strip = 'symbols'
# debug = true
# opt-level = 'z'

Expand Down
2 changes: 1 addition & 1 deletion macros/string_enum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ fn make_as_str(i: &DeriveInput) -> ItemImpl {
})),
_ => Box::new(
Quote::new(def_site::<Span>())
.quote_with(smart_quote!(Vars { qual_name }, { qual_name{..} }))
.quote_with(smart_quote!(Vars { qual_name }, { qual_name { .. } }))
.parse(),
),
};
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2020-11-24
nightly-2021-02-19

0 comments on commit 9d896c7

Please sign in to comment.