Skip to content

Commit

Permalink
Use opt-level=z for browser wasm (#5494)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Apr 27, 2024
1 parent d98e59d commit db19272
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
19 changes: 19 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -39,7 +39,7 @@
"build": "concurrently -c green,blue \"npm run build:wasm\" \"npm:build:ast-converters\" && concurrently -c green,blue \"npm run build:napi -- --release\" \"npm:build:js\" && npm run build:copy-native",
"build:quick": "concurrently -c green,blue 'npm:build:napi' 'npm:build:cjs' && npm run build:copy-native",
"build:napi": "napi build --platform --dts native.d.ts --js false --cargo-cwd rust -p bindings_napi --cargo-name bindings_napi",
"build:wasm": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm --target web --no-pack && shx rm wasm/.gitignore",
"build:wasm": "cross-env RUSTFLAGS=\"-C opt-level=z\" wasm-pack build rust/bindings_wasm --out-dir ../../wasm --target web --no-pack && shx rm wasm/.gitignore",
"build:wasm:node": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm-node --target nodejs --no-pack && shx rm wasm-node/.gitignore",
"update:napi": "npm run build:napi && npm run build:copy-native",
"build:js": "rollup --config rollup.config.ts --configPlugin typescript --forceExit",
Expand Down Expand Up @@ -149,6 +149,7 @@
"colorette": "^2.0.20",
"concurrently": "^8.2.2",
"core-js": "3.36.0",
"cross-env": "^7.0.3",
"date-time": "^4.0.0",
"es5-shim": "^4.6.7",
"es6-shim": "^0.35.8",
Expand Down
8 changes: 4 additions & 4 deletions wasm/bindings_wasm.d.ts
Expand Up @@ -31,10 +31,10 @@ export interface InitOutput {
readonly xxhashBase36: (a: number, b: number) => void;
readonly xxhashBase16: (a: number, b: number) => void;
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
readonly __wbindgen_malloc: (a: number, b: number) => number;
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
readonly __wbindgen_exn_store: (a: number) => void;
readonly __wbindgen_export_0: (a: number, b: number) => number;
readonly __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
readonly __wbindgen_export_2: (a: number, b: number, c: number) => void;
readonly __wbindgen_export_3: (a: number) => void;
}

export type SyncInitInput = BufferSource | WebAssembly.Module;
Expand Down
8 changes: 4 additions & 4 deletions wasm/bindings_wasm_bg.wasm.d.ts
Expand Up @@ -6,7 +6,7 @@ export function xxhashBase64Url(a: number, b: number): void;
export function xxhashBase36(a: number, b: number): void;
export function xxhashBase16(a: number, b: number): void;
export function __wbindgen_add_to_stack_pointer(a: number): number;
export function __wbindgen_malloc(a: number, b: number): number;
export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
export function __wbindgen_free(a: number, b: number, c: number): void;
export function __wbindgen_exn_store(a: number): void;
export function __wbindgen_export_0(a: number, b: number): number;
export function __wbindgen_export_1(a: number, b: number, c: number, d: number): number;
export function __wbindgen_export_2(a: number, b: number, c: number): void;
export function __wbindgen_export_3(a: number): void;

0 comments on commit db19272

Please sign in to comment.