3464 Commits

Author SHA1 Message Date
Angular Robot
aea9ea6a98 build: update all non-major dependencies 2024-04-10 10:52:06 +02:00
Alan Agius
203c0eeb35 build: update all non-major dependencies 2024-04-08 10:10:09 -04:00
Alan Agius
afa76bb361 fix(@angular-devkit/build-angular): ensure esbuild-based builders exclusively produce ESM output
Previously, there were instances where the ESbuilder might incorrectly generate CJS code, leading to runtime errors.

Fixes #27421
2024-04-08 15:56:29 +02:00
Angular Robot
84e4a81b48 build: update dependency css-loader to v7 2024-04-06 15:47:24 +02:00
Angular Robot
c0e68e86d4 build: update all non-major dependencies 2024-04-03 13:31:18 -07:00
Angular Robot
fe19259aac build: update all non-major dependencies 2024-04-02 15:26:58 -07:00
Alan Agius
a673baf5ce Revert "fix(@schematics/angular): rename SSR port env variable"
This reverts commit 950a44521fdfb82000f6564ccc4c87d4a2b94680.
2024-04-02 11:51:45 -07:00
Angular Robot
3860fb3e42 build: update all non-major dependencies
(cherry picked from commit 7da0965ce3856cfc99158db8510ae339d3dc8fad)
2024-04-02 10:07:07 -07:00
Charles Lyding
83b943a74b refactor(@angular-devkit/build-angular): use single search directory list for postcss/tailwind configuration setup
Both the postcss and tailwind configuration file searching during the `application` builder setup look
in the project and workspace root for one of the related configuration files. To avoid unneeded
repeat file access, both searches now reuse directory contents information.
2024-04-02 09:17:34 -07:00
Charles Lyding
b87b843a1e refactor(@angular-devkit/build-angular): remove unneeded package version from inline font cache key
Since the calculated cache path already contains the `@angular-devkit/build-angular` package version,
the version is not needed within the cache key for each font URL. This removes the need to import the
loaded version from the `package.json` in the font inline logic.
2024-03-28 13:17:11 -07:00
Charles Lyding
e308008df0 refactor(@angular-devkit/build-angular): use build version stamping for build cache path creation
The build process will automatically perform package version placeholder replacement within
source files. This allows for the package version to be injected into the build cache path
creation process as a constant. As the version is now a constant, there is no need to
attempt runtime loading of the package metadata to retrieve the package version.
2024-03-28 13:16:12 -07:00
Kristiyan Kostadinov
8442216005 build: narrow down supported TypeScript versions
In https://github.com/angular/angular/pull/54961 the Angular compiler stopped supporting TypeScript versions older than 5.4. These changes narrow down the range for Tooling.
2024-03-27 12:48:24 +01:00
Charles Lyding
b454690622 refactor(@angular-devkit/build-angular): update babel application preset with new plugin import location
The babel application preset that is used with the Webpack-based build system now also uses the
updated location for the build optimizer plugins. This also reduces the amount of require statements
in the setup function for the preset.
2024-03-26 12:14:21 -04:00
Alan Agius
6530aa11be feat(@schematics/angular): replace assets with public directory
The `assets` directory is confusing for the users and commonly users place "assets" which are not meant to be copied but instead processed by the build system. This causes some files both bundled and copied.

With this change we rename the `assets` directory to `public` and also move the `favicon.ico` inside this newly created directory.
2024-03-25 17:10:29 +01:00
Alan Agius
e22d6771da fix(@angular-devkit/build-angular): ensure proper resolution of linked SCSS files
This commit addresses a bug where SCSS files within linked directories were not being resolved correctly by the Angular CLI. By implementing the necessary adjustments, linked SCSS files are now properly resolved.

Closes #27353
2024-03-25 13:36:15 +01:00
Alan Agius
c71e954a25 fix(@angular-devkit/build-angular): service-worker references non-existent named index output
This commit addresses an issue where the service worker incorrectly referenced a non-existent `index.html` when utilizing the output index option. Additionally, it ensures proper resolution of the service worker configuration when the option value is set to `true`.
2024-03-25 13:34:50 +01:00
Angular Robot
c27440e607 build: update all non-major dependencies 2024-03-25 10:38:53 +01:00
Charles Lyding
2fc8076a4b refactor(@angular-devkit/build-angular): directly configure internal babel plugins for application builder
The linker and build optimizer related babel plugins are now directly imported when needed
within the JavaScript transformer worker code. This lowers the number of transitive
modules that must be loaded for each worker instance. It also removes the use of `require`
from the initialization code which provides support for full ESM output in the future.
2024-03-22 15:21:33 -04:00
Paweł Kubiak
950a44521f fix(@schematics/angular): rename SSR port env variable
Rename the SSR port env variable to SSR_PORT.
It could help to resolve this firebase issue: https://github.com/firebase/firebase-tools/issues/6651#issuecomment-1881647322, cause PORT is reserved environment variable: https://firebase.google.com/docs/functions/config-env?gen=2nd#reserved-names.
2024-03-22 13:23:31 -04:00
Angular Robot
55d38e29a6 build: update all non-major dependencies 2024-03-21 11:35:22 -04:00
Alan Agius
ee9ec2301f fix(@angular-devkit/build-angular): Internal server error: Invalid URL when using a non localhost IP
When using a non-localhost IP, Vite will correctly populate the `network` property of the `server.resolvedUrls` instead of `local`.

