latest log

酩酊状態で書いたエンジニアポエムです。酩酊状態で読んでください。

Closure Compiler が ES6 のキャッチアップを開始

自分用のメモ

Closure Compilerが ES6 のキャッチアップを開始しており、以下のコマンドラインオプションが追加されていました。

  • --language_in VAL

    Sets what language spec that input sources conform. Options: ECMASCRIPT3 (default), ECMASCRIPT5, ECMASCRIPT5_STRICT, ECMASCRIPT6 (experimental), ECMASCRIPT6_STRICT (experimental)

  • --language_out VAL

    Sets what language spec the output should conform to. If omitted, defaults to the value of language_in. Options: ECMASCRIPT3, ECMASCRIPT5, ECMASCRIPT5_STRICT

Compile.js, Minify.js の更新内容

Closure Compiler 側の更新に合わせて、 ( Compile.js, Minify.js ) も更新しました。

  • Compile.js が内包している Closure Compiler を最新に ( v20131014 ▶ v20140923 )
  • Minify.js のコマンドラインオプションに --es5in, --es6in, --es5out, -es6out を追加し、ES6 のコードを ES5 にダウンコンパイルできるように準備

実際に ES6 のコンパイルを試してみると、まだお時間が必要なご様子です(内部エラーでコケてる)

$ bin/Minify.js --verbose --strict --es6in --es5out --keep --pretty

その他のコマンドラインオプション

また、以下のコマンドラインオプションが目に止まりました。

  • --accept_const_keyword

    Allows usage of const keyword.

  • --angular_pass

    Generate $inject properties for AngularJS for functions annotated with @ngInject

  • --module VAL

    A JavaScript module specification. The format is <name>:<num-js-files>[:[<dep>,...][:]]]. Module names must be unique. Each dep is the name of a module that this module depends on. Modules must be listed in dependency order, and JS source files must be listed in the corresponding order. Where --module flags occur in relation to --js flags is unimportant. Provide the value 'auto' to trigger module creation from CommonJSmodules.

  • --print_ast

    Prints a dot file describing the internal abstract syntax tree and exits

  • --print_pass_graph

    Prints a dot file describing the passes that will get run and exits

  • --print_tree

    Prints out the parse tree and exits

  • --use_types_for_optimization

    Experimental: perform additional optimizations based on available information. Inaccurate type annotations may result in incorrect results.