64 Commits

Author SHA1 Message Date
Alan Agius
8095268fa4 build: update to rxjs 7
G3 is now using RXJS version 7 which makes it possible for the CLI to also be updated to RXJS 7.

NB: this change does not remove all usages of the deprecated APIs.

Closes #24371
2023-02-16 14:59:40 +00:00
Alan Agius
124be1cc9c refactor: add build and rebuild related statistics and analytics
The new build and rebuild statistics are used by the CLI to submit build related information to GA.
2022-10-11 18:52:30 +02:00
Charles Lyding
3c4ca3fa7f refactor(@angular-devkit/build-webpack): assert catch clause variable type before usage
Prepares the `@angular-devkit/build-webpack` package for the eventual change of enabling the
TypeScript `useUnknownInCatchVariables` option. This option provides additional
code safety by ensuring that the catch clause variable is the proper type before
attempting to access its properties. Similar changes will be needed in the other
packages in the repository prior to enabling `useUnknownInCatchVariables`.
2022-06-14 11:28:21 +02:00
Alan Agius
3afd1ab9c0 fix(@angular-devkit/build-webpack): emit devserver setup errors
Closes #22969
2022-04-11 11:46:51 -07:00
Alan Agius
cb73c0b4ae fix(@angular-devkit/build-webpack): correctly handle ESM webpack configurations
Previoiusly, we didn't correctly handle ESM configurations as the `import` was always downlevelled to `require` by TypeScript.

Closes #22547
2022-01-24 20:33:21 +01:00
Alan Agius
e9684b2fd2 build: update all non-major dependencies 2022-01-24 12:54:31 +01:00
Alan Agius
2b789b3ad0 refactor: remove @types/webpack-dev-server
This package is no longer needed since `webpack-dev-server` now has it's own typings.
2022-01-10 11:32:40 -08:00
Charles Lyding
0780e63c2d refactor(@angular-devkit/build-webpack): reduce complexity of get emitted files helper function
The deduplication logic is now inline with the chunk and asset iteration and is checked via a Set instead of a follow-up step.
2021-10-19 10:09:10 -04:00
Alan Agius
537e3a1944 refactor(@angular-devkit/build-webpack): port 0 WEBPACK_DEV_SERVER_BASE_PORT workaround
No longer needed due to change in webpack-dev-server. See: ed67f66fc4/lib/Server.js (L77-L79)
2021-09-28 05:48:28 -04:00
Alan Agius
9efcb32e37 fix(@angular-devkit/build-webpack): better handle concurrent dev-servers
Webpack-dev-server doesn't handle concurrency very well. When using port 0, and 2 processes start at the same time, they end up being given the same port. The main reason for the issue is that it find a free port, put only uses at a later stage.
2021-09-21 16:07:30 +02:00
Alan Agius
a0b5897d50 feat(@angular-devkit/build-webpack): update webpack-dev-server to version 4
BREAKING CHANGE:

Support for `webpack-dev-server` version 3 has been removed. For more information about the migration please see: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md

Note: this change only affects users depending on `@angular-devkit/build-webpack` directly.
2021-08-27 15:40:10 +02:00
Alan Agius
6153530220 fix(@angular-devkit/build-webpack): emit result when webpack is closed
With this change we emit the compilation result when the compilation is closed, when the compilation is not in watch mode.

This is needed so that when persistent caching is enabled and architect promise API is used (`.result`) instead of `.output` we wait for the cache to be written prior to terminating the process/resolving the result promise.

The `result` API currently, takes the first emit 4f9df9f4a4/packages/angular_devkit/architect/src/schedule-by-name.ts (L118-L120)

Closes #21419
2021-07-27 12:15:02 -04:00
Charles Lyding
b3d7080147 build: enable esModuleInterop TypeScript option
The `esModuleInterop` option is recommended to be enable by TypeScript and corrects several assumptions TypeScript would otherwise make when importing CommonJS files.
This option change helps ensure compatibility as packages move towards ESM.
Reference: https://www.typescriptlang.org/tsconfig#esModuleInterop
2021-06-13 11:45:55 -04:00
Alan Agius
023d0937c4 perf(@angular-devkit/build-webpack): include only required stats in webpackStats
Until we depend on `webpackStats` in the browser builder we should only included the required stats.

