We recently added a new message format called `legacy-extract` that is used to migrate between
legacy and canonical message IDs (see https://github.com/angular/angular/pull/41026).
These changes expose the new format in `extract-i18n`.
Previously, if a browser build failed using the `browserBuild` test utility function, the test utility would try to access properties that did not exist and would crash. This increased the complexity to debug failing tests. With the new behavior, the `browserBuild` test utility will return with an empty `files` object and the failed builder result.
When using the `statsJson` browser builder option, the resulting JSON data is now streamed into a file instead of written in one large block. This mitigates crashes due to the generated string exceeded the Node.js limit.
Change the default of this flag to disabled by default as this is a caused of rebuild performance degradation for large projects.
BREAKING CHANGE
The server and browser builder `showCircularDependencies` option default value has been changed from `true` to `false`.
BREAKING CHANGE
`suppressZoneJsIncompatibilityWarning` option has been removed. If you are using this plugin directly and `async/await` in ES2017 make sure you downlevel the async syntax using Babel.
See: https://github.com/angular/zone.js/pull/1140 for more information.
By using the output path provided directly by the Webpack builder's result, one additional reason for using the expensive `Stats.toJson` call is removed.
This change also removes multiple linting disable rule comments now that the output path property is guaranteed to be present.
Webpack's `Stats.toJson` function is an expensive operation and is recommended to be avoided where possible. In the case of the karma plugin, the compilation errors can be accessed directly without the need for the function call.
Webpack's Stats.toJson function is an expensive operation and is recommended to be avoided where possible. In the case of the analytics plugin, the chunks and assets can be accessed directly from the Webpack compilation.
This ensures that vendor sourcemaps are not loaded from file when they have not been previously loaded via sourcemap-loader.
When vendor sourcemap is enabled, `inputSourceMap` is not needed, since the sourcemap is already available and the `sourceMappingURL` comment is removed from source.
The plugin was only used when the `NG_BUILD_PROFILING` environment variable was used. The environment variable also enabled the Webpack builtin `ProfilingPlugin` which is retained.
The builtin plugin provides a chrome events JSON output which can be loaded in Chrome DevTools and allows for graphical timeline views of the build.
The `speed-measure-plugin` is also currently incompatible with Webpack 5 which would prevent the CLI profiling support from working with Webpack 5.
This change moves the global script resolution logic to a separate function to aid in reducing the complexity of the Webpack styles configuration partial generation function.
By using Webpack's nested rule and `oneOf` rule support, a large amount of conditional logic and array processing can be removed from the Webpack style configuration generator function.
With this change, the architect can be configured to use a default configuration when it's not provided as part of the target.
Consider the below, where `defaultConfiguration` is configured to `production`. Running `ng build` will be invoked with "production" configuration.
```js
"build": {
"builder": "@angular-devkit/build-angular:browser",
"defaultConfiguration": "production",
"options": {
...
},
"configurations": {
"production": {
...
}
}
}
```
The custom babel loader allows files to be conditionally processed by the i18n inlining transforms based on both file path and content.
By allowing content based checks, the entire parse/transform/print process can be skipped for files that do not contain localizations.
The test now waits until the express server is listening and uses a try/finally block to ensure the server is shutdown.
The test server also only now binds to localhost and lets the OS choose a port. This provides better support for running multiple tests in parallel.