Rust-based platform for the Web
Go to file
2018-11-17 17:02:34 +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 Cleanup (#64) 2018-11-17 16:38:23 +09:00
common Make it thread safe 2018-11-17 17:02:34 +09:00
ecmascript Make it thread safe 2018-11-17 17:02:34 +09:00
libswc Make it thread safe 2018-11-17 17:02:34 +09:00
macros Cleanup (#64) 2018-11-17 16:38:23 +09:00
scripts ECMAScript parser (#1) 2018-01-12 16:53:06 +09:00
src/bin Make it thread safe 2018-11-17 17:02:34 +09:00
testing Make it thread safe 2018-11-17 17:02:34 +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 Use rustdoc repository for rustdoc 2018-11-16 21:17:36 +09:00
bors.toml Add bors to prevent misktake. 2018-01-14 14:44:32 +09:00
Cargo.toml Chores (#54) 2018-11-15 13:29:44 +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 Make it thread safe 2018-11-17 17:02:34 +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
    • peroperty literals
    • reserved words
  • 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

    • operator **
  • es2017

    • async-to-generator
  • es2018

    • parser
    • 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.