The below are the needed stats;
```
    all: false,
    colors: true,
    hash: true,
    timings: true,
    chunks: true,
    builtAt: true,
    warnings: true,
    errors: true,
    assets: true,
    ids: true,
    entrypoints: true,
```
2021-06-02 18:25:58 +02:00
Alan Agius
e992c9a70b build: update files to be fix eslint header/header failures 2021-05-04 09:59:40 -04:00
Charles Lyding
c1512e4274 build: update files to be eslint compliant
All TypeScript files have been updated to pass the new eslint-based linting checks. eslint compatible disabling comments have also been added in place of the previous tslint comments.
2021-05-03 07:31:02 -04:00
Charles Lyding
37a06a7c37 build: format all files
All files are now formatted using the ng-dev tools via prettier.
2021-04-28 16:05:49 -07:00
Joey Perrott
003854257c build: migrate all file header to use Google LLC rather than Google Inc 2021-04-27 08:35:22 +02:00
Alan Agius
076ab0f11f refactor: add correct schema keys
With this change
- We replace `id` with `$id`,  this no longer valid in draft-07.
- Replace all `$schemas` to `http://json-schema.org/draft-07/schema`, this is needed to "pin" the schema to `draft-07`.

More information about `draft-07` can be found https://json-schema.org/draft-07/json-schema-release-notes.html
2021-04-13 10:51:12 -04:00
Alan Agius
dee6b79489 refactor: remove @types/webpack 2021-04-12 10:02:07 -04:00
Alan Agius
0f4bbb58d4 refactor(@angular-devkit/build-angular): remove webpack 4 checks
These are no longer needed as we don't support Webpack 4 any longer
2021-04-12 10:02:07 -04:00
Charles Lyding
18c9541292 feat(@angular-devkit/build-webpack): support Webpack 5
The `@angular-devkit/build-webpack` package now officially supports Webpack 5.
Webpack 4 support is temporarily maintained while the remainder of the tooling is transitioned.
2021-04-08 09:42:47 -04:00
Charles Lyding
4804cb819d refactor(@angular-devkit/build-webpack): move @angular-devkit/core to a dev dependency
The package's `@angular-devkit/core` dependency is only used in non-test code to provide a single type which is no longer needed with the latest architect.
2021-04-02 08:09:29 +02:00
Charles Lyding
ff32ada86b feat(@angular-devkit/build-webpack): provide output path in builder results
This change adds the output path for the Webpack build directly to the result of the builder. This removes one of the reasons for using the Webpack JSON stats object which is expensive to generate.
2021-03-15 17:45:11 +01:00
Alan Agius
aedfcc1862 build: update to @types/node version 12 2021-02-08 14:07:24 -05:00
Charles Lyding
0d439a0253 feat(@angular-devkit/build-webpack): add option for webpack stats output presence
The Webpack `Stats.toJson` function can be expensive.  A new programmatic option is now available (`shouldProvideStats`) which can be used to control whether the `webpackStats` property on the builder output object is present.  For backwards compatibility, the option is currently enabled by default.
2020-12-03 07:15:12 -05:00
Charles Lyding
d5348bd191 fix(@angular-devkit/build-webpack): properly shutdown webpack 5 compilation
This change ensures that the compiler instance is used when closing the compiler.
2020-11-18 13:09:00 -05:00
Charles Lyding
e4a3138395 refactor(@angular-devkit/build-webpack): reduce configuration path processing 2020-10-22 15:17:06 -04:00
Charles Lyding
dc3cdae7b9 fix(@angular-devkit/build-webpack): fully close Webpack 5 compiler
The Webpack 5 compiler now contains a close function that should be called when the compiler is finished.
2020-10-22 15:17:06 -04:00
Charles Lyding
1c61ced55c fix(@angular-devkit/build-webpack): avoid deprecation warning with Webpack 5 watch mode
With Webpack 5, passing the watch configuration option into the `webpack` factory function will cause the Webpack compiler to assume it should immediately start watching which requires a callback to be passed as well.  Since the execution of the compiler is handled later in the process, a callback at the compiler creation stage is undesirable and could result in potentially breaking changes to accomplish.
2020-09-30 19:39:47 +02:00
Charles Lyding
f6d9e858e5 refactor(@angular-devkit/build-webpack): adjust callback type to support webpack 5 2020-09-03 00:20:54 +03:00
Charles Lyding
95b3384bb6 refactor(@angular-devkit/build-webpack): cleanup type usage
This change removes some unneeded casts and provides support for building against Webpack 5.  Webpack 5 typings currently do not contain certain types (for example, `Compiler.Handler`).  Webpack 5 also uses `Set` in many places instead of arrays.
2020-08-12 19:27:00 +01:00
Filipe Silva
fe280b25f2 test(@angular-devkit/build-webpack): build and test with Bazel 2020-04-30 15:12:46 -07:00
Charles Lyding
53e1ef0210 fix(@angular-devkit/build-webpack): correct webpack typings issue 2020-01-04 11:17:51 -08:00
Charles Lyding
453f33fd57 refactor(@angular-devkit/build-webpack): remove unused webpack architect plugin 2020-01-04 11:17:51 -08:00
Alan Agius
d155c7c804 fix(@angular-devkit/build-webpack): allow runWebpackDevServer to accept a webpackDevServerFactory 2019-12-02 10:16:08 -08:00
Charles Lyding
9f5c0f3c51 refactor(@angular-devkit/build-webpack): allow a webpack factory to be used directly 2019-11-15 10:41:01 -08:00
Alan Agius
a1cf5f5b1e fix(@angular-devkit/build-webpack): proxy config with windows authentication
It seems that this is causing issues with proxy config and IIS with Windows authentication, for now we remove the `ArchitectPlugin` since it's not being used.

