albatrosary's blog

UI/UXとエンタープライズシステム

Angular 4 見てたら .ngsummary.json ってファイルがあった

5日前に 4.0.0-beta.1 がリリースされてましたね。仕事は angular-cli でやっているので、最近はあまりバージョンも気にしなくなり。

f:id:albatrosary:20161226212958p:plain

せっかくなので 4.0.0-beta.1 を動かしてみた。結果は普通に動く、いいね、がしかし細かいことはわからない。

angular-cli でプロジェクトを生成し package.json の Angular バージョンをとりあえず 4.0.0-beta.1 に変えたら次のメッセージでした。ゴメンナサイ。

$ ng serve
This version of CLI is only compatible with angular version 2.3.1 or better. Please
upgrade your angular version, e.g. by running:

npm install @angular/core@latest

$

仕方ないので、自分の angular2-lite-start を利用しました(メンテナンスしてません)。「はろーわーるど」的な何かは普通に動いた。そして aot ビルドすると動かなかったが(動かし方が分かってない) index.ngsummary.json なるファイルが出来てた。ナニコレ案件。

ちょっと issue とか見てたら出てきた。

github.com

feat(compiler): read and write `.ngsummary.json` files
When compiling libraries, this feature extracts the minimal information
from the directives/pipes/modules of the library into `.ngsummary.json` files,
so that applications that use this library only need to be recompiled
if one of the summary files change, but not on every change
of the libraries (e.g. one of the templates).

Only works if individual codegen for libraries is enabled,
see the `generateCodeForLibraries: false` option.

ちょっとときめいたけど CHANGELOG みたら 2.3.0 から入った。で、もうちょい CHANGELOG 見ると 2.x.x は Bug Fixes がほとんどで 4.x.x には 2.x.x の変更をすべて取り入れているのとプラスアルファの機能追加が行なわれているのがわかる。ちなみに MILESTONE見ると4.0.0のところに「Don't panic it's just semver !」って書いてあって和んだ。

あと、このあたり読むといいかも

angularjs.blogspot.jp