127 Commits

Author SHA1 Message Date
Charles Lyding
2ae0300ad5 refactor(@angular-devkit/build-angular): optimize parallel worker shutdown
Stopping the workers can be a potentially lengthy process with a multi-stage approach based on the state of the worker.  This can cause lengthy blocking of the build.  This change allows the shutdown to happen in parallel to the remainder of the build.
2020-05-18 19:30:03 +01:00
Alan Agius
4d4fc099ff build: udate angular packages to version 10 2020-05-07 10:38:22 -07:00
Charles Lyding
b1af6e8342 fix(@angular-devkit/build-angular): downlevel and optimize locale data
Locale data is now transformed to be compatible with the ECMAScript level of the application bundles.  The locale data is also optimized to remove comments and unnecessary whitespace.

Fixes: #17497
2020-05-06 11:43:04 -07:00
Alan Agius
a723af4271 feat(@schematics/angular): evergreen new applications
By default, we now generate new applications which support only evergreen browsers, as a result differential loading is now opt-in.

A new flag `--legacy-browsers`, was added to generate applications which support non evergreen browsers such as Internet Explorer 11.

**Note**: After an application is generated opting in and out of differential loading is still possible through the supported browsers configuration in the browserslist configuration file  defaulted to `.browserslistrc`.
2020-05-04 10:53:48 -07:00
Filipe Silva
ef7a07050a test(@angular-devkit/build-angular): build and test with Bazel 2020-04-30 15:12:46 -07:00
Pete Bacon Darwin
b3792deaae fix(@angular-devkit/build-angular): the path to source_file_utils changed in v10.0.0 2020-04-29 10:15:59 -07:00
Alan Agius
8fb7e586cc refactor(@angular-devkit/build-angular): remove deprecated evalSourceMap, vendorSourceMap, profile and skipAppShell options
BREAKING CHANGE:

The following deprecated devkit builders options have been removed:
- `skipAppShell:` This has no effect
- `evalSourceMap`: This done to improve performance in older versions of the CLI and is no longer needed
- `vendorSourceMap`: Use `sourceMap.vendor` instead
- `profile`: Use `NG_BUILD_PROFILING` environment variable instead
2020-04-27 15:08:15 -07:00
Alan Agius
69aa460335 refactor(@angular-devkit/build-angular): remove deprecated es5BrowserSupport build option
BREAKING CHANGE
Deprecated browser builder option `es5BrowserSupport` has been removed. The inclusion for ES5 polyfills will be determined from the browsers listed in the browserslist configuration.
2020-04-22 10:38:19 -07:00
Alan Agius
10e7eb2c24 test: change browserslist file name to .browserslistrc 2020-04-06 09:58:42 -07:00
Charles Lyding
2e8420390d fix(@angular-devkit/build-angular): improve quality of localized sourcemaps
Fixes: #17131
2020-03-23 17:26:31 -07:00
Charles Lyding
d2dce463d0 fix(@angular-devkit/build-angular): reduce fast sourcemap threshold
High fidelity sourcemap processing can be expensive for larger bundle sizes.  This reduces the threshold to the original 500KB value to improve performance.
2020-03-23 17:25:07 -07:00
Fabian Wiles
bc5ce395e5
Merge pull request #16648 from Toxicable/preserve-symlink-nodejs
feat(@angular-devkit/build-angular): default to NodeJS value for pres…
2020-03-23 14:18:27 -07:00
Charles Lyding
f0bada1925 fix(@angular/cli): allow for private use language subtags
Fixes:  #17163
2020-03-16 21:44:42 -07:00
Charles Lyding
a5aefa1258 refactor(@angular-devkit/build-angular): temporarily disable plugin based localization 2020-03-13 13:14:58 -07:00
Alan Agius
1a1ceb609b build: update angular packages to 9.1.0-next.4 and TypeScript 3.8 2020-03-11 10:33:38 -07:00
Charles Lyding
ad9d73d0d2 fix(@angular-devkit/build-angular): provide locale data discovery fallbacks
This synchronizes the behavior with the FW's wherein the language code will be used if the data for the full locale is not found. The user will still be notified in the event this occurs.
2020-03-05 11:33:52 -08:00
Alan Agius
e414d9b44a fix(@angular-devkit/build-angular): generate ES5 code in ES5 bundles for default browserslist configuration 2020-03-05 11:30:23 -08:00
Alan Agius
94c753c1a5 fix(@angular-devkit/build-angular): limit the amount of CPUs used by workers
See: https://github.com/angular/angular-cli/issues/16860#issuecomment-588828079
2020-02-25 10:28:25 -08:00
Alan Agius
4e65705205 fix(@angular-devkit/build-angular): baseHref with protocol and localize option
`posix.join` will dedupe double forward slashes resulting in incorrect protocol.

