3140 Commits

Author SHA1 Message Date
Charles Lyding
00186fb93f feat(@angular-devkit/build-angular): add initial experimental esbuild-based application browser builder
An experimental browser application builder (`browser-esbuild`) has been introduced that leverages esbuild as the bundler.
This new builder is compatible with options of the current browser application builder (`browser`) and can be enabled
for experimentation purposes by replacing the `builder` field of `@angular-devkit/build-angular:browser` from an existing
project to `@angular-devkit/build-angular:browser-esbuild`. The builder will generate an ESM-based application and
provides support for ES2015+ compatible output with ES2020 as the default.

This builder is considered experimental and is not recommended for production applications.

Currently not all `browser` builder options and capabilities are supported with this experimental builder.
Additional support for these options may be added in the future.
The following options and capabilities are not currently supported:
* Stylesheet Preprocessors (only CSS styles are supported)
* Angular JIT mode (only AOT is supported)
* Localization [`localize`]
* Watch and dev-server modes [`watch`, `poll`, etc.]
* File replacements [`fileReplacements`]
* License text extraction [`extractLicenses`]
* Bundle budgets [`budgets`]
* Global scripts [`scripts`]
* Build stats JSON output [`statsJson`]
* Deploy URL [`deployURL`]
* CommonJS module warnings (no warnings will be generated for CommonJS package usage)
* Web Workers
* Service workers [`serviceWorker`, `ngswConfigPath`]
2022-04-22 20:45:54 -04:00
Charles Lyding
25498ad5b2 feat(@angular-devkit/schematics): re-export core string helpers from schematics package
The string helpers are predominantly used within schematics that will already depend and import from
the `@angular-devkit/schematics` package. By re-exporting from `@angular-devkit/schematics`, the need
to directly depend and import `@angular-devkit/core` within a schematic can be reduced and in many
cases eliminated.
2022-04-22 11:31:53 -04:00
Renovate Bot
d6ecb66f32 build: update all non-major dependencies 2022-04-20 11:19:24 -04:00
Daniil Dubrava
464cf330a1 feat(@angular-devkit/schematics): support null for options parameter from OptionTransform type 2022-04-18 09:38:31 +02:00
Charles Lyding
1a160dac00 fix(@angular-devkit/build-angular): ensure karma sourcemap support on Windows
The `glob`-based check when adding the sourcemap support packages to the karma setup was incorrectly
skipping the files due to Windows pathing issues. The `glob`-based check, however, is unneeded due
to the already present `require.resolve` checks for the sourcemap support packages which will
throw if the packages are not present.
2022-04-16 07:42:20 +02:00
Renovate Bot
41982aa286 build: update all non-major dependencies 2022-04-15 09:42:16 +02:00
Alan Agius
f74a79f7c8 refactor(@angular-devkit/core): remove no longer needed fast-json-stable-stringify dependency
This dependency is no longer needed.
2022-04-14 17:13:52 +02:00
Alan Agius
c0eb926121 refactor(@angular-devkit/core): remove custom json parser
With this change we replace the workspace reader and write to use `jsonc-parser` instead of our custom build JSON parser
2022-04-14 17:13:52 +02:00
Alan Agius
d270258dcd build: update dependency glob to v8 2022-04-14 16:50:08 +02:00
Alan Agius
108a0b6acd refactor(@angular-devkit/core): remove fast-json-stable-stringify usage in memoize helper
This is not needed as inputs are typed checked to be `JsonValue`. With this change we get a step closer to remove `fast-json-stable-stringify` dependency.
2022-04-13 12:08:07 -07:00
Renovate Bot
95954bba04 build: update all non-major dependencies 2022-04-12 10:37:05 -07:00
Alan Agius
be2b268c36 fix(@angular-devkit/build-angular): display debug logs when using the --verbose option
Webpack doesn't display debug logs when setting the log level to verbose.

See: https://webpack.js.org/configuration/other-options/#debug and https://webpack.js.org/configuration/other-options/#level
2022-04-11 11:47:09 -07:00
Alan Agius
3afd1ab9c0 fix(@angular-devkit/build-webpack): emit devserver setup errors
Closes #22969
2022-04-11 11:46:51 -07:00
Charles Lyding
9a5251cff9 refactor(@angular-devkit/schematics): provide schematic collection description to FileSystemEngineHost resolver
The `_resolveReferenceString` abstract method of the `FileSystemEngineHostBase` class now has a third parameter
that provides the collection description of the schematic currently being resolved. This allows the resolver to
use any fields/options present within the collection description to adjust the resolution of the schematic. The
`encapsulation` optional field is also added to the `FileSystemCollectionDescription` type which will in the future
allow control of the `@angular/cli` VM context wrapping on an individual schematic collection basis.
2022-04-11 11:45:43 -07:00
Renovate Bot
78b3537731 build: update all non-major dependencies 2022-04-08 10:10:14 -07:00
Alan Agius
a66cfd0c6d refactor(@angular-devkit/core): replace fast-json-stable-stringify import to es6 2022-04-08 09:37:22 -07:00
Renovate Bot
4b05c44d4f build: update all non-major dependencies 2022-04-06 13:00:39 -04:00
Alan Agius
67144b9e54 refactor(@angular-devkit/core): remove deprecated parseJson and ParseJsonOptions APIs
BREAKING CHANGE:

