Rust-based platform for the Web
Go to file
강동윤 63ee25f0c5
Cleanup (#62)
- do not reexport swc crates

 - Add benchmark for parser

 135ns/op on my macbook pro
 
 - remove unused script
 
 - Update README.md
    - Make features section complete
2018-11-17 10:02:40 +09:00
.cargo chores: cleanup for docs; no email from travis 2018-01-27 15:14:53 +09:00
.vscode Initial release (#45) 2018-11-10 17:44:35 +09:00
atoms Update deps (#59) 2018-11-16 11:56:04 +09:00
common Update deps (#59) 2018-11-16 11:56:04 +09:00
ecmascript Cleanup (#62) 2018-11-17 10:02:40 +09:00
libswc Fix tests & upgrade deps (#60) 2018-11-16 20:09:17 +09:00
macros Cleanup (#62) 2018-11-17 10:02:40 +09:00
scripts ECMAScript parser (#1) 2018-01-12 16:53:06 +09:00
src/bin Improve codegen (#57) 2018-11-15 21:43:04 +09:00
testing Fix tests & upgrade deps (#60) 2018-11-16 20:09:17 +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 Cleanup (#62) 2018-11-17 10:02:40 +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' 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));