Closes: #17029
2020-02-24 12:39:47 -08:00
Charles Lyding
5bd3b911ce refactor(@angular-devkit/build-angular): use localize babel plugins directly
With recent improvements in the performance of babel parsing and AST traversal, the localize babel plugins can now be leveraged directly.
2020-02-19 10:08:55 -08:00
Charles Lyding
5a53b84f96 fix(@angular-devkit/build-angular): insert sourcemap source content when using fast path 2020-02-13 15:50:58 -08:00
Charles Lyding
6091879428 fix(@angular-devkit/build-angular): generate correct filenames when targeting ESNext
Fixes: #16906
2020-02-12 12:01:42 -08:00
Alan Agius
d0ede14918 refactor: remove safari nomodule polyfills as it's unsupported 2020-02-11 08:47:20 -08:00
Charles Lyding
3c771d1b56 fix(@angular-devkit/build-angular): only remove localize polyfill if in AOT mode
Fixes: #16890
2020-02-11 08:46:40 -08:00
Alan Agius
a2c0532ca7 fix(@angular-devkit/build-angular): provide supported browsers to babel
By default the browserslist `configPath` will default to `process.cwd()`. This might return incorrect data in a multi app workspace setup.

https://babeljs.io/docs/en/babel-preset-env#configpath
2020-02-04 07:29:27 -08:00
Charles Lyding
878e4473e0 fix(@angular-devkit/build-angular): use translation file in bundle hash calculations
This change ensures that any changes to translation files is represented in the output file names when output hashing is enabled.  This prevents the situation where a translation file only change to an application would result in built files with no change in output name.
2020-02-04 07:26:41 -08:00
Charles Lyding
397ef0590b refactor(@angular-devkit/build-angular): improve debug optimize environment variables
`NG_BUILD_DEBUG_OPTIMIZE` when enabled will disable minify and mangle as well as enable beautify.
2020-01-29 17:12:05 -08:00
Charles Lyding
8a55bc3115 fix(@angular-devkit/build-angular): ensure babel configurations are isolated
The `configFile` option needs to be set to false to ensure Babel does not attempt to discover and load any file based configurations.
2020-01-28 10:35:18 -08:00
Pete Bacon Darwin
9bbc7c785f fix(@angular-devkit/build-angular): pass filename to parseSync
The latest version of Babel (e.g. 7.8.3) requires a filename
to be passed to `parseSync()`.

