Comments (13)
Perhaps it may be worth to look into WebAssembly. Node natively does support it and it seems like a great use case for cross-platform binaries. It would make the CI setup much simpler rather than having to set up pipelines for each OS.
from swc.
@kdy1 I'm a core member of the @neon-bindings team. We're looking to support cross compilation in the upcoming months
from swc.
@marvinhagemeister the CI set up is a one-time cost that could save a lot of time in aggregate if the module becomes popular.
Perhaps another option would be: make the fallback wasm, do a best-effort postinstall
platform / OS specific binary acquisition.
Users could also set up an ENV variable (like puppeteer supports) to skip postinstall if desired (for performance or maybe security reasons)
from swc.
Wasm seems like a good idea.
But to compile into wasm, we need to drop rustc-ap dependencies.
from swc.
Does this worth a look in the future as shipping compiled binary in WASM would make it easier for users to just install the package directly from NPM without installing Rust on their system as well as on CI? I'm saying this because installing Rust on Windows is not as straightforward as on other OS such as macOS.
from swc.
@motss Normally you don't have to install rust to use swc.
Precompiled binary exists for both mac and windows.
We may use wasm in future to support all platforms, but it would require lots of work on error handling logic.
from swc.
@kdy1 Forgive me if I read the docs incorrectly. From the docs, it says that Rust is needed and I haven't tried it because of that.
I'll try it then and see. Thanks for the clarification.
from swc.
I didn't try yet building SWC on WASM, but I think it won't work yet. However I severely wish it would work. @kdy1 those rustc-ap packages are crucial and inevitable, aren't they? They also won't allow SWC to build for WASM?
from swc.
The Neon team is working on adding support for N-API which will allow SWC to distribute a precompiled binary that will work on all platforms.
See:
neon-bindings/neon#440
neon-bindings/neon#458
from swc.
@amilajack And that's truly great! I am still curious about current WASM status though.
from swc.
I didn't try yet building SWC on WASM, but I think it won't work yet. However I severely wish it would work. @kdy1 those rustc-ap packages are crucial and inevitable, aren't they? They also won't allow SWC to build for WASM?
I dropped rustc-ap dependencies, and I think compiling swc to wasm would require just adding a few cfg
s
from swc.
@kdy1 Because wasm is not what this issue is about, I continued here
from swc.
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
from swc.
Related Issues (20)
- docs.rs failed to build swc_common-0.33.22 HOT 1
- useDefineForClassFields: false can set members in wrong constructor HOT 1
- ModuleItem node type imperfect some types are missing HOT 1
- parse & print HOT 1
- duplicated identifier with `mangle.safari10` HOT 4
- SWC has a segfault condition HOT 32
- minifier: self-referential var declaration makes inlining invalid
- minifier: invalid handling of function scope
- minifier: invalid parenthesizing when inlining switch statement with case clause expression contains optional chaining
- `asciiOnly: true` results in invalid escape code inside identifier
- `swc` `explicitResourceManagement` `SuppressedError` implement does not obey spec HOT 8
- Inconsistant Span of Ident inside BindingIdent
- swc does not prioritize jsc.paths by matching prefix length like tsc specifies HOT 1
- Does "Selecting the version" article is up to day for next-swc? HOT 3
- How to keep ascii string output HOT 2
- SWC `compress` removes string literal’s `.toUpperCase()` and produces incorrect code
- `swc.minifySync` panics on some inputs
- swc tries to parse `//# sourceMappingURL` from inside a string variable
- swc removes the backslash "\" when target is "es5" even if "minify" option is not set HOT 4
- Regression in `v1.4.15`: `ReferenceError: resource is not defined` in strict mode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swc.