2200 Commits

Author SHA1 Message Date
Renovate Bot
96600f55d7 build: update dependency license-webpack-plugin to v3 2021-10-06 06:12:25 -05:00
Renovate Bot
a5dadc5f71 build: update all non-major dependencies 2021-10-06 06:12:13 -05:00
Charles Lyding
248ed4864e refactor(@angular-devkit/build-angular): remove unneeded @angular/core System.import workarounds
With the removal of support for the string form of `loadChildren` within the Angular router, the usage of `System.import` has also been removal from `@angular/core`. This removal allows for the additional removal of all workarounds within the Angular CLI due to the `System.import` usage. Webpack's deprecated support for `System.import` was previously required to be enabled which resulted in warnings that then needed to be suppressed. A Webpack context dependency replacement was also previously required to prevent Webpack from failing due to the otherwise unknown behavior of the `System.import` call. All of these workarounds have now been removed.
2021-10-06 06:11:36 -05:00
Charles Lyding
f10a828336 fix(@angular-devkit/build-angular): improve fidelity and performance of babel loader sourcemaps
This change uses the `@ampproject/remapping` package to merge sourcemaps generated from the customized babel loader used to perform the partial compilation linking in applications as well as other optimization and downleveling transformations. This provides more accurate output mapppings as well as improved performance and lower memory usage when source maps are enabled within a build.
2021-10-06 06:10:57 -05:00
Alan Agius
b715e73957 test(@angular-devkit/build-angular): update shared lazy modules spec file path 2021-10-05 11:38:20 -04:00
Alan Agius
7930b50388 build: update ng-packagr to version 13.0.0-next.6 2021-10-05 11:38:20 -04:00
Alan Agius
e11209591a refactor(@angular-devkit/build-angular): use @angular/localize/tools entry-point 2021-10-05 11:38:20 -04:00
Charles Lyding
4be6537ddf fix(@angular-devkit/build-angular): update TS/JS regexp checks to latest extensions
The regular expressions based checks for TypeScript and JavaScript files used by Webpack module rules have been updated to include all current extension variations.
JavaScript files can be either `.js`, `.mjs`, or `.cjs`. TypeScript files as of the upcoming version 4.5 can be either `.ts`, `.mts`, or `.cts`.
Also while not officially supported by Angular, the TypeScript compiler can attempt to process any of the previous extensions with an `x` suffix which indicates a JSX/TSX file.
2021-10-05 04:44:24 -05:00
Alan Agius
22cd9edfaf feat(@angular-devkit/build-angular): favor es2020 main fields
APF version 13 will include es2020, with this change we favor es2020 entrypoints.
2021-10-01 14:08:14 -05:00
Alan Agius
000b0e51c1 feat(@angular-devkit/build-angular): remove deprecated dev-server options
BREAKING CHANGE: With this change a number of deprecated dev-server builder options which proxied to the browser builder have been removed. These options should be configured in the browser builder instead.

The removed options are:
- `aot`
- `sourceMap`
- `deployUrl`
- `baseHref`
- `vendorChunk`
- `commonChunk`
- `optimization`
- `progress`
2021-10-01 14:07:42 -05:00
Paul Gschwendtner
f383f3201b fix(@angular-devkit/build-angular): ESM-interop loaded plugin creators of @angular/localize/tools not respected
This is a follow-up to fb210e5b747ce0351dd9ee7d482770b9cfa71133 which
added support for the ESM-variant of the `@angular/localize` package,
and also prepared for the `tools/` secondary entry-point we will expose
as of v13.