`parseJson` and `ParseJsonOptions` APIs have been removed in favor of 3rd party JSON parsers such as `jsonc-parser`.
2022-04-05 11:19:19 -04:00
Renovate Bot
5ebfe805ae build: update all non-major dependencies 2022-04-04 10:04:28 -04:00
Charles Lyding
b8e9e09a51 refactor(@angular-devkit/build-angular): replace most custom path normalize usage with Node.js builtins
During the build initialization phase, many paths are converted back and forth between multiple normalized forms. These conversions involve potentially expensive string operations. The majority of the custom path `normalize` function from `@angular-devkit/core` usages have now been removed in favor of the Node.js builtin path functions. This change reduces the need to perform additional string manipulation where possible.
2022-03-31 17:00:58 -04:00
Renovate Bot
dcc00f4e22 build: update all non-major dependencies 2022-03-31 16:32:49 -04:00
Alan Agius
5922649380 refactor(@angular-devkit/build-angular): replace try/catch block with catch
Since this is a promise the try/catch block will not catch promise rejections which was the reason for the try/catch block.
2022-03-30 20:45:35 +02:00
Alan Agius
371da23be0 fix(@angular-devkit/build-angular): add node_modules prefix to excludes RegExp
Without the `node_modules` prefix, projects named the same as the excluded package names ex: `webpack` will not compile successfully as all files under the mentioned project will be excluded from being requested by the respective loaders.

Closes #22902
2022-03-30 17:46:09 +02:00
Alan Agius
af8dd62b74 refactor(@angular-devkit/build-angular): remove esbuild-check workaround
This check is no longer needed as of `0.14.29` as now esbuild correctly propagates errors.

See: https://github.com/evanw/esbuild/blob/master/CHANGELOG.md#01429
2022-03-30 17:17:15 +02:00
Renovate Bot
6a6386a1ef build: update all non-major dependencies 2022-03-30 17:17:15 +02:00
Alan Agius
c5b3e92991 refactor(@angular-devkit/core): deprecate unused exception classes
With this change we deprecate exception classes that are not used in the CLI repo.

DEPRECATED:

- `ContentHasMutatedException`, `InvalidUpdateRecordException`, `UnimplementedException` and `MergeConflictException` symbol from `@angular-devkit/core` have been deprecated in favor of the  symbol from `@angular-devkit/schematics`.
- `UnsupportedPlatformException` - A custom error exception should be created instead.
2022-03-30 17:17:04 +02:00
Alan Agius
fac9cca66b fix(@angular-devkit/build-angular): don't override asset info when updating assets
Currently, we are overriding asset info instead of appending additional data to it.
2022-03-30 15:20:03 +02:00
Alan Agius
2ab77429bb fix(@angular-devkit/build-angular): allow Workers in Stackblitz
This is no longer needed as Stackblitz implemented the missing Node.Js worker APIs.
2022-03-29 13:35:13 +02:00
Renovate Bot
17a7fdcd68 build: update all non-major dependencies 2022-03-26 08:25:40 +01:00
Alan Agius
cea83b2289 build: update build_angular_test_lib to include all non builders spec files 2022-03-24 14:41:26 +01:00
Alan Agius
4b4cecf88f test: update tests to work with Jasmine version 4
These changes include fixes to tests, timeout and stop of architect to make tests work with Jasmine 4.

One noticeable change that when we didn't stop architect through `run.stop()` this causes Bazel to timeout now.

Example
```
-- Test timed out at 2022-03-24 12:07:07 UTC --
/private/var/tmp/_bazel_alanagius/5168427e57f204ca069c602aa7ed1931/sandbox/darwin-sandbox/398/execroot/angular_cli/bazel-out/darwin-fastbuild/bin/packages/angular_devkit/build_angular/build_angular_browser_test.sh.runfiles/angular_cli/packages/angular_devkit/build_angular/build_angular_browser_test.sh: line 424: 41835 Terminated: 15          "${node}" ${LAUNCHER_NODE_OPTIONS[@]+"${LAUNCHER_NODE_OPTIONS[@]}"} ${USER_NODE_OPTIONS[@]+"${USER_NODE_OPTIONS[@]}"} "${MAIN}" ${ARGS[@]+"${ARGS[@]}"} 0<&0
```
2022-03-24 14:41:26 +01:00
Renovate Bot
53771e18b5 build: update dependency @types/jasmine to v4 2022-03-24 14:18:44 +01:00
Alan Agius
56b44aba74 refactor(@angular-devkit/build-angular): remove types for @discoveryjs/json-ext
This package now ships TypeScript declaration files.
2022-03-24 08:53:24 +01:00
Alan Agius
455aeea12d fix(@angular-devkit/core): add Angular CLI major version as analytics dimension
With this change we replace the custom dimension 8 `AOT Enabled`, with `Angular CLI Major Version`. The motivation behind replacing this dimension is that the there is already an `aot` dimension with id 13 which serves for the same purpose.

