229 Commits

Author SHA1 Message Date
Charles
f8a58213eb feat(@angular-devkit/build-angular): add defer attributes to classic scripts (#15087)
This change synchronizes the behavior of classic scripts and module scripts (`type="module"`).  Module scripts are deferred by default.  Also, certain injected scripts are not considered module scripts even in a ES2015+ build due to the strict mode behavior of module scripts.  Deferring such scripts also ensures consistent execution in those scenarios.
2019-07-16 09:58:19 -07:00
Alan
885005241e build: update webpack to version 4.35.3 2019-07-11 01:21:18 +08:00
Charles Lyding
8e97df3888 feat(@angular-devkit/build-angular): allow control of index output path
This allows the output path of an application's index HTML file to be controlled independently of the input file.  The output path for the file will be considered relative to the application's configured output path.  This allows an application to contain multiple input index files for different configurations and allow the output file to remain constant.  This also enables the placement of the index file in a subdirectory within the output path or change the name of the output index file neither of which was previously possible.
2019-07-10 04:34:20 +08:00
Alan Agius
86266a39fa fix(@ngtools/webpack): resources path normalizations
Compiler host `readResource` is always called with POSIX seperators. However the `denormalizePath` method doesn't convert forward slashes to back slashes which causes `getModifiedResourceFiles` to return an empty `Set`.

We were also assuming that `_changedFiles` is an FS path which was not the case as it's original type is `Path`

Fix #15012
2019-07-10 04:17:05 +08:00
Charles Lyding
f6953f0123 fix(@angular-devkit/build-angular): only add module script types to actual module scripts
`ng serve` was errantly adding a module type to custom script bundles.  These scripts may contain ES5 and non-strict compatible code and can therefore not be marked as module scripts.  `ng build` already correctly operates in this fashion.

Fixes #14952
2019-07-10 04:13:43 +08:00
Alan
2b367be1c3 feat(@angular-devkit/build-angular): deprecate scripts and styles lazy option in favor ofinject
The lazy option inside the script and style option is confusing as this option doesn't lazy load a bundle but rather it doesn't inject/reference the script in the HTML. While this option is an enabler for lazy loading, the users will still need to handle on how how this bundle will be lazy loaded. There are also potential use cases beyond lazy loading for the option.

Closes #14814
2019-07-02 11:05:51 -07:00
Charles Lyding
99fa7bd71f test: add initial ivy large test support 2019-07-02 10:04:09 -07:00
Alan Agius
68227565ce feat(@angular-devkit/build-angular): add crossorigin options
This options allows to define the crossorigin attribute setting of elements that provide CORS support

Closes #14743
2019-06-27 15:12:43 -07:00
Alan
44a0d0fb4e fix(@angular-devkit/build-angular): add type="module" on script tags when differential loading will be enabled
Fixes #14747
2019-06-26 11:17:21 -07:00
FDIM
af2b1b55dc feat(@angular-devkit/build-angular): option to build and test only specified spec files 2019-06-24 17:27:25 -07:00
Alan
d43ca041e2 fix(@angular-devkit/build-angular): re-order reporters to set code coverage at the very end 2019-06-20 10:58:54 -07:00
Alan Agius
1dd399c4d2 fix(@angular-devkit/build-angular): nomodule polyfill for Safari
10.1 and iOS Safari 10.3

The nomodule polyfill needs to be loaded prior to any script and be
outside of webpack compilation because otherwise webpack will cause the
script to be wrapped in `window["webpackJsonp"]` which causes it to
fail.

This polyfill will only be injected when the either Safari 10.1 or iOS
Safari 10.3 support is required, which is based on the browsers  defined in browserslist file.

Fixes #14680
2019-06-11 09:55:03 -07:00
Alan Agius
473b4c4a5a test: fix flakes of rebuilds TS worker
Not quite sure why such a long 'debounceTime' is needed anything under `2500` is a constant failure locally and this is also rather flaky on CI when it doesn't run as the first test.

It seems that the outputted files contents don't get updated in time.
2019-06-11 09:54:14 -07:00
Filipe Silva
819892a359 ci: remove appveyor and buildkite 2019-06-06 16:02:17 -07:00
Alan
6893fc1cdd fix(@angular-devkit/build-angular): server build is generating un-needed polyfill file
Fixes #14655
2019-06-06 14:26:30 -07:00
Alan
e3bb367db1 fix(@ngtools/webpack): rebuilding project with errors reports cannot find .ts files in JIT
When the first build in JIT has an error we are not emitting files. This ends up causing an issue because subsequent builds only trigger partial emits of files and only emits the full set of files if the number of files changed is greater than 20.

This logic adds the behavior that we only enter the 'only 20 files' part when the previous build was successful.

Fixes #14644
2019-06-06 14:25:40 -07:00
Nick Webster
a976e45f8b fix(@angular-devkit/build-angular): exclude map files from 'bundle' budgets 2019-05-30 14:05:59 -07:00
Alan
3a400c54cb fix(@angular-devkit/build-angular): dev-server port number mismatches in logs when using port=0
Fixes #14499
2019-05-23 19:15:50 +02:00
Alan
b361a97abe fix(@angular-devkit/build-angular): absolute outputPath outputs index.html in wrong location
Fixes #14474
2019-05-21 09:07:58 -04:00
Filipe Silva
74f2ee68d6 fix(@angular-devkit/build-angular): show error for missing modules
Fix #14421
2019-05-15 14:13:44 -07:00
Alan
e333450dc0 feat(@angular-devkit/build-angular): add a post transformation hook to index generation
Fixes #14392
2019-05-14 10:51:56 -07:00
Charles Lyding
68bc0c7bc1 fix(@angular-devkit/build-angular): extract i18n should only show warnings/errors
Fixes #14373
2019-05-10 15:08:10 -07:00
Charles Lyding
01247c9339 fix(@angular-devkit/build-angular): stop dev server fallback outside of serve path
The serve path represents the base of the application.  Accessing a different path (`/api/` for instance) should not cause the application to load if the application's base is `/test/`
2019-05-09 10:11:05 -07:00
Charles Lyding
0b700c3c27 fix(@angular-devkit/build-angular): protractor should use dev server baseUrl 2019-05-09 10:10:33 -07:00
Filipe Silva
16c8d59d17 fix(@angular-devkit/build-angular): used named chunks for dynamic imports
Fix #14251
2019-05-07 16:14:13 -06:00
Charles Lyding
5b4b78bfbb feat(@angular-devkit/build-angular): use evergreen version of zone.js with ES2015 2019-04-25 12:12:29 -07:00
ManfredSteyer
201856a5ec fix(@angular-devkit/build-angular): run build steps for differential loading in sequence to avoid confusing progress information
Before, the build tasks ran in parallel and so the different webpack
instances competed over the same lines on the console.

To fail fast and to prevent to show the same errors twice, the second
build step is not executed if the first one fails.

As running these tasks in sequence causes issues with watch mode, this
PR also disables differential loading when watch mode is requested.
2019-04-19 10:54:51 -07:00
Alan
407d1d5b49 fix(@schematics/angular): generate tsconfig.worker.json outside of the src folder
This is to align with the folder structure of version 8, were tsconfigs are outside of the `src` folder

Also, this change remove the dud `tsconfig.json` in the `src` folder and instead we add the triple slash lib reference `/// <reference lib="webworker" />` for IDE support.
2019-04-18 11:47:22 -07:00
Alan Agius
c319cd054e test: update tests large to cater for the bundle changes with differential loading 2019-04-15 11:03:09 -07:00
Alan Agius
8432650efd test: fix flaky profile flag test large
This change addresses the flaky profile flag test large that sometimes caused `RangeError Maximum call stack size exceeded` inside regex
2019-04-12 12:21:41 -07:00
Alan Agius
5f13d06cb3 fix(@angular-devkit/build-angular): ignore bundle budgets when running karma or devserver
Fixes #14100
2019-04-12 12:17:35 -07:00
ManfredSteyer
32a096f3f0 feat(@angular-devkit/build-angular): differential loading
This PR adds differential loading to the browser builder. First, it checks if differential loading is needed. This is the case if the compilation target is ES2015 while the browserslist points to ES5 browsers.

For providing differential loading, it calls the methods for creating the webpack config for each compilation target (e. g. ES5 and ES2015). The needed differences between those configurations are defined using parameters also added by this PR. Then it calls webpack for each of them and merges the results

This feature is currently hidden behind a flag. To activate it, set the differentialLoading flag in browser/index.ts.
2019-04-09 09:25:37 -07:00
Alan Agius
a5bdddb862 test: change large specs to not use @angular/http 2019-04-04 09:27:35 -07:00
Charles Lyding
76492141d2 refactor(@angular-devkit/build-angular): cleanup architect imports 2019-04-03 16:28:16 +02:00
Charles Lyding
c6d145bf32 test(@angular-devkit/build-angular): cleanup unused imports 2019-04-02 10:31:24 -07:00
Filipe Silva
6e0a040ad9 refactor(@angular-devkit/build-angular): support web worker in new architect 2019-04-02 04:49:34 -07:00
Filipe Silva
ed0e6aab57 feat(@angular-devkit/build-angular): support TS web workers 2019-04-02 04:49:34 -07:00
Filipe Silva
1810394c3a test(@angular-devkit/build-angular): test worker bundling 2019-04-02 04:49:34 -07:00
Alan
7915a582cf fix(@ngtools/webpack): changes in non module code are not picked up when using barrel files
Fixes #13975
2019-03-29 14:47:03 -07:00
Charles Lyding
ba21c855c0 refactor(@angular-devkit/build-angular): cleanup stable architect API builder file names 2019-03-29 14:37:35 -07:00
Charles Lyding
dd058a2cc3 refactor(@angular-devkit/build-angular): remove experimental architect builders 2019-03-29 14:37:35 -07:00
Charles Lyding
1327ee3ec9 test(@angular-devkit/build-angular): update service worker browser tests to stable API 2019-03-29 14:37:35 -07:00
Charles Lyding
61717b7c27 test(@angular-devkit/build-angular): update svg browser test to stable API 2019-03-29 14:37:35 -07:00
Charles Lyding
a011863477 feat(@angular-devkit/build-angular): implement stable architect API for extract-i18n 2019-03-25 12:39:05 -07:00
Hans Larsen
872799e174 feat(@angular-devkit/build-angular): add AppShell new API builder
This is fully compatible with the new API. The tests have been moved 1:1.
The cleanup in general is noticable.
2019-03-25 10:38:42 -07:00
Charles Lyding
2f791395d2 feat(@angular-devkit/build-angular): implement stable architect API for karma 2019-03-22 07:13:51 -07:00
Filipe Silva
6e3d2e0c4d feat(@ngtools/webpack): support Angular 8
This requires updating projects to TypeScript 3.3
2019-03-20 12:29:01 -07:00
Hans Larsen
5500ad2504 feat(@angular-devkit/build-angular): add Server Builder v2
Using the new Architect API. Including moving the tests.
2019-03-19 10:07:46 -07:00
Alan Agius
8f77d6711a fix(@angular-devkit/build-angular): update speed-measure-webpack-plugin to 1.3.1
This fixes the issue of it generating an empty speed-measure-plugin.json.

Fixes #12763
2019-03-19 09:28:20 -07:00
Alan Agius
f71896874e feat(@angular-devkit/build-angular): enable webpack profile when using stats-json flag
More information about what `profile` does can be found here: https://webpack.js.org/api/stats

Closes #13907
2019-03-19 09:25:28 -07:00