432 Commits

Author SHA1 Message Date
Charles Lyding
2f68d53cc7 refactor: general dependency update 2017-07-22 12:53:03 +01:00
Hans Larsen
c4430bc894 release: v1.3.0-rc.0 2017-07-21 15:26:46 -07:00
Filipe Silva
7b9fc285e3 feat(@angular/cli): support TypeScript 2.4
This PR doesn't change new projects to use 2.4 since I have seen some reports of possible problems in `@angular/*`.

Instead, it:
- removes the dependency restrictions on <2.3
- bumps related dependencies to the minimum that supports 2.4 (`rxjs@^5.4.2`, `ts-node@~3.2.0`)
- builds the CLI itself using 2.4

So if you want to install ts 2.4 in your new project, the CLI itself won't stop you.

Fix #6827
2017-07-21 15:55:43 -04:00
Hans Larsen
61b4e2202f feat(@angular/cli): rewrite stats output to properly show the asset size
This is a feature in principle; the output is changed. The stats themselves dont though.
2017-07-21 14:42:55 -04:00
FrozenPandaz
6f23636323 feat(@angular/cli): add ability to build bundle for node and export lazy route map 2017-07-20 15:01:25 -07:00
Christian Liebel
d5d0b07812 feat(@angular/cli): update standard library to es2017
ECMAScript 2017 was released at the end of June. Standard library support for ES 2017 is around in TypeScript for quite a while now. Even `typescript@~2.0.0` which is used by the Angular 2 template supports a subset of ES 2017. Hence, it seems reasonable to update to the latest standard library version.
2017-07-19 16:04:16 -04:00
Michael Kühnel
35c89a5647 refactor: Change ejection message 2017-07-19 16:02:30 -04:00
Lukas Elmer
e970cb1c71 docs(@angular/cli): link to latest karma doc 2017-07-19 15:58:49 -04:00
jnizet
6ca6a5e92b fix(@angular/cli): fix doc command to work with new angular.io
- change the URL for the API search
- use google search when --search option is true, since angular.io doesn't have a search page anymore
- improve the help and doc of the doc command
2017-07-19 15:57:15 -04:00
Filipe Silva
826c634090 feat(@angular/cli): add flag to control chunk naming
Followup to #6881

Allow controlling chunk naming via the `--named-chunks` flag, which can be set on `.angular-cli.json` as well.

Defaults to true in development, false in production.
2017-07-19 13:53:07 -04:00
Filipe Silva
9ec5b4ed66 feat(@angular/cli): add build-optimizer support
Adds the new flag `--build-optimizer` (`--bo`), usable only with `--aot` (or `--prod` since it auto enables `--aot`).

This feature is experimental, and may not work correctly on your project. Should it work, total bundle size should go down. Savings are heavily dependent on the project.

See https://github.com/angular/devkit/tree/master/packages/angular_devkit/build_optimizer for details about all the optimizations applied.

Usage: `ng build --prod --build-optimizer`. Disabling the vendor chunk has been shown to improve total savings, and is done automatically when `--bo` is specified unless `--vendor-chunk` has a value.

Please let us know if using `--build-optimizer` breaks your project so we can improve it further. Repos are very welcome.
2017-07-19 12:27:23 -04:00
Yaroslav Admin
5c3146c49e build(@angular/cli): update webpack-dev-server to satisfy peer dependency 2017-07-19 11:14:01 -04:00
Filipe Silva
c027cc6aa2 build: unpin zone.js
Followup to #6971. `zone.js@0.8.14` has been released and we should unpin it.
2017-07-19 11:12:41 -04:00
Filipe Silva
ace2fe4e2f build: use webpack 3.3 2017-07-19 11:12:06 -04:00
Filipe Silva
5e8aadcb51 fix(@angular/cli): use build defaults in test
These defaults were added to build/serve/e2e but not to test.
2017-07-19 11:03:55 -04:00
Filipe Silva
455d56ed34 fix(@angular/cli): fix ng test report sourcemaps
#6160 broke `ng test` sourcemaps in Chrome, this PR fixes it.

Before:
```
kamik@T460p MINGW64 D:/sandbox/master-project (master)
$ ng test --sr
 10% building modules 1/1 modules 0 active13 07 2017 16:38:43.942:INFO [karma]: Karma v1.7.0 server started at http://0.0.0.0:9876/
13 07 2017 16:38:43.945:INFO [launcher]: Launching browser Chrome with unlimited concurrency
13 07 2017 16:38:43.953:INFO [launcher]: Starting browser Chrome                                                    13 07 2017 16:38:54.099:INFO [Chrome 59.0.
3071 (Windows 10 0.0.0)]: Connected on socket Xdep72ofT_Q7MWBHAAAA with id 76010950
Chrome 59.0.3071 (Windows 10 0.0.0) AppComponent should have as title 'app' FAILED
        Expected 'app' to equal 'forced bug'.
            at Object.<anonymous> (http://localhost:9876/_karma_webpack_/main.bundle.js:89:27)
            at ZoneDelegate.webpackJsonp.../../../../../../../sandbox/master-project/node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:9
876/_karma_webpack_/polyfills.bundle.js:2704:26)
            at AsyncTestZoneSpec.webpackJsonp.../../../../../../../sandbox/master-project/node_modules/zone.js/dist/async-test.js.AsyncTestZoneSpec.onInvoke (
http://localhost:9876/_karma_webpack_/vendor.bundle.js:55972:39)
            at ProxyZoneSpec.webpackJsonp.../../../../../../../sandbox/master-project/node_modules/zone.js/dist/proxy.js.ProxyZoneSpec.onInvoke (http://localh
ost:9876/_karma_webpack_/vendor.bundle.js:56735:39)
Chrome 59.0.3071 (Windows 10 0.0.0): Executed 2 of 3 (1 FAILED) (0 secs / 0.162 secs)
Chrome 59.0.3071 (Windows 10 0.0.0) AppComponent should have as title 'app' FAILED
        Expected 'app' to equal 'forced bug'.
            at Object.<anonymous> (http://localhost:9876/_karma_webpack_/main.bundle.js:89:27)
            at ZoneDelegate.webpackJsonp.../../../../../../../sandbox/master-project/node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:9
876/_karma_webpack_/polyfills.bundle.js:2704:26)
            at AsyncTestZoneSpec.webpackJsonp.../../../../../../../sandbox/master-project/node_modules/zone.js/dist/async-test.js.AsyncTestZoneSpec.onInvoke (
http://localhost:9876/_karma_webpack_/vendor.bundle.js:55972:39)
            at ProxyZoneSpec.webpackJsonp.../../../../../../../sandbox/master-project/node_modules/zone.js/dist/proxy.js.ProxyZoneSpec.onInvoke (http://localh
Chrome 59.0.3071 (Windows 10 0.0.0): Executed 3 of 3 (1 FAILED) (0.225 secs / 0.204 secs)
```

After:
```
kamik@T460p MINGW64 D:/sandbox/master-project (master)
$ ng test --sr
 10% building modules 1/1 modules 0 active13 07 2017 16:37:59.478:INFO [karma]: Karma v1.7.0 server started at http://0.0.0.0:9876/
13 07 2017 16:37:59.481:INFO [launcher]: Launching browser Chrome with unlimited concurrency
13 07 2017 16:37:59.487:INFO [launcher]: Starting browser Chrome                                                    13 07 2017 16:38:08.559:INFO [Chrome 59.0.
3071 (Windows 10 0.0.0)]: Connected on socket ixHN4NzVFTEW1iYiAAAA with id 92819713
Chrome 59.0.3071 (Windows 10 0.0.0) AppComponent should have as title 'app' FAILED
        Expected 'app' to equal 'forced bug'.
            at Object.<anonymous> D:/sandbox/master-project/src/app/app.component.spec.ts:23:23)
            at ZoneDelegate.webpackJsonp.../../../../../../../sandbox/master-project/node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke D:/sandbox/master-p
roject/node_modules/zone.js/dist/zone.js:391:1)
            at AsyncTestZoneSpec.webpackJsonp.../../../../../../../sandbox/master-project/node_modules/zone.js/dist/async-test.js.AsyncTestZoneSpec.onInvoke D
:/sandbox/master-project/node_modules/zone.js/dist/async-test.js:49:1)
            at ProxyZoneSpec.webpackJsonp.../../../../../../../sandbox/master-project/node_modules/zone.js/dist/proxy.js.ProxyZoneSpec.onInvoke D:/sandbox/mas
ter-project/node_modules/zone.js/dist/proxy.js:76:1)
Chrome 59.0.3071 (Windows 10 0.0.0): Executed 2 of 3 (1 FAILED) (0 secs / 0.367 secs)
Chrome 59.0.3071 (Windows 10 0.0.0) AppComponent should have as title 'app' FAILED
        Expected 'app' to equal 'forced bug'.
            at Object.<anonymous> D:/sandbox/master-project/src/app/app.component.spec.ts:23:23)
            at ZoneDelegate.webpackJsonp.../../../../../../../sandbox/master-project/node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke D:/sandbox/master-p
roject/node_modules/zone.js/dist/zone.js:391:1)
            at AsyncTestZoneSpec.webpackJsonp.../../../../../../../sandbox/master-project/node_modules/zone.js/dist/async-test.js.AsyncTestZoneSpec.onInvoke D
:/sandbox/master-project/node_modules/zone.js/dist/async-test.js:49:1)
            at ProxyZoneSpec.webpackJsonp.../../../../../../../sandbox/master-project/node_modules/zone.js/dist/proxy.js.ProxyZoneSpec.onInvoke D:/sandbox/mas
Chrome 59.0.3071 (Windows 10 0.0.0): Executed 3 of 3 (1 FAILED) (0.421 secs / 0.4 secs)
```

Fix #6583
2017-07-19 11:02:57 -04:00
Kevin Phelps
26e94339ba feat(@angular/cli): make the common chunk optional
- Add a "--no-common-chunk" build option for disabling the common async chunk.
- The existing behavior is maintained by default.

closes #7021
2017-07-19 10:13:24 -04:00
Filipe Silva
aebf4c89b1 fix(@angular/cli): wait for install to finish before exiting 2017-07-18 10:21:41 -04:00
Filipe Silva
19bbc7fb9d build(@angular/cli): use webpack@3.2 (#6949) 2017-07-14 15:36:25 -07:00
Mike Brocchi
f735760a34 fix(@angular/cli): Prevent re-reading config file if project & global are the same
Addresses #4207
2017-07-14 14:03:40 -07:00
Filipe Silva
6ad27c5174 fix(@angular/cli): always ignore node_modules for lint
Fix #6626
2017-07-14 14:02:45 -07:00
Filipe Silva
d4b64de427 build: pin zone.js
`zone.js@0.8.13` has some bugs that break our CI runs. These are being tracked in https://github.com/angular/zone.js/issues/832.

Until a these are fixed and a new versions is released, we should pin to `zone.js@0.8.12`. Another PR should go up then and unpin to `zone.js@^0.8.14`.
2017-07-13 16:25:52 -07:00
Hans Larsen
634a04190d
release: 1.3.0-beta.1 2017-07-12 11:44:46 -07:00
Filipe Silva
fe85750cb7 feat(@angular/cli): add scope hoisting via webpack 3
This should result in significant bundle size reduction. For best results, build for production with `--vendor-chunk=false`.

See https://medium.com/webpack/webpack-3-official-release-15fd2dd8f07b for details.
2017-07-10 16:59:08 -07:00
Filipe Silva
fd52246dfc feat(@angular/cli): allow chunk names for imports
Followup to #6881

Also name chunks created via `import()` or `System.import()`, and strip `.ngfactory` from the chunk name.
2017-07-10 10:33:57 -07:00
Filipe Silva
7f280499cd feat(@angular/cli): add build defaults to config
Adds following defaults to `.angular-cli.json` under `defaults`: `sourcemaps`, `baseHref`, `progress`, `poll`, `deleteOutputPath`, `preserveSymlinks`, `showCircularDependencies`.

They can be set via `ng set defaults.build.KEY = VALUE`.

Also removes `apps.0.showCircularDependencies`. This is not a breaking chance since it was only added in 1.3.0-beta.0.

Followup to https://github.com/angular/angular-cli/pull/6884#discussion_r125533830.
2017-07-06 15:03:19 -07:00
Filipe Silva
2780c3d7ab fix(@angular/cli): use inline sourcemaps in test
Fix #6737
2017-07-05 18:47:51 -07:00
Alexandr Marchenko
b0576d6d05 fix(@angular/cli): check package manager existance before installing packages 2017-07-05 16:47:47 -07:00
Filipe Silva
ac2fec47eb fix(@angular/cli): don't set baseUrl in editor tsconfig
Fix https://github.com/angular/angular-cli/issues/5875
2017-07-05 16:11:18 -07:00
Filipe Silva
5a0e80ffd3 feat(@angular/cli): name lazy chunks
Before:
```
$ ng build --no-progress
Hash: ff03df269349b817eef4
Time: 11202ms
chunk    {0} 0.chunk.js, 0.chunk.js.map 1.61 kB {1} {3} [rendered]
chunk    {1} 1.chunk.js, 1.chunk.js.map 1.46 kB {0} {3} [rendered]
chunk    {2} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 160 kB {6} [initial] [rendered]
chunk    {3} main.bundle.js, main.bundle.js.map (main) 6.38 kB {5} [initial] [rendered]
chunk    {4} styles.bundle.js, styles.bundle.js.map (styles) 10.5 kB {6} [initial] [rendered]
chunk    {5} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.16 MB [initial] [rendered]
chunk    {6} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
```

After:
```
$ ng build --no-progress
Hash: 2bc12a89f40f3b4818b5
Time: 9613ms
chunk {feature.module} feature.module.chunk.js, feature.module.chunk.js.map 1.46 kB {lazy.module} {main} [rendered]
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
chunk {lazy.module} lazy.module.chunk.js, lazy.module.chunk.js.map 1.61 kB {feature.module} {main} [rendered]
chunk {main} main.bundle.js, main.bundle.js.map (main) 6.38 kB {vendor} [initial] [rendered]
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 160 kB {inline} [initial] [rendered]
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 10.5 kB {inline} [initial] [rendered]
chunk {vendor} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.16 MB [initial] [rendered]
```

Fix #6700
2017-07-05 14:50:52 -07:00
Johannes Schramm
1c6179af85 fix(@angular/cli): adjust blueprint tslint.json rule semicolon 2017-07-05 14:27:24 -07:00
Johannes Schramm
f25ce49734 fix(@angular/cli): adjust blueprint tslint.json rule member-ordering 2017-07-05 14:27:24 -07:00
Filipe Silva
55b9d5ca0c fix(@angular/cli): use a single exclamation mark for blueprint
...then shalt thou count to one, no more, no less. One shall be the number thou shalt count, and the number of the counting shall be one. Two shalt thou not count, neither count thou zeroth, excepting that thou then proceed to one. Three is right out.
2017-07-05 12:58:14 -07:00
James Ayvaz
36e4d7b4bb feat(@angular/cli): read proxyConfig from angular-cli.json
easy proxy config by reading default from angular-cli.json (#6240)
2017-07-05 11:45:52 -07:00
Sumit Arora
64e6b94908
fix(@angular/cli): fix directory issue
Closes #6444
2017-06-30 10:32:08 -07:00
Filipe Silva
304d4c87ef
release: 1.3.0-beta.0 2017-06-29 13:57:43 -07:00
Filipe Silva
28e4114785 feat(@angular/cli): followup changes to circular dependency detection
Flag is now positive instead of negative and shorter, and can now be set on commands as well (`--show-circular-dependencies`).

Dependency was also added to eject as per https://github.com/angular/angular-cli/pull/6813#issuecomment-311567074.
2017-06-29 11:18:39 -07:00
Charles Lyding
3dbd3ad88e refactor(@angular/cli): remove unneeded rimraf dependency 2017-06-29 15:49:59 +01:00
Yaroslav Admin
70713bf076 feat(@angular/cli): add flag to specify environment for ng test command 2017-06-29 14:28:11 +01:00
mgechev
8bad46eef2 fix(@angular/cli): remove slash in the end of open tag
HTML5 void elements should not have a slash.

https://stackoverflow.com/questions/3558119/are-non-void-self-closing-tags-valid-in-html5
2017-06-28 15:01:44 +01:00
Daniel Rönnkvist
0c6a9c5beb fix(@angular/cli): Changed init order to make sure all files gets committed
With the update of npm 5 and the introduction of package-lock.json all files weren't
committed into the first commit.
2017-06-28 14:49:05 +01:00
Daniel Sogl
7e00859e12 feat(@angular/cli): bump blueprint dependencies 2017-06-28 14:41:02 +01:00
Charles Lyding
9469333380 refactor(@angular/cli): remove unneeded debug package dependency 2017-06-28 14:28:26 +01:00
Charles Lyding
07a3d52b51 refactor(@angular/cli): simplify ember-cli promise usage 2017-06-28 14:28:26 +01:00
Charles Lyding
89dd9709ea refactor(@angular/cli): partial upgrade to ember-cli 2.13.2 2017-06-28 14:28:26 +01:00
Reto Lehmann
0e05e5168b fix(@angular/cli): Fixed e2e task to respect --publicHost setting as baseUrl for protractor (#6266)
https://github.com/angular/angular-cli/pull/6173 added two new settings
to the serve task. The --publicHost setting is not respected as baseUrl
for protractor in the e2e-task.

With this fix, if --publicHost is set, it will be used as baseUrl for protrator.
2017-06-27 16:46:44 +01:00
Narain Sagar
aabad932d6 feat(@angular/cli): update e2e blueprint files 2017-06-27 16:34:29 +01:00
cexbrayat
054b203a92 fix(@angular/cli): bump jasmine and add jasminewd2 types
This bumps jasmine types to 2.5.53.
The version was previously pinned down to 2.5.45, because more recent versions weren't playing nice with Protractor
and lead to errors like https://github.com/angular/protractor/issues/4176

The proper fix appears to be the one mentioned in the Protractor issue: add `@types/jasminewd2` typings,
and add these typings to the tsconfig for e2e tests.

[jasminewd](https://github.com/angular/jasminewd) is the adapter used by Protractor to handle the async part.
2017-06-27 16:31:42 +01:00
Filipe Silva
1f3738b19f feat(@angular/cli): add circular dependency detection
Circular dependencies, like `app.module.ts` importing `app.component.ts` which in turn imports `app.module.ts`, now display a warning during builds:

```
kamik@T460p MINGW64 /d/sandbox/master-project (master)
$ ng build
Hash: 3516b252f4e32d6c5bb8
Time: 8693ms
chunk    {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 160 kB {4} [initial] [rendered]
chunk    {1} main.bundle.js, main.bundle.js.map (main) 5.95 kB {3} [initial] [rendered]
chunk    {2} styles.bundle.js, styles.bundle.js.map (styles) 10.5 kB {4} [initial] [rendered]
chunk    {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 1.88 MB [initial] [rendered]
chunk    {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]

WARNING in Circular dependency detected:
src\app\app.module.ts -> src\app\app.component.ts -> src\app\app.module.ts

WARNING in Circular dependency detected:
src\app\app.component.ts -> src\app\app.module.ts -> src\app\app.component.ts
```

It is important to detect and eliminate circular dependencies because leaving them in might lead to `Maximum call stack size exceeded` errors, or imports being `undefined` at runtime.

To remove these warnings from your project you can factor out the circular dependency into a separate module.

For instance, if module A imports `foo` from module B, and module B imports `bar` from module A, it is enough to extract `foo` into module C.

You can turn off these warnings by running ng set apps.0.hideCircularDependencyWarnings=true. This will add the "hideCircularDependencyWarnings": true value to your .angular-cli.json and disable the warnings.

Fix #6309
Fix #6739
2017-06-27 16:30:30 +01:00
Stephen Fluin
c9cbf59a53 fix(@angular/cli): Improve comment in sample html 2017-06-27 16:24:48 +01:00