ac5ab607c9
**Description:** One of the oversight around design of `TransformExecutor` is encapsulating plugin module logic. It has access to the cache and do its own loading & storing. This means consumer of plugin runner have tricky challenge to control its caching system. First, there is no way to escape how swc_plugin_runner controls cache and cannot synchronize into their own, also depends on the usecases cannot control the features they want to opt in: for example, there's no way one interface uses in-memory cache, and another uses filesystem since it is compile time configured singleton. PR revisits overall design of TransformExecutor: now it accepts a tratir `PluginModuleBytes`, which abstracts any kind of bytes we are dealing with, such as raw file slice or serialized `wasmer::Module`. Cache instantiation and managing is now bubbled up to the application level (`swc` in here), so if someone wants non-singleton caching or integrate into their own caching system it can be customized. Lastly, deprecated `memory_cache` feature and only exposes `filesystem_cache`. Cache implementation uses in-memory is always available, and can opt in filesystem cache where it's supported. **BREAKING CHANGE:** This is clearly breaking changes for the consumers of swc_core. for the @swc/core, this PR takes care of necessary changes. I'll work on next-swc changes later once we have new @swc/core version with this changes. |
||
---|---|---|
.cargo | ||
.github | ||
.husky | ||
.vscode | ||
bindings | ||
crates | ||
docs/adr | ||
node-swc | ||
packages/swc-helpers | ||
scripts | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.kodiak.toml | ||
.mocha.setup.js | ||
.mocharc.js | ||
.prettierignore | ||
.prettierrc | ||
.rustfmt.toml | ||
.taplo.toml | ||
.yarnrc.yml | ||
ARCHITECTURE.md | ||
Cargo.lock | ||
Cargo.toml | ||
CHANGELOG.md | ||
cliff.toml | ||
clippy.toml | ||
CONTRIBUTING.md | ||
cspell.json | ||
deny.toml | ||
LICENSE | ||
MAINTENANCE.md | ||
package.json | ||
postinstall.js | ||
README.md | ||
rust-toolchain | ||
tsconfig.json | ||
yarn.lock |
Make the web (development) faster.
SWC (stands for Speedy Web Compiler
) is a super-fast TypeScript / JavaScript compiler written in Rust. It's a library for Rust and JavaScript at the same time. If you are using SWC from Rust, see rustdoc and for most users, your entry point for using the library will be parser.
Also, SWC tries to ensure that
If you select the latest version of each crates, it will work
for rust users.
MSRV of crates is currently nightly, but we will support stable rustc again in the future.
If you are using SWC from JavaScript, please refer to docs on the website.
Documentation
Check out the documentation in the website.
Features
Please see comparison with babel.
Performance
Please see benchmark results on the website.
Supporting swc
SWC is a community-driven project, and is maintained by a group of volunteers. If you'd like to help support the future of the project, please consider:
- Giving developer time on the project. (Message us on Discord (preferred) or Github discussions for guidance!)
- Giving funds by becoming a sponsor (see https://opencollective.com/swc)!
Contributing
See CONTRIBUTING.md. You may also find the architecture documentation useful (ARCHITECTURE.md).
License
SWC is primarily distributed under the terms of the Apache License (Version 2.0).
See LICENSE for details.