3417 Commits

Author SHA1 Message Date
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
Charles Lyding
c7d12910a9 refactor(@angular-devkit/build-angular): remove unneeded esbuild external packages workaround
Version 0.19 of esbuild added the ability to consider tsconfig path mappings when using the
external packages build option. This addition allows the Angular build system to remove a
resolve plugin that previously was used to workaround this limitation. Removal of the plugin
may also provide improved rebuild performance when used with the development server as many
of the JavaScript resolution attempts will no longer need to be handled by the now removed
plugin.
2023-08-14 10:57:41 +02:00
Alan Agius
f3229c44ad fix(@angular-devkit/build-angular): update vite to be able to serve app-shell and SSG pages
This commits, update the application builder and vite dev-server to be able to serve the app-shell and prerendered pages.
2023-08-14 10:57:13 +02:00
Charles Lyding
8b74a50e7b fix(@angular-devkit/build-angular): encode Sass package resolve directories in importer URLs
When using the new developer preview application build system, Sass import/use usage that specifies
a package is adjusted to contain the resolve directory to workaround Sass import plugin limitations.
This resolve directory is now encoded to prevent the new specifier from looking like a URL with a
scheme to the Sass compiler. This can occur on Windows when a drive letter is present (`C:\`).
2023-08-11 11:07:33 -07:00
Charles Lyding
a4dcfa98c1 refactor(@angular-devkit/build-angular): move TypeScript diagnostic conversion into compilation base
When using the esbuild-based browser application builder, TypeScript diagnostics are now converted
into esbuild messages within the compilation base class instead of the plugin. This helps further
isolate the TypeScript details within the compilation classes. Additionally, this provides diagnostic
objects that can be more easily serialized earlier in the build process.
2023-08-10 11:29:59 -07:00
Alan Agius
89e644b245 build: update all non-major dependencies
(cherry picked from commit 90f0b818a459ec288342364d364b3d24694b639f)
2023-08-10 11:06:45 -07:00
Alan Agius
4935172a10 fix(@angular-devkit/build-angular): display warning when using resourcesOutputPath with esbuild builder
`resourcesOutputPath` option is not supported when using the esbuild based builder.

Closes #25658
2023-08-10 10:49:13 -07:00
JoostK
54d2b02d26 refactor(@angular-devkit/build-angular): reduce source map resolution to word boundary
magic-string 0.30.2 introduced [the `boundary` strategy][1] for its high-resolution
source map mode, reducing the number of source map segments to align with word
boundaries instead of having a segment per character.

[1]: https://github.com/Rich-Harris/magic-string/pull/255
2023-08-09 09:11:18 -07:00
Ben McCann
e4b7c02a69 refactor(@angular-devkit/build-angular): prepare for Vite 5 2023-08-04 16:06:53 -04:00
aanchal
efeae1e1f1 docs: remove duplicate words 2023-08-04 14:49:14 -04:00
Charles Lyding
3a576574ae refactor(@angular-devkit/build-angular): restructure i18n extraction builder to allow for application builder support
The `extract-i18n` builder code has been restructured in a similar fashion to the `dev-server` builder.
This refactor provides the groundwork to add support for the `application` and `browser-esbuild` builders
during message extraction.
The webpack related logic has been split into a separate file and is dynamically imported when needed.
Additionally the options processing has been moved to a separate file and the `index.ts` now only exports
instead of previously containing most of the builder logic.
2023-08-04 14:48:37 -04:00
Joey Perrott
80b2c92750 build: update critters
Update to latest version of critters.
2023-08-04 09:36:18 -04:00
aanchal
b2a51d8db7 docs: omit repetitions 2023-08-03 14:07:59 -04:00