Unfortunately this change currently does not pass-through the ESM-loaded
plugin creators as the option (which is passed to the Babel plugin) is
incorrect. This was hidden due to a type cast. This commit fixes the
issue and also ensures TS would complain in the future if the option
names differ.
2021-09-30 06:57:01 -04:00
Renovate Bot
1a8d0d0af5 build: update all non-major dependencies 2021-09-29 15:36:38 -04:00
Alan Agius
4e0743c8ad perf(@angular-devkit/build-angular): change webpack hashing function to xxhash64
`xxhash64` uses a faster WASM based hash mechanism.
2021-09-29 11:33:56 -04:00
Alan Agius
884111ac0b fix(@angular-devkit/build-angular): update IE unsupported and deprecation messages
IE 11 is no longer supported.
2021-09-29 09:22:11 -04:00
Alan Agius
505438cc41 feat(@angular-devkit/build-angular): support TypeScript 4.4
BREAKING CHANGE: TypeScript versions prior to 4.4 are no longer supported.
2021-09-28 09:35:19 -04:00
Charles Lyding
043c4107f8 refactor(@angular-devkit/build-angular): remove patching of @angular/localize Diagnostics object
A Babel webpack loader specific `@angular/localize` package `Diagnostics` object is now created that is optimized for the diagnostics reporting case. This removes the need to manually create and patch an instance of a Diagnostics object. Future work will potentially allow a reporter to be passed directly to the translation plugins to remove the need to create a new object entirely.
2021-09-28 04:58:10 -04:00
Charles Lyding
47bf88e10f refactor(@angular-devkit/build-angular): use module resolution to search for i18n locale data
Previously, the search for a locale's data when using i18n was performed by a series of file system accesses that searched through the `@angular/common` package. The search is now conducted via Node.js module resolution which has several advantages. The internal structure of the package is no longer assumed and allows the `@angular/common` package to change its internal implementation without affecting the locale data search. File extensions of the locale data files are also not hard-coded as only the name of the locale data is needed to perform a search. There are also less direct file system access calls and the search can leverage whatever internal caching Node.js performs during module resolution.
2021-09-28 04:58:10 -04:00
Alan Agius
ff58f775d3 refactor(@angular-devkit/build-angular): pass SSL cert and key path to dev-server
Since version 4.2.0 webpack-dev-server supports read the mentioned files.

See:
9bb6f78948/CHANGELOG.md (420-2021-09-09)
2021-09-27 16:34:22 -04:00
Renovate Bot
d2e302cc42 build: update all non-major dependencies 2021-09-27 06:46:21 -04:00
Charles Lyding
fb210e5b74 refactor(@angular-devkit/build-angular): support ESM @angular/localize usage
With the Angular CLI currently being a CommonJS package, this change uses a dynamic import to load `@angular/localize` which may be ESM. CommonJS code can load ESM code via a dynamic import. Unfortunately, TypeScript will currently, unconditionally downlevel dynamic import into a require call. require calls cannot load ESM code and will result in a runtime error. To workaround this, a Function constructor is used to prevent TypeScript from changing the dynamic import. Once TypeScript provides support for keeping the dynamic import this workaround can be dropped and replaced with a standard dynamic import.
2021-09-27 06:45:24 -04:00
Paul Gschwendtner
0e7277c63a fix(@angular-devkit/build-angular): babel adjust enum plugin incorrectly transforming loose enums
With Angular Package Format v13, we will be using a more recent version of rollup. Rollup
always suffixed exports to avoid collisions, but with the most recent version, the order
has changed slightly changed. e.g. previously for `@angular/core`, there were two instances
of the `ViewEncapsulation` enum part of the `fesm` bundle. The second instance of the enum
orginated from the compiler <--> core facade and it got renamed to avoid conflicts with the
actual declaration of `ViewEncapsulation`. Now this has changed, and the first export is
being renamed instead. This now breaks at runtime because the first export is being incorrectly
transformed by the adjust enum plugin of `build-angular`. The plugin always had this problem
of incorrectly transforming the enums, but it never surfaced because only the face enum has been
transformed (which is not used at runtime). e.g.

consider the following input in `core.mjs`:

```
var ViewEncapsulation$1;
(function (ViewEncapsulation) {
    ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated";
})(ViewEncapsulation$1 || (ViewEncapsulation$1 = {}));
```

this is transformed into:

```
var ViewEncapsulation$1 = /*#__PURE__*/(() => {
  ViewEncapsulation$1 = ViewEncapsulation$1 || {};
  ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated";
}());
```