Fixes #14595
2019-10-14 13:41:34 -07:00
Charles Lyding
1930bd5845 fix(@angular-devkit/build-webpack): provide more complete compilation stats 2019-09-26 10:00:35 -07:00
Charles
4986577f8a fix(@angular-devkit/build-angular): skip downlevel processing of assets (#15433)
* fix(@angular-devkit/build-angular): identify asset emitted files

* fix(@angular-devkit/build-angular): skip downlevel processing of assets

Fixes #15423
2019-08-26 11:50:20 -07:00
Charles
3db2787cea refactor(@angular-devkit/build-angular): update webpack typings (#15334) 2019-08-14 10:22:32 -07:00
Charles Lyding
991599c0ca test(@angular-devkit/build-webpack): use stable workspace API 2019-06-18 18:25:40 -07:00
Alan Agius
7cc0988d4c fix(@angular-devkit/build-webpack): consider name when deduping emitted files
We need to consider the name when deduping files because a file such as `runtime.js` can be under multiples names because this file is a dependency of multiple entrypoints
2019-04-15 11:03:09 -07:00
Alan Agius
55863a5644 feat(@angular-devkit/build-webpack): include entrypoints in emitted files
Entrypoints might have other files associate with them such as runtime.js, it is is paramount to keep the relation between them especially when this result is needed to generate an index file
2019-04-10 08:34:33 -07:00
Alan Agius
6dac8186f3 fix(@angular-devkit/build-webpack): add dot to file extension in emitted files 2019-04-10 08:34:33 -07:00
Charles Lyding
87b04063dd refactor(@angular-devkit/build-webpack): cleanup architect imports 2019-04-03 16:28:25 +02:00
Charles Lyding
bf0fcf39e0 refactor(@angular-devkit/build-webpack): cleanup stable architect API file names 2019-04-02 04:50:08 -07:00
Charles Lyding
1cca4589d1 refactor(@angular-devkit/build-webpack): remove experimental architect builders 2019-04-02 04:50:08 -07:00
Alan Agius
54a6bee7c5 feat(@angular-devkit/build-webpack): report emitted files
With this change the builder will report the emitted chunks and assets after the compilation, this is needed for deferential loading so that we can build an index from the outputs of multiple builds
2019-03-22 07:11:20 -07:00
Hans Larsen
4bfb29704f refactor(@angular-devkit/build-webpack): rename BuildResult to BuildOutput
Stays consistent across builders. This is the interface of the output provided by the
webpack dev server.
2019-03-13 13:51:22 -07:00