3029 Commits

Author SHA1 Message Date
cexbrayat
4e89c3cae4 fix(@angular-devkit/build-angular): use a dash in bundle names
This updates the esbuild based builder to use a dash in bundles and media instead of a dot to be consistent with the chunks files `chunk-xxx.js`.
2023-09-21 10:58:48 +02:00
Alan Agius
f9fdd0907c refactor(@angular-devkit/build-angular): use ɵloadChildren helper from router package
This commit updates the routes extractor to use the newly exported private `ɵloadChildren` method from the router to executes a `route.loadChildren` callback and return an array of child routes.

See: https://github.com/angular/angular/pull/51818
2023-09-21 07:02:17 +02:00
Alan Agius
1c00fd3fe9 refactor: drop support for older TypeScript versions
Drops support for versions of TypeScript older than 5.2

BREAKING CHANGE:
Versions of TypeScript older than 5.2 are no longer supported.
2023-09-20 21:27:35 +02:00
Alan Agius
c0eb2eb5fd build: update Angular to 17.0.0-next.5 2023-09-20 21:27:35 +02:00
cexbrayat
fe64193b78 refactor(@angular-devkit/build-angular): typo in ignore list plugin function 2023-09-20 19:48:55 +02:00
Alan Agius
8168ae2a89 feat(@angular-devkit/build-angular): apply global CSS updates without a live-reload when using vite
This commit changes the way that global style updates are applied when using `vite`.  When either live-reload or hmr are enabled the styles are replaced in placed (HMR style) without a live-reload.
2023-09-20 15:49:56 +02:00
Alan Agius
8f9a0d70cd feat(@angular-devkit/build-angular): support standalone apps route discovery during prerendering
This fixes an issue were routes could not be discovered automatically in a standalone application.

This is a total overhaul of the route extraction process as instead of using `guess-parser` NPM package, we now use the Angular Router. This enables a number of exciting possibilities for the future which were not possible before.

# How it works?
The application is bootstrapped and through DI injection we get the injector and router config instance and recursively build the routes tree.
2023-09-18 22:26:06 +02:00
Alan Agius
5a204b81c7 refactor(@angular-devkit/build-angular): accept boolean and string in ssr option
This is to align with the `serviceWorker` option.
2023-09-15 22:12:34 +02:00
Charles Lyding
b07ba1a90c refactor(@angular-devkit/build-angular): remove usage of terser constants in esbuild
The terser build time constant import from the `@angular/compiler-cli` package is no
longer used in the esbuild-based builder. The constants present are already defined
and conditionally added within the build configuration itself. This not only provides
more flexibility but also removes the need to import the package early in the process.
The import is also an expensive import due to it needing TypeScript and being ESM that
needs to be dynamically imported via a function helper to work around current ESM/TypeScript/CommonJS
limitations.
2023-09-14 21:59:56 +02:00
Alan Agius
48963fc17f fix(@angular-devkit/build-angular): several windows fixes to application builder prerendering
This commit fixes several Windows issues in the prerendering pipeline. Primarily due to path normalization and other Windows only constraints.
2023-09-14 17:25:30 +02:00
Angular Robot
5441d78ffa build: update all non-major dependencies 2023-09-14 10:56:09 +02:00
Alan Agius
c8909406a5 fix(@angular-devkit/build-angular): correctly re-point RXJS to ESM on Windows
Previously, the path matching and replacement did not consider non posix file systems like windows.
2023-09-14 10:53:38 +02:00
Alan Agius
a35ec17dee refactor(@angular-devkit/build-angular): remove experimental warning when using esbuild based builder
This is no longer experimental.
2023-09-13 17:40:50 +02:00
Alan Agius
e41e2015bf fix(@angular-devkit/build-angular): avoid spawning workers when there are no routes to prerender
This commit fixes an issue were previously we spawned piscina with `maxThreads` set to `0` which causes it to exit with a non zero error code when there are no routes to prerender.

Now, in the application builder we exit at n earlier stage if there are no routes to prerender.
2023-09-13 17:40:50 +02:00
Alan Agius
3f8aa9d8c7 feat(@schematics/angular): update ng new to use the esbuild application builder based builder
This commit updates the `ng generate application` to use the esbuild `application` builder. This also updates the schematics to support both `browser` and `application` builders.