Note how the enum assignment for `Emulated` incorrectly still uses the non-suffixed
identifier that previously was part of the callee wrapper function.
2021-09-24 09:46:02 -04:00
Renovate Bot
8f33bdbb1c build: update all non-major dependencies to v0.13.2 2021-09-24 08:22:03 -04:00
Charles Lyding
fb1ad7c5b3 feat(@angular-devkit/build-angular): support ESM proxy configuration files for the dev server
The `proxyConfig` option now supports loading ESM configuration files in addition to JSON and CommonJS files. ESM files (such as those ending with `.mjs`) must provide a default export with the configuration object.
For example, a `proxy.config.mjs` containing the follow is now possible:
```
export default { "/api/*": { "target": "http://127.0.0.1:5001" } };
```

Closes #21623
2021-09-24 08:20:40 -04:00
Charles Lyding
13cceab8e7 fix(@angular-devkit/build-angular): use URLs for absolute import paths with ESM
Absolute import paths, especially on Windows, must be `file://` URLs when using ESM. Otherwise, Windows drive letters (e.g., `C:`) would be interpreted as a protocol instead of a drive letter when performing the import.
2021-09-23 13:59:31 -04:00
Renovate Bot
47dd77d928 build: update all non-major dependencies 2021-09-23 06:56:26 -04:00
Charles Lyding
9b207bddac refactor(@angular-devkit/build-angular): support ESM @angular/service-worker usage
With the Angular CLI currently being a CommonJS package, this change uses a dynamic import to load `@angular/service-worker/config` which may be ESM. CommonJS code can load ESM code via a dynamic import. Unfortunately, TypeScript will currently, unconditionally downlevel dynamic import into a require call. require calls cannot load ESM code and will result in a runtime error. To workaround this, a Function constructor is used to prevent TypeScript from changing the dynamic import. Once TypeScript provides support for keeping the dynamic import this workaround can be dropped and replaced with a standard dynamic import.
2021-09-23 06:52:06 -04:00
Charles Lyding
77561e796a refactor(@angular-devkit/build-angular): support ESM @angular/compiler-cli linker usage
This is a followup PR for #21771 that addresses partial compilation linker usage.
With the Angular CLI currently being a CommonJS package, this change uses a dynamic import to load `@angular/compiler-cli/linker[/babel]` which may be ESM. CommonJS code can load ESM code via a dynamic import. Unfortunately, TypeScript will currently, unconditionally downlevel dynamic import into a require call. require calls cannot load ESM code and will result in a runtime error. To workaround this, a Function constructor is used to prevent TypeScript from changing the dynamic import. Once TypeScript provides support for keeping the dynamic import this workaround can be dropped and replaced with a standard dynamic import.
2021-09-23 06:52:06 -04:00
Charles Lyding
0d76bf04bc fix(@angular-devkit/build-angular): support WASM-based esbuild optimizer fallback
In the event that the Angular CLI is executed on a platform that does not yet have native support for esbuild, the WASM-based variant of esbuild will now be used. If the first attempt to optimize a file fails to execute the native variant of esbuild, future executions will instead use the WASM-based variant instead which will execute regardless of the native platform. The WASM-based variant, unfortunately, can be significantly slower than the native version (some cases can be several times slower). For install time concerns regarding the esbuild post-install step, esbuild is now listed as an optional dependency which will allow the post-install step to fail but allow the full npm install to pass. This install scenario should only occur in the event that the esbuild native binary cannot be installed or is otherwise unavailable.
2021-09-22 16:09:57 +02:00
Renovate Bot
3a7e8505d3 build: update all non-major dependencies 2021-09-22 11:22:42 +02:00
Renovate Bot
13b9f7f45a build: update all non-major dependencies 2021-09-21 10:04:37 +02:00
Charles Lyding
3e6324f7c7 refactor(@angular-devkit/build-angular): support an ESM-only @angular/compiler-cli package
This uses a dynamic import to load `@angular/compiler-cli` which may be ESM. CommonJS code can load ESM code via a dynamic import. Unfortunately, TypeScript will currently, unconditionally downlevel dynamic import into a require call. require calls cannot load ESM code and will result in a runtime error. To workaround this, a Function constructor is used to prevent TypeScript from changing the dynamic import. Once TypeScript provides support for keeping the dynamic import this workaround can be dropped and replaced with a standard dynamic import.
2021-09-20 10:31:59 +02:00
Charles Lyding
b87771061c refactor(@angular-devkit/build-angular): support async partial Webpack configuration generators
Partial Webpack configuration generators are used to create the various aspects of the final Webpack configuration for build, testing, and serving. They previously could only be synchronous but may need to perform asynchronous actions to setup the Webpack configuration in the future. This is particularly relevant as the CLI transitions from CommonJS to ESM wherein synchronous require calls need to be replaced with asynchronous dynamic imports. For dynamic imports to be successfully used the configuration generators need to support asynchronous operations.
2021-09-20 10:31:59 +02:00
Charles Lyding
19eb5cb425 refactor(@angular-devkit/build-angular): use type imports for @angular/compiler-cli peer dependency
The `@angular/compiler-cli` is used as a peer dependency and has the potential to not be present. As a result static imports should only be used for types and value imports should be dynamic so that they can be guarded in the event of package absence. There are still several instances of static imports for values but these will be corrected in follow-ups.
2021-09-20 10:31:59 +02:00
Renovate Bot
d8554de60b build: update dependency core-js to v3.18.0 2021-09-20 10:28:10 +02:00
Renovate Bot
d1e28b4f1e build: update all non-major dependencies 2021-09-19 09:02:53 +02:00
Renovate Bot
ed376fe02e build: update all non-major dependencies 2021-09-17 19:57:23 +02:00
Renovate Bot
504f47fd74 build: update all non-major dependencies 2021-09-16 09:19:36 +02:00
Renovate Bot
3f31a6757f build: update all non-major dependencies 2021-09-14 09:05:32 +01:00
Charles Lyding
590c156642 fix(@angular-devkit/build-angular): add web-streams-polyfill to downlevel exclusion list
Polyfill related packages should not be downlevelled due to the nature of their code which may need to perform feature testing or leverage native capabilities to extract browser support information necessary to properly polyfill a given browser. In the case of `web-streams-polyfill`, it leverages the `%AsyncIteratorPrototype%`, when available, to fully polyfill its stream implementations.  To access `%AsyncIteratorPrototype%`, a native async generator is needed and therefore the code present in the package cannot have this case of a native async generator downlevelled. `core-js` is also excluded for similar (and additional reasons).
2021-09-14 09:03:28 +01:00
Alan Agius
df8f909d80 fix(@angular-devkit/build-angular): handle FORCE_COLOR when stdout is not instance of WriteStream
In some cases, custom implementation of stdout, don't extend `WriteStream` which causes colors not to be included in the output.