Example:
```
ng server --host=127.0.0.2
{ local: [], network: [ 'http://127.0.0.2:4200/' ] }
```

Closes #27327
2024-03-21 10:30:42 -04:00
Alan Agius
d1367a021d refactor(@angular-devkit/build-angular): update vite client code update script
In the latest version of vite the script changed.
2024-03-21 09:30:08 -04:00
Alan Agius
0b8f53bc5f build: update all non-major dependencies 2024-03-21 09:30:08 -04:00
Alan Agius
8a54875cbb fix(@angular-devkit/build-angular): handle wrapping of class expressions emitted by esbuild
This update modifies the 'adjust-static-class-members' Babel plugin to accommodate the wrapping of class expressions produced by esbuild. This adjustment becomes necessary as ng-packagr currently utilizes esbuild for bundling FESM.
2024-03-20 14:51:36 +01:00
Alan Agius
6d0ebdb018 fix(@angular-devkit/build-angular): only generate server directory when SSR is enabled
Previously, the `server` directory was erroneously generated even in instances where SSG was enabled but SSR remained inactive.
2024-03-19 10:09:01 -04:00
cexbrayat
7fdaf847ec fix(@angular-devkit/build-angular): typo in allowedHosts warning for unsupported vite options 2024-03-19 10:08:31 -04:00
Angular Robot
68bdc94bf1 build: update all non-major dependencies 2024-03-15 09:07:34 -07:00
Angular Robot
1777169e10 build: update dependency webpack-dev-middleware to v7 2024-03-15 13:18:13 +01:00
Alan Agius
a1833c66c2 build: update Angular versions to 18.0.0-next.0 2024-03-15 10:16:11 +01:00
Charles Lyding
99104cd9e5 perf(@angular-devkit/build-angular): avoid transforming empty component stylesheets
A stylesheet for a component that is empty or contains only whitespace will
no longer be transformed and bundled during a build. Transforming the stylesheet
was unnecessary work as an empty string would be returned as a result. While
this may not be common in applications, it is a possibility. Both file and
inline component stylesheets are affected by this change.
2024-03-15 09:19:42 +01:00
Alan Agius
2fb4b243c4 refactor(@angular-devkit/build-angular): remove unused imported symbol
This commit removes an unused imported symbol.
2024-03-14 15:20:36 +01:00
Alan Agius
0a4943556f perf(@angular-devkit/build-angular): reduce build times for apps with a large number of components when utilizing esbuild-based builders
In this commit, we've optimized the build performance for applications containing a large number of components when using the esbuild-based builder. This optimization entails replacing the spread operator with `Object.assign` when appending to the result metadata in the Angular compiler plugin to avoid creating multiple copies of the object.

See: https://bugs.chromium.org/p/v8/issues/detail?id=11536

**Previous Performance**:
- Initial compilation: 37 seconds
- First incremental build: 20 seconds
- Second incremental build: 16 seconds

**Updated Performance**:
- Initial compilation: 24 seconds
- First incremental build: 6 seconds
- Second incremental build: 2 seconds

Closes #27280
2024-03-14 15:20:36 +01:00
Angular Robot
8374dc6df1 build: update all non-major dependencies 2024-03-14 10:53:31 +01:00
Alan Agius
c7b208555e refactor(@angular/cli): remove support for Node.js versions <18.19.1 and <20.11.1
BREAKING CHANGE: Node.js support for versions <18.19.1 and <20.11.1 has been removed.
2024-03-12 16:51:03 +01:00
Alan Agius
51debcdb78 refactor(@angular-devkit/build-angular): properly display errors originating in ESM loader hooks
Currently, errors occurring in ESM loader hooks while using `--import` are not correctly displayed, as they cannot be transferred from the worker to the main thread. Although the error is an instance of Error, it contains non-transferable properties and cannot be transmitted from a worker when --import is used. Consequently, when read outside of the worker, the error object displays as `[Object object]`. To address this issue, we reconstruct the error message.