More information to why we need a new dimension for the Angular CLI major version can be found #22130

Closes #22130
2022-03-24 08:53:10 +01:00
Renovate Bot
c315b47068 build: update all non-major dependencies 2022-03-23 12:59:21 -07:00
Charles Lyding
966d25b55e fix(@angular-devkit/build-angular): remove unneeded JIT reflect metadata polyfill
Since Angular 8, the CLI has transformed decorator metadata to a form that can be used by the Angular dependency injector without the TDZ limitations of Typescript's decorator metadata emit feature.
As a result, a JIT application compiled with the CLI no longer requires the reflect metadata polyfill that was provided by `core-js`.
This polyfill was also the last remaining usage of the `core-js` package within `@angular-devkit/build-angular` which allows the `core-js` package to also be removed.

Refs: https://github.com/angular/angular-cli/pull/14473 & https://github.com/angular/angular/pull/37382

BREAKING CHANGE: Reflect metadata polyfill is no longer automatically provided in JIT mode
Reflect metadata support is not required by Angular in JIT applications compiled by the CLI.
Applications built in AOT mode did not and will continue to not provide the polyfill.
For the majority of applications, the reflect metadata polyfill removal should have no effect.
However, if an application uses JIT mode and also uses the previously polyfilled reflect metadata JavaScript APIs, the polyfill will need to be manually added to the application after updating.
To replicate the previous behavior, the `core-js` package should be manually installed and the `import 'core-js/proposals/reflect-metadata';` statement should be added to the application's `polyfills.ts` file.
2022-03-23 12:58:55 -07:00
Alan Agius
861ec0f7d0 refactor(@angular-devkit/build-angular): lazy import inquirer
`inquirer` has a number of depedencies which slow down module resolution when importing (~138ms) by lazy loading this module we remove this overhead when prompts are not needed.
2022-03-23 12:58:35 -07:00
Paul Gschwendtner
0c344259dc fix(@ngtools/webpack): update peer dependency to reflect TS 4.6 support
Updates the peer dependency to reflect the TS 4.6 support, avoiding
warnings like:

```
warning "@angular-devkit/build-angular > @ngtools/webpack@14.0.0-next.6" has incorrect peer dependency "typescript@>=4.4.3 <4.6".

```
2022-03-23 12:58:17 -07:00
Alan Agius
c9c781c7d5 feat(@angular-devkit/schematics): add parameter to listSchematicNames to allow returning hidden schematics.
The return value of `listSchematicNames` will include hidden schematics when is invoked with true as first parameter.

By default, hidden schematics are not returned.
2022-03-22 09:37:57 -07:00
Renovate Bot
e5a7bb17d8 build: update all non-major dependencies 2022-03-21 12:28:37 -07:00
Tobias Speicher
137651645c refactor: replace deprecated String.prototype.substr()
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
2022-03-21 12:27:52 -07:00
Renovate Bot
becd7b6ed9 build: update all non-major dependencies 2022-03-18 11:45:03 -07:00
Renovate Bot
1a36fd94a8 build: update all non-major dependencies 2022-03-16 14:15:50 -04:00
Alan Agius
b8564a638d refactor(@angular-devkit/build-angular): remove deprecated NG_BUILD_CACHE environment variable
BREAKING CHANGE:

`NG_BUILD_CACHE` environment variable has been removed. `cli.cache` in the workspace configuration should be used instead.
2022-03-15 16:30:35 -04:00
Renovate Bot
455c6bc679 build: update dependency cacache to v16 2022-03-15 12:17:23 -04:00
Renovate Bot
9c8b3a16f6 build: update all non-major dependencies 2022-03-15 11:06:45 -04:00
Renovate Bot
e873cd1050 build: update all non-major dependencies 2022-03-14 10:07:40 -04:00
Alan Agius
9ddb220c3d docs: replace app with application 2022-03-14 10:03:06 -04:00
Alan Agius
7fa3e65879 feat(@angular/cli): support TypeScript 4.6.2
BREAKING CHANGE:

Support for TypeScript 4.4 and 4.5 has been removed. Please update to TypeScript 4.6.
2022-03-10 15:36:19 -05:00
Renovate Bot
8673e3d36b build: update all non-major dependencies 2022-03-09 17:43:38 +01:00