Closes #21732
2021-09-14 09:00:24 +01:00
Renovate Bot
be81752905 build: update all non-major dependencies 2021-09-08 10:19:14 +02:00
Charles Lyding
decb1d14b0 fix(@angular-devkit/build-angular): improve Safari browserslist to esbuild target conversion
The browser targets provided by `browserslist` have several differences than what `esbuild` expects for the Safari browsers. The first is that the iOS Safari is named `ios_saf` within browserslist and `ios` by esbuild. The former is now converted to the later when generating the target list for esbuild.  The second difference is that `browserslist` supports a `TP` (Technology Preview) version for Safari but esbuild expects a numeric value for all versions. Since a TP version of Safari is assumed to be the latest unreleased version and as a result supports all currently known features, a high version number (999) is used as a replacement when generating the target list for esbuild.
2021-09-07 17:52:43 +02:00
Renovate Bot
b78400aa18 build: update dependency @babel/core to v7.15.5 2021-09-04 13:58:06 +02:00
Renovate Bot
40ebaa035e build: update all non-major dependencies 2021-09-04 10:27:31 +02:00
Renovate Bot
7ab1cf3b29 build: update all non-major dependencies 2021-09-03 10:34:02 +02:00
Renovate Bot
7550ecbaf6 build: update all non-major dependencies 2021-09-02 18:25:48 +02:00
Alan Agius
c13cc888d0 build: update ng-packagr to version 13.0.0-next.1 2021-09-02 17:54:09 +02:00
Renovate Bot
93957e5e59 build: update all non-major dependencies 2021-09-01 07:45:33 +02:00
Renovate Bot
588285c386 build: update all non-major dependencies 2021-08-31 08:33:31 +02:00
Renovate Bot
f082868239 build: update dependency esbuild to v0.12.24 2021-08-28 08:30:23 +02:00