Fixes #16781
2020-01-28 10:22:43 -08:00
Charles Lyding
d8cd9b73b3 fix(@angular-devkit/build-angular): reintroduce fast sourcemap path 2020-01-27 11:26:20 -08:00
Charles Lyding
5a1b190fdf refactor(@angular-devkit/build-angular): add additional debug build environment variables
`NG_BUILD_MINIFY` can be used to separately disable minification (terser's compress)
`NG_BUILD_BEAUTIFY` can be used to format the output code even when otherwise optimized
2020-01-23 18:00:25 -08:00
Alan Agius
237c1dcf2b build: update jest-worker to version 25.1.0 2020-01-23 15:28:37 -08:00
Charles Lyding
b989e4583e fix(@angular-devkit/build-angular): improve quality of differential loading sourcemaps 2020-01-09 12:02:32 -08:00
Alan Agius
4630e03209 fix(@angular-devkit/build-angular): account for hashed and non hashed filesnames when having sourcemaps 2020-01-04 11:19:09 -08:00
Charles Lyding
032fb147f9 fix(@angular-devkit/build-angular): prevent differential loading double sourcemap search
This can drastically reduce memory usage; especially in cases where bundled code modules contain individual sourcemap comments and vendor sourcemaps are disabled.  Enabling the vendor sourcemap option has the side effect of removing all individual module sourcemap comments and as a result removes the potential for those comments to be found and processed.
2020-01-02 11:27:40 -08:00
Alan Agius
490c24be98 fix(@angular-devkit/build-angular): add sourceMappingURL comment for ES2015 during differential loading
When having differential loading enabled we only add the `sourceMappingURL` comment when optimization is enabled, because we only process these bundles when we enabling optimization.

With this change we now process such bundles even when optimization is disabled and add `sourceMappingURL` when source maps are enabled and not hidden.

Closes #16522
2020-01-02 11:27:27 -08:00
Charles Lyding
a5a8cc53bf fix(@angular-devkit/build-angular): optimize web worker differential loading processing
Closes #16441
2019-12-17 11:17:45 -08:00
Charles Lyding
f4bb020b94 fix(@angular-devkit/build-angular): ensure source locale data is injected when localizing
Fixes #16389
2019-12-09 13:40:50 -08:00
Alan Agius
f1985e1315 fix(@angular-devkit/build-angular): resolve @babel/preset-env
This is needed as otherwise under Bazel we hit `Cannot find module '@babel/preset-env` we use `require.resolve` since this is always patched under Bazel.
2019-12-09 13:39:35 -08:00
Charles Lyding
c37eaeec43 fix(@angular-devkit/build-angular): augment base HREF when localizing
All locale i18n options now support an object form which allows a base HREF to be defined for the locale.  Each locale can now optionally define a custom base HREF that will be combined with the base HREF defined for the build configuration.  By default if the shorthand form for the locale is used or the field is not present in the longhand form, the locale code will be used as the base HREF.  To disable automatic augmentation a base HREF value of an empty string (`""`) can be used.  This will prevent anything from being added to the existing base HREF.

For common scenarios, the shorthand form will result in the preferred and recommended outcome of each built locale variant of the application containing a defined base HREF  containing the locale code.
2019-12-04 08:14:16 -08:00
Charles Lyding
1d79b28c17 fix(@angular-devkit/build-angular): support differential loading for web workers
Fixes #16275
2019-12-02 10:19:38 -08:00
Charles Lyding
09a7d87f00 fix(@angular-devkit/build-angular): ensure HTML lang attribute is set when localizing 2019-12-02 10:17:57 -08:00
Charles Lyding
ef7748524c fix(@angular-devkit/build-angular): make i18n translation files relative to workspace
All other paths within the workspace file are relative to the workspace root.
2019-11-26 13:08:29 -08:00
Charles Lyding
adb4139b80 fix(@angular-devkit/build-angular): cache localize results with development server 2019-11-26 13:05:30 -08:00
Greg Magolan
a4200a0f04 refactor(@angular-devkit/build-angular): allow @angular/core version 0.0.0
Allow version "0.0.0" for integration testing in the angular/angular repository with the generated development @angular/core npm package which is versioned "0.0.0".
This is a pre-req for https://github.com/angular/angular/pull/33927 which runs integration tests against the bazel generated npm packages.
2019-11-22 22:36:31 +01:00
Charles Lyding
cfc0aa4780 fix(@angular-devkit/build-angular): properly process es2016+ targets with differential loading
A target of es2015 was previously assumed when using differential loading.  This could result in erroneously downleveling an es2016+ output file instead of generating a new es5 output file.
2019-11-20 13:21:58 -08:00
Igor Minar
17792c46b3 fix(@angular-devkit/build-angular): update link to update.angular.io
This link is rarely seen by developers but when they do see it, they should get the real one.
2019-11-20 08:51:21 -08:00
Charles Lyding
798790622d fix(@angular-devkit/build-angular): allow new i18n options to work with VE 2019-11-18 10:54:35 -08:00
Charles Lyding
04cb2ac17b fix(@angular-devkit/build-angular): support global locale data with development server 2019-11-15 10:42:18 -08:00
Charles Lyding
9c682b7c04 refactor(@angular-devkit/build-angular): re-enable multi-localize support 2019-11-15 10:42:18 -08:00