swc/bindings
David Sherret 981d7b152b
refactor(common): Make ahash optional (#7816)
**Description:**

This adds the ability to not include `ahash` with swc_common, which
caused some issues for me compiling dprint-plugin-typescript to Wasm
because of:

```
   Compiling ahash v0.8.3
   Compiling getrandom v0.2.10
error: the wasm*-unknown-unknown targets are not supported by default, you may need to enable the "js" feature. For more information see: https://docs.rs/getrandom/#webassembly-support
   --> C:\Users\david\.cargo\registry\src\index.crates.io-6f17d22bba15001f\getrandom-0.2.10\src\lib.rs:285:9
    |
285 | /         compile_error!("the wasm*-unknown-unknown targets are not supported by \
286 | |                         default, you may need to enable the \"js\" feature. \
287 | |                         For more information see: \
288 | |                         https://docs.rs/getrandom/#webassembly-support");
    | |________________________________________________________________________^
``` 

(I can't enable the JS feature because it's running the wasm file in
Wasmer and also I don't support Wasi in dprint plugins)

**BREAKING CHANGE:**

This removes swc_common's "perf" feature and makes it the default, then
adds an `ahash` feature instead. An alternative would be to make the
`ahash` dep optional and part of the default features, then do
`default-features = false` in the downstream crates (I think, but I'm
not sure), but I figure most people will be using the perf default
anyway? I'm not sure what's preferable.

**Related issue:**

 - Closes #7729.
2023-08-16 18:02:05 +00:00
..
binding_core_node chore: Publish v1.3.77 with swc_core v0.79.59 (#7817) 2023-08-16 11:23:54 +09:00
binding_core_wasm refactor(common): Make ahash optional (#7816) 2023-08-16 18:02:05 +00:00
node_macro_deps refactor(bindings): Use separate workspace for bindings (#5506) 2022-08-16 15:01:49 +09:00
swc_cli chore: Publish crates 2023-08-16 11:26:52 +09:00
Cargo.lock chore: Publish crates 2023-08-16 11:26:52 +09:00
Cargo.toml chore(ci): Merge CI scripts (#5999) 2022-09-30 16:57:15 +09:00
README.md refactor(bindings): Use separate workspace for bindings (#5506) 2022-08-16 15:01:49 +09:00

SWC bindings

This folder contains actual bindings binary SWC will build for the supported platforms (@swc/core, swc_cli, @swc/wasm).

All the bindings binary uses publicly published swc_core SDK to build deterministic host binary for the specific changes, in result Cargo's workspace gets confused to select dependency versions if it belongs to the workspace contains unpublished packages. To avoid those problems, these bindings are not being built as part of the workspace.