Replies: 2 comments 2 replies
-
|
This is a topic core team members (of course including @kdy1 ) and few other interested parties have been discussed for some months & trying to collect some data to confirm the least used targets and I believe we are mostly agreed on the list of targets we'd like to keep support. |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
The core team decided to go with this direction. We will remove the native binaries for
for the first step |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
TBDSummary
This proposal describes a plan to reduce the number of native binary target
@swc/coresupports, falling back to@swc/wasmfor those environments.Motivation
SWC currently provides 2 different bindings to support various platforms / targets.
@swc/coreprovidesnativebindings supported via node.js's napi, which have corresponding native binaries per each platform. Remaining unsupported platforms are required to use@swc/wasminstead, including non-native (Browser) environments.Native platform expansion for
@swc/corehas been increased ad-hoc bases. In result, currently we have these 13 native bindings to be built per each release:core-win32-x64-msvccore-darwin-x64core-linux-x64-gnucore-linux-x64-muslcore-freebsd-x64core-win32-ia32-msvccore-linux-arm64-gnucore-linux-arm-gnueabihfcore-darwin-arm64core-android-arm64core-linux-arm64-muslcore-win32-arm64-msvccore-android-arm-eabiWhich has become a notable bottleneck for daily dev workflow.
First, there are targets that require specific setups for its pipeline, mostly if the target is not commonly used, or it requires cross compiling. This cannot be easily reproducible & debuggable locally, and requires a certain amount of time to run CI for troubleshooting. Not only for general troubleshooting, this becomes a bottleneck for daily work since we need to spend a lot of time & resources for the CI jobs.
Secondly, those targets are commonly not supported by some core upstream features which we can't provide feature parity. For example, we are not able to provide wasm-based plugin features for some targets like android, i686, armv7.
Even with those caveats, actual gains are not huge. There are nearly no users are on certain platforms. (I hope if we could have telemetry in
@swc/coreitself and can share specific data, but that's entirely another story may involve lot more discussions probably)For those reasons, this proposal suggests to
@swc/coreprovides native bindings for these targets:core-win32-x64-msvccore-linux-x64-gnucore-linux-x64-muslcore-linux-arm64-gnucore-linux-arm64-muslcore-darwin-arm64core-darwin-x64Note this is not a permanent decision. We'll occasionally evaluate surroundings, either add / remove necessary platform support if there are sufficient needs.
Detailed design
This is mostly about discontinuations and possible road forward is already prepared.
@swc/coreattempts to@swc/wasmif native bindings are not able to be loaded@swc/coreinternally not able to install@swc/wasm, upstream will try to fix - but also as a workaround user's package.json can install@swc/wasmside by side to@swc/core. Importing@swc/corewill try to look for@swc/wasm.Drawbacks
This can cause potential regressions for some users if fallback doesn't work as expected. We'll try to address those failures as quickly as we can.
Alternatives
The only possible alternative is to keep the current target as-is. But to do those, there should be some answers to the problems currently we're dealing with.
References (if exists)
next/swchave aligned changes vercel/next.js#38883Beta Was this translation helpful? Give feedback.
All reactions