Rust-based platform for the Web
Go to file
2018-11-20 18:32:53 +09:00
.cargo Make it thread safe 2018-11-17 17:02:34 +09:00
.vscode Initial release (#45) 2018-11-10 17:44:35 +09:00
atoms More works (#66) 2018-11-18 14:00:07 +09:00
common Visitor (#69) 2018-11-19 13:02:55 +09:00
ecmascript Groundwork for linter (#73) 2018-11-20 18:32:53 +09:00
libswc More works (#66) 2018-11-18 14:00:07 +09:00
macros Visitor (#69) 2018-11-19 13:02:55 +09:00
scripts ECMAScript parser (#1) 2018-01-12 16:53:06 +09:00
src/bin More works (#66) 2018-11-18 14:00:07 +09:00
testing More works (#66) 2018-11-18 14:00:07 +09:00
.gitignore More transcompilers (#49) 2018-11-14 19:40:46 +09:00
.gitmodules Update .gitmodules 2018-11-16 20:51:56 +09:00
.rustfmt.toml Fix tests & upgrade deps (#60) 2018-11-16 20:09:17 +09:00
.travis.yml travis: don't cache docs 2018-11-17 18:01:29 +09:00
bors.toml Add bors to prevent misktake. 2018-01-14 14:44:32 +09:00
Cargo.toml More works (#66) 2018-11-18 14:00:07 +09:00
LICENSE-APACHE initial commit 2017-12-22 22:07:03 +09:00
LICENSE-MIT initial commit 2017-12-22 22:07:03 +09:00
README.md More works (#66) 2018-11-18 14:00:07 +09:00
rust-toolchain Ecmascript codegen (#40) 2018-10-25 13:17:05 +09:00

spdy web compiler

Build Status codecov


Make the web (development) faster.

swc is rust port of babel and closure compiler.

Installation

Requires nightly version of rust.

RUSTFLAGS='--cfg procmacro2_semver_exempt --cfg parallel_queries' cargo install --git https://github.com/swc-project/swc.git

Features

Transforms

New generation javascript to old-days javascript.

  • es3

    • member-expression-literals
    • property-literals
    • reserved-words
  • es5

    • property-mutators
  • es2015

    • arrow-functions
    • block-scoped-functions
    • block-scoping
    • classes
    • computed-properties
    • destructuring
    • duplicate-keys
    • for-of
    • function-name
    • instanceof
    • literals
    • new-target
    • object-super
    • parameters
    • shorthand-properties
    • spread
    • sticky regex (y flag)
    • template-literals
    • typeof-symbol
    • unicode-regex
  • es2016

    • exponentiation-operator
  • es2017

    • async-to-generator
  • es2018

    • async-generator-functions
    • dotall-regex
    • object-rest-spread
    • optional-catch-binding
    • unicode-property-regex

Usage

test.js:

8 + 8;
use(8 + 8, 8 ** 8);

Example

swc jsc test.js

Output

8 + 8;
use(8 + 8, Math.pow(8, 8));

Example

swc jsc --optimize test.js

Output

use(8 + 8, Math.pow(8, 8));

Contributing

See CONTRIBUTING.md. You may also find the architecture documentation useful (ARCHITECTURE.md).

License

swc is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.