Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debugフィーチャを指定した時のみconsole_error_panic_hookを有効化するをrelease/v0.1.0-beta.1にマージ #106

Conversation

YuukiToriyama
Copy link
Owner

@YuukiToriyama YuukiToriyama commented Jan 5, 2024

変更点

  • debugフィーチャを追加
  • debugフィーチャを指定した時のみconsole_error_panic_hookを有効化する

ファイルサイズの比較

debugフィーチャを指定した時

❯ ls -l pkg
total 3400
-rw-r--r--@ 1 ytoriyama  staff     1065 Nov 23 17:41 LICENSE
-rw-r--r--  1 ytoriyama  staff      256 Jan  6 00:14 README.md
-rw-r--r--@ 1 ytoriyama  staff     2096 Jan  6 01:36 japanese_address_parser.d.ts
-rw-r--r--@ 1 ytoriyama  staff    20587 Jan  6 01:36 japanese_address_parser.js
-rw-r--r--@ 1 ytoriyama  staff    16740 Dec  9 22:10 japanese_address_parser_bg.js
-rw-r--r--  1 ytoriyama  staff  1674997 Jan  6 01:37 japanese_address_parser_bg.wasm
-rw-r--r--@ 1 ytoriyama  staff      889 Jan  6 01:36 japanese_address_parser_bg.wasm.d.ts
-rw-r--r--  1 ytoriyama  staff      640 Jan  6 01:37 package.json

debugフィーチャを指定しない時

❯ ls -l pkg
total 3392
-rw-r--r--@ 1 ytoriyama  staff     1065 Nov 23 17:41 LICENSE
-rw-r--r--  1 ytoriyama  staff      256 Jan  6 00:14 README.md
-rw-r--r--@ 1 ytoriyama  staff     2025 Jan  6 01:38 japanese_address_parser.d.ts
-rw-r--r--@ 1 ytoriyama  staff    19749 Jan  6 01:38 japanese_address_parser.js
-rw-r--r--@ 1 ytoriyama  staff    16740 Dec  9 22:10 japanese_address_parser_bg.js
-rw-r--r--  1 ytoriyama  staff  1671820 Jan  6 01:39 japanese_address_parser_bg.wasm
-rw-r--r--@ 1 ytoriyama  staff      817 Jan  6 01:38 japanese_address_parser_bg.wasm.d.ts
-rw-r--r--  1 ytoriyama  staff      641 Jan  6 01:39 package.json

備考

`wasm-pack build --features debug`とすると有効化されるが、何も指定しない場合は無効化される
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [clippy] reported by reviewdog 🐶

warning: you should consider adding a `Default` implementation for `Parser`
  --> src/lib.rs:18:5
   |
18 | /     pub fn new() -> Self {
19 | |         Parser {}
20 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
   = note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
   |
16 + impl Default for Parser {
17 +     fn default() -> Self {
18 +         Self::new()
19 +     }
20 + }
   |

@YuukiToriyama YuukiToriyama merged commit 4d1bcf9 into release/v0.1.0-beta.1 Jan 5, 2024
1 check passed
@YuukiToriyama YuukiToriyama deleted the feature/disable-panic-hook-on-release-build branch May 16, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant