3109 Commits

Author SHA1 Message Date
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
Angular Robot
6c5c71103f build: update all non-major dependencies 2023-08-03 12:36:35 -04:00
Bram Gotink
df4d358f33 fix(@angular-devkit/build-angular): prevent race condition in setting up sass worker pool 2023-08-03 12:09:00 -04:00
Charles Lyding
96ff17b4d1 ci: reduce bazel test shards for browser builder test
Reduce the number of test shards for the browser builder from 50 to 10.
50 is more than needed and can cause excessive resource usage.
2023-08-03 10:13:24 -04:00
JounQin
6539bb5200 fix(@angular-devkit/build-angular): hot update filename suffix with .mjs 2023-07-28 11:18:16 -04:00
Angular Robot
258e82b16f build: update all non-major dependencies 2023-07-26 14:40:39 -04:00
Angular Robot
373402f68e build: update dependency tslib to v2.6.1 2023-07-26 09:49:41 -04:00
Kristiyan Kostadinov
d6ae2c7b7a fix(@angular-devkit/build-angular): error during critical CSS inlining for external stylesheets
These changes revert the performance improvement from e88aea65bd and add a test. The problem with the previous approach is that it assumes that a `link` tag processed by Critters will be preceded by a `style` tag that was inserted by Critters. This assumption might not necessarily be true if Critters is unable to resolve the content of the linked styles. Furthermore, I'm not sure if we need to optimize this code path to begin with, because it only does a shallow traversal of the `head` tag which is generally fast and is unlikely to have many direct descendants.

Fixes #25419.
2023-07-26 09:47:22 -04:00
Charles Lyding
449e21b3a6 fix(@angular-devkit/build-angular): correctly load dev server assets with vite 4.4.0+
The underlying development server (Vite) for the application build system updated
its static file serving dependencies which resulted in the `@fs` special file URLs
supported by Vite to have a different format.  Previously, the paths were encoded
using `encodeURIComponent` but are now use `encodeURI`. The development server
integration with Vite will now use the matching encoding to allow build defined
assets to be correctly served.
2023-07-24 20:41:22 -04:00