BREAKING CHANGE: `rootModuleClassName`, `rootModuleFileName` and `main` options have been removed from the public `pwa` and `app-shell` schematics.
2023-09-13 17:40:50 +02:00
Alan Agius
7632bafe72 refactor(@angular-devkit/build-angular): remove deep import of zone.js/node
This is no longer needed as `zone.js` now has proper package exports.
2023-09-13 16:23:22 +02:00
Alan Agius
71424e1c93 build: update https-proxy-agent to version 7.0.2
This commit updates `https-proxy-agent` to version 7+
2023-09-13 16:23:08 +02:00
Kristiyan Kostadinov
2f299fc7b5 fix(@angular-devkit/build-angular): account for styles specified as string literals and styleUrl
An upcoming change in Angular will allow `style` specified as strings, in addition to a new `styleUrl` property. These changes update the JIT resource transform to support the change.
2023-09-13 09:33:50 +02:00
Angular Robot
271edea6de build: update all non-major dependencies 2023-09-13 09:33:17 +02:00
Charles Lyding
b4a12a9264 refactor(@angular-devkit/build-angular): update babel package usage and types based on current versions
Newer versions of the babel packages allow for removing some types packages as well as some helper
packages. The `@babel/template` package export used within the CLI is accessible from the `@babel/core`
package which allows removal of `@babel/template` as a direct dependency. Also, the `@babel/plugin-proposal-async-generator-functions`
package has been transitioned to `@babel/plugin-transform-async-generator-functions` due to async generators
being merged into the ECMAScript standard. Minor code cleanup based on the type cleanup was also performed
in the build optimizer babel passes.
2023-09-11 20:15:15 +02:00
Alex Castle
f437545705 feat(@ngtools/webpack): add automated preconnects for image domains
use TypeScript AST to find image domains and add preconnects to generated index.html
2023-09-11 20:12:43 +02:00
Charles Lyding
7d3fd226c5 fix(@angular-devkit/build-angular): support dev server proxy pathRewrite field in Vite-based server
The development server proxy configuration file for Webpack supports a `pathRewrite` field that is
not directly supported by the underlying Vite development server when using the application or esbuild-
browser builders. To provide equivalent support, especially for JSON file-based proxy configurations,
the `pathRewrite` field is now converted internally to a proxy `rewrite` function.
2023-09-11 09:18:53 +02:00
Charles Lyding
c11a0f0d36 fix(@angular-devkit/build-angular): support custom index option paths in Vite-based dev server
When using the Vite-based development server and a custom `index` build option (not `index.html`),
the custom index path will now be used as the root of the development server. This mimics the behavior
of the Webpack-based development server.
2023-09-11 08:25:17 +02:00
Angular Robot
7176bfdeb8 build: update all non-major dependencies 2023-09-08 10:20:47 -07:00
Kristiyan Kostadinov
0ba845c177 build: update to TypeScript 5.2
Updates the repo to TypeScript 5.2.
2023-09-08 10:20:17 -07:00
Charles Lyding
0811f641b3 build: update package output to use ES2022
The JavaScript generated for the published packages is now using ES2022.
This removes additional downleveling of code that was previously necessary
to use newer features.
The minimum Node.js version of 18.13 provides support for the needed features.
While this change does require a patch to `@bazel/concatjs` to allow the target
to be set to `ES2022`, this patch is now already required by the migration of
the universal repository into the CLI repository.
2023-09-08 10:19:37 -07:00
Charles Lyding
4b67d2afd3 perf(@angular-devkit/build-angular): use single JS transformer instance during dev-server prebundling
By setting up a single instance of the `JavaTransformer`, the Vite-based development server will now
have a fixed and controllable number of worker threads available to process prebundling requests. This
avoids a potentially large number of initial worker threads when a new application with a large number
of dependencies is first used with the development server. This is particularly beneficial for web
container setups which may not be able to efficiently handle the number of workers.
2023-09-08 10:19:24 -07:00
Alan Agius
b3b478798e docs: update statsJson application builder description
The description was outdated.
2023-09-08 12:39:27 +02:00
Alan Agius
7e726ebb5d refactor(@angular-devkit/build-angular): update polyfills option in application and jest builder to be only an array.
This commit updates the polyfills options in application and jest builder to support only an array of string as value.
2023-09-06 16:02:53 +02:00
Angular Robot
d44527b28d build: update all non-major dependencies 2023-09-05 10:06:30 -07:00
Kristiyan Kostadinov
188a00f3e4 fix(@angular-devkit/build-angular): elide setClassMetadataAsync calls
Updates the logic that elides `setClassMetadata` calls to also elide `setClassMetadataAsync`. The latter will be emitted when the component uses the new `defer` block syntax.
2023-09-05 10:03:04 -07:00
Kristiyan Kostadinov
6b08efa6ff fix(@angular-devkit/build-angular): account for arrow function IIFE
Updates the logic for removing Angular metadata and pure top-level functions to account for arrow-function-based IIFEs. Currently Angular doesn't generate arrow functions, but it's being explored in https://github.com/angular/angular/pull/51637.
2023-09-05 10:03:04 -07:00
Angular Robot
04f61aa7ef build: update all non-major dependencies 2023-08-31 09:04:29 +02:00
Charles Lyding
1dcff01fcd refactor(@angular-devkit/build-angular): normalize i18n options for application builder
The esbuild-based application builder will now access the project level i18n configuration
as well as the builder `localize`, `duplicateTranslationBehavior`, and `missingTranslationBehavior`
options to construct a full, normalized i18n option structure.
These options are not yet used by the builder but they are now available to access as future
work incrementally adds i18n support.
2023-08-31 07:29:25 +02:00
Alan Agius
2702419364 build: update peer Angular peer deps
This is needed to satisfy the pre-release checks.
2023-08-30 18:28:18 +02:00
Alan Agius
cdcc8586a0 refactor(@angular-devkit/build-angular): remove disabling certificate validation when inlining fonts
Disabling certificate validation is strongly discouraged and is not required for inling of fonts.

