Giter Site home page Giter Site logo

Comments (13)

marvinhagemeister avatar marvinhagemeister commented on May 8, 2024 7

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.

amilajack avatar amilajack commented on May 8, 2024 1

@kdy1 I'm a core member of the @neon-bindings team. We're looking to support cross compilation in the upcoming months

from swc.

rauchg avatar rauchg commented on May 8, 2024

@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.

kdy1 avatar kdy1 commented on May 8, 2024

Wasm seems like a good idea.

But to compile into wasm, we need to drop rustc-ap dependencies.

from swc.

motss avatar motss commented on May 8, 2024

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.

kdy1 avatar kdy1 commented on May 8, 2024

@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.

motss avatar motss commented on May 8, 2024

@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.

anurbol avatar anurbol commented on May 8, 2024

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.

amilajack avatar amilajack commented on May 8, 2024

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.

anurbol avatar anurbol commented on May 8, 2024

@amilajack And that's truly great! I am still curious about current WASM status though.

from swc.

kdy1 avatar kdy1 commented on May 8, 2024

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 cfgs

from swc.

anurbol avatar anurbol commented on May 8, 2024

@kdy1 Because wasm is not what this issue is about, I continued here

from swc.

swc-bot avatar swc-bot commented on May 8, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.