选择版本
¥Selecting the version
目前,Wasm 插件不向后兼容。因此,你需要为你的插件选择合适的 swc_core 版本。
¥Currently, the Wasm plugins are not backwards compatible.
So you need to select an appropriate version of swc_core for your plugin.
我们提供一个简单的 webapp 来帮助你选择 swc_core 的版本。
¥We provide a simple webapp to help you select the version of swc_core.
¥See: https://plugins.swc.rs
你可以选择框架和你正在使用的框架版本,然后会显示与其兼容的 Wasm 插件。
¥You can select the framework and the version of framework you are using, and the Wasm plugins compatible with it will be shown.
swc_core 版本的旧文档
¥OLD Documentation for the version of swc_core
请改用 webapp。
¥Please use the webapp instead.
该页面记录了你可以在每个运行时使用的 swc_core 版本。
¥The page documents the version of swc_core you can use for each runtime.
next.js 的注意事项
¥Note for next.js
-
由于
next-swc的 bug,接下来v13.2.4~v13.3.1无法执行 SWC Wasm 插件。¥next
v13.2.4~v13.3.1cannot execute SWC Wasm plugins, due to a bug ofnext-swc.
swc_core
如果你使用标题范围内的版本,Wasm 插件将适用于正文中编写的运行时。
¥If you use a version in a range of the title, the Wasm plugin will work for the runtimes written in the body.
v0.98.x~
变更
¥Changes
-
删除
Span.ctxt以减小Span的大小。¥
Span.ctxtis removed to reduce the size ofSpan. -
ctxt: SyntaxContext被添加到各种 AST 节点。¥
ctxt: SyntaxContextis added to various AST nodes. -
在某些地方(如
MemberProp),使用IdentName代替Ident,因为这些字段不需要ctxt或optional。¥
IdentNameis used instead ofIdentin some places likeMemberProp, because those fields does not needctxtoroptional.
升级指南
¥Upgrade guide
-
官方插件的更新 PR:plugins#334
¥The update PR for the official plugins: plugins#334
版本
¥Versions
-
@swc/core@1.7.x -
next@v15.0.0-canary.117(在next@v15.0.0-canary.118中恢复)¥
next@v15.0.0-canary.117(reverted innext@v15.0.0-canary.118) -
next@v15.0.0-canary.122~
v0.95.x ~ v0.96.x
我们优化了一些 AST 类型定义。
¥We optimized some AST type definitions.
-
@swc/core@1.6.x -
next@15.0.0-canary.37~next@v15.0.0-canary.116
v0.94.x
如果你正在为 SWC 构建插件,请不要使用此版本。
¥Do not use this version if you are building a plugin for SWC.
v0.91.x ~ v0.93.x
我们添加了对抽象自动访问器的支持。
¥We added support for abstract auto-accessors.
-
@swc/core@1.5.x -
next@15.0.0-canary.29~v15.0.0-canary.36
v0.90.x
我们重构了 AST,使其不易出错。
¥We refactored AST to make it less error-prone.
-
@swc/core@1.4.x -
next@14.1.1-canary.52~next@15.0.0-canary.28 -
@rspack/core@0.6.0~
v0.88.x ~ v0.89.x
添加了对导入阶段提案(第 3 阶段)的支持。
¥Support for import phase proposal (stage 3) was added.
-
@swc/core@1.3.106~@swc/core@1.3.107 -
@rspack/core@0.5.8~@rspack/core@0.5.9
v0.82.x ~ v0.87.x
由于 with 或 导入属性提案 ,我们修改了 AST 定义。
¥We modified AST definitions because of with of Import Attributes proposal .
-
@swc/core@1.3.81~@swc/core@1.3.105 -
~
next@14.1.0
注意:你可能还需要指定 swc_common 的版本,例如
¥Note: You may need to specify the version of swc_common, too, like
[dependencies]
swc_common = "=0.33.15"v0.79.x ~ v0.81.x
由于 await 或 显式资源管理提案 ,我们修改了 AST 定义。
¥We modified AST definitions because of await of Explicit Resource Management proposal .
-
@swc/core@1.3.68~@swc/core@1.3.80 -
next@13.4.10-canary.1~
v0.78.x
我们修改了 AST 定义,因为之前的一些定义设计错误。
¥We modified AST definitions because some of the previous definitions were misdesigned.
-
@swc/core@1.3.63~@swc/core@1.3.67 -
next@13.4.8~next@13.4.10-canary.0
v0.76.x ~ v0.77.x
由于 显式资源管理提案 (第 3 阶段),我们修改了 AST 定义。
¥We modified AST definitions because of Explicit Resource Management proposal , which is stage 3.
-
@swc/core@1.3.58~@swc/core@1.3.62 -
next@13.4.3-canary.2~next@13.4.7
v0.75.x
我们启用了 rkyv 的严格模式,并将 wasmer 更新为 v3。
¥We enabled strict mode of rkyv and updated wasmer to v3.
-
@swc/core@1.3.49~@swc/core@1.3.57 -
v13.3.1-canary.12~next@13.4.3-canary.1
v0.72.4 ~ v0.74.6
我们将 rkyv 更新为 v0.7.40,该错误现已修复。
¥We updated rkyv to v0.7.40 and the bug is now fixed.
@swc/core@1.3.44~@swc/core@1.3.47
v0.69.x ~ v0.72.3
由于 rkyv@0.7.37 的错误,如果你正在为这些目标构建插件,建议你使用 nightly-2022-09-23 作为编译器。
¥Due to a bug of rkyv@0.7.37, you are recommended to use nightly-2022-09-23 as the compiler if you are building a plugin for these targets.
-
@swc/core@1.3.40~@swc/core@1.3.42 -
next@13.2.5-canary.5
v0.66.x ~ v0.68.x
@swc/core@1.3.39
v0.61.x ~ v0.64.x
@swc/core@1.3.38
v0.54.x ~ v0.59.x
-
@swc/core@1.3.29~@swc/core@1.3.37 -
next@13.2.4-canary.0~