Addresses https://github.com/angular/angular-cli/security/code-scanning/29
Closes #25731
2023-08-30 17:02:29 +02:00
Alan Agius
f917b67e75 refactor: remove polynomial regular expression
This change updates the critical css processor to remove the need for a Polynomial regular expression.

Addresses: https://github.com/angular/angular-cli/security/code-scanning/51
Closes #25742
2023-08-30 17:02:10 +02:00
Alan Agius
c30e3692b3 refactor(@angular/ssr): remove express engine
This removes the util function for express, instead the "CommonEngine" is called directly infuture before this package is final we might rename the "CommonEngine" to something else.
2023-08-30 09:53:57 +02:00
Angular Robot
683f84dc13 build: update all non-major dependencies 2023-08-30 09:08:28 +02:00
Angular Robot
d90f2f6047 build: update all non-major dependencies 2023-08-29 05:10:59 -07:00
Alan Agius
dfc80adb58 build: update ng-packagr version to v17 prerelease
Update package to support version 17.
2023-08-29 03:53:23 -07:00
Angular Robot
e36cbd020f build: update dependency tslib to v2.6.2 2023-08-29 00:40:09 -07:00
Olivier Combe
7970c3f25e fix(@angular-devkit/build-angular): use correct type for extraEntryPoints 2023-08-29 00:39:30 -07:00
Charles Lyding
7d006cb3a7 build: update Angular version to v17 prerelease
Package dependency versions and the version used to generate a new project have been updated to use `17.0.0-next.1`.
2023-08-29 00:38:37 -07:00
Alan Agius
3fe432c71b refactor: update code to integrate universal repo
This commit updates the moved universal code into the cli pipeline
2023-08-22 20:44:53 +00:00
Alan Agius
8fe8cdf05a refactor: move universal code into CLI repo
Merge remote-tracking branch 'universal/move-to-cli' into universal-merge
2023-08-16 11:34:47 +00:00
Alan Agius
e6ce7f8414 refactor: prepare code for CLI move 2023-08-16 09:55:58 +00:00
Charles Lyding
3c0719bde2 feat(@angular-devkit/build-angular): initial i18n extraction support for application builder
The `ng extract-i18n` command now supports using either the developer preview esbuild-based browser
or application builders. Support for the existing Webpack-based build system has been maintained.
The extraction process will now build the application based on the build target defined builder in
the case of either `@angular-devkit/build-angular:browser-esbuild` and `@angular-devkit/build-angular:application`.
In the case of the application builder, SSR output code generation is disabled to prevent duplicate messages
for the same underlying source code.
2023-08-14 18:16:08 +02:00
Angular Robot
a60749f3c2 build: update all non-major dependencies 2023-08-14 10:58:07 +02:00
Charles Lyding
5bf7022c47 fix(@angular-devkit/build-angular): remove support for Node.js v16
BREAKING CHANGE: Node.js v16 support has been removed

Node.js v16 is planned to be End-of-Life on 2023-09-11. Angular will stop supporting Node.js v16 in Angular v17.
For Node.js release schedule details, please see: https://github.com/nodejs/release#release-schedule
2023-08-14 10:57:54 +02:00