See: https://github.com/angular/angular-cli/issues/27251
2024-03-12 15:28:19 +01:00
Charles Lyding
01fa0472e9 refactor(@angular-devkit/build-angular): use direct type assertions for cache option normalization 2024-03-12 09:46:20 -04:00
Charles Lyding
096aaba85f refactor(@angular-devkit/build-angular): remove unneeded option type casting from several builders
Multiple cases where builder options were being cast to the `JsonObject` type
have been removed. These casts are no longer needed and unnecessarily added
complexity to the code.
2024-03-12 09:46:20 -04:00
Alan Agius
1034bb155b fix(@angular-devkit/build-angular): provide better error message when server option is required but missing
This improves the error message when the server entry-point is required but missing

Closes #27251
2024-03-12 10:06:27 +01:00
Charles Lyding
db4b5f3d08 build: update less-loader to v12.2.0
Also removes `less-loader` from the renovate update ignore list.
The transitive dependency licensing issue has been resolved upstream.
2024-03-11 17:46:11 -04:00
Alan Agius
e729f6ea10 build: update dependency webpack-dev-server to v5 2024-03-11 19:00:54 +01:00
Charles Lyding
560ec400c0 refactor(@angular-devkit/build-angular): reduce usage of @angular-devkit/core types
Logging types are now based on the BuilderContext's type instead of the
`@angular-devkit/core` type. This reduces the need to directly depend
on this package while also allowing the builder logging type to diverge
if needed. The two usages of the BaseException type which is a small
wrapper around Error have also been removed.
2024-03-11 10:06:36 -04:00
Charles Lyding
93e918e4dd refactor(@angular-devkit/build-angular): improve i18n project option validation
The `i18n` project field is used to configure i18n behavior for a project.
The validation code has been reorganized to use two helper functions to
centralize the type validation and exception throwing. This reduces the complexity
of the analysis code as well as removing the need to rely on `@angular-devkit/core`.
2024-03-11 10:06:23 -04:00
Alan Agius
f112a0af16 refactor(@angular-devkit/build-angular): add warnings for unsupported vite options
This commit adds warnings when using unsupported dev-server options with vite.
2024-03-11 08:08:47 +01:00
Miles Malerba
034639b9d3 build: update dependencies for version 18.0.0 2024-03-08 18:40:58 +01:00
Alan Agius
518afd80cc fix(@angular-devkit/build-angular): ensure proper display of build logs in the presence of warnings or errors
Previously, a race condition could occur due to the spinner, resulting in the deletion of the last printed log when warnings or errors were present. With this update, we ensure that logs are printed after the spinner has stopped.

Fixes #27233
2024-03-08 16:26:23 +01:00
Angular Robot
dddcb2e8f4 build: update all non-major dependencies 2024-03-08 11:55:34 +01:00
Alan Agius
97973059ec refactor(@angular-devkit/build-angular): remove Sass legacy implementation
This commit removes the legacy Sass implementation previously used with Webpack.

BREAKING CHANGE: The support for the legacy Sass build pipeline, previously accessible via `NG_BUILD_LEGACY_SASS` when utilizing webpack-based builders, has been removed.
2024-03-06 18:15:32 +01:00
Angular Robot
9af9dc5cb1 build: update dependency terser to v5.29.1 2024-03-06 17:31:46 +01:00
Alan Agius
73e7c2b2c5 build: update dependencies for version 17.3.0
The prerelease checks are failing due to incorrect dependencies

```
Discovered errors when validating dependency ranges.
  - @angular/pwa: Unexpected peer dependency range for "@angular/cli". Expected: ^17.0.0 || ^17.3.0-next.0
  - @angular/ssr: Unexpected peer dependency range for "@angular/common". Expected: ^17.0.0 || ^17.3.0-next.0
  - @angular/ssr: Unexpected peer dependency range for "@angular/core". Expected: ^17.0.0 || ^17.3.0-next.0
  - @angular-devkit/build-angular: Unexpected peer dependency range for "@angular/compiler-cli". Expected: ^17.0.0 || ^17.3.0-next.0
  - @angular-devkit/build-angular: Unexpected peer dependency range for "@angular/localize". Expected: ^17.0.0 || ^17.3.0-next.0
  - @angular-devkit/build-angular: Unexpected peer dependency range for "@angular/platform-server". Expected: ^17.0.0 || ^17.3.0-next.0
  - @angular-devkit/build-angular: Unexpected peer dependency range for "@angular/service-worker". Expected: ^17.0.0 || ^17.3.0-next.0
  - @angular-devkit/build-angular: Unexpected peer dependency range for "ng-packagr". Expected: ^17.0.0 || ^17.3.0-next.0
  - @ngtools/webpack: Unexpected peer dependency range for "@angular/compiler-cli". Expected: ^17.0.0 || ^17.3.0-next.0
  - latest-versions: Invalid dependency range for "ng-packagr". Expected: ^17.3.0-next.0
  - latest-versions: Invalid dependency range for "Angular". Expected: ^17.3.0-next.0
```
2024-03-06 13:04:30 +01:00
Angular Robot
ab4f98596c build: update all non-major dependencies 2024-03-06 11:37:15 +01:00