16297 Commits

Author SHA1 Message Date
Angular Robot
e8958e363b build: lock file maintenance 2025-03-11 15:23:46 +01:00
Alan Agius
5bea3de4cb fix(@angular/build): invalidate com.chrome.devtools.json if project is moved
Ensure that when a project is relocated, the `com.chrome.devtools.json` file is properly invalidated by checking the `root` path.
2025-03-11 15:23:37 +01:00
Alan Agius
5ff4c28e7b build: ensure that tools/legacy-rnjs/node_modules is ignored 2025-03-11 14:17:40 +01:00
Angular Robot
f79ab12b0d build: update all non-major dependencies to v8.26.1 2025-03-11 13:16:38 +01:00
Paul Gschwendtner
9dd3f0344f
Further clean-up rules_nodejs npm workspace and remove yarn.lock (#29779)
* build: disconnect `@npm` workspace from main project

This will speed up significantly as we don't need to fetch all
dependencies again just for the `@npm` repository that is at this point
only leveraged by the `ng_package` rule for some of its dependencies.

This commit allows us to drop the `yarn.lock` and Aspect lock files, and
allows us to independently migrate `ng_package` to `rules_js`.

It also allows us to drop the `_rjs` TS interop layer in follow-up commits.

* build: drop `_rjs` suffix from `ts_project` targets

We don't need the `ts_project` interop in principle
at this point. We only have one remaining instance left for the SSR
`ng_package` integration. This commit cleans up all usages.

* build: remove yarn

* build: avoid duplicated dependencies at top-level

`rules_js` seems to be sensitive if there are similar versions of the same
package installed, but with differently matched peer dependencies. This
is fine because we can (and should long-term) move those dependencies to
their package-local `package.json` files. This commit unblocks the
migration and highlights how we can move deps to the individual packages
in the future.

* build: update checkout github action

This will allow us to use pnpm.

* build: update node to avoid strict-engines error caused by `npm`

Avoids:

```
Lockfile is up to date, resolution step is skipped
 ERR_PNPM_UNSUPPORTED_ENGINE  Unsupported environment (bad pnpm and/or Node.js version)

Your Node version is incompatible with "npm@11.2.0".

Expected version: ^20.17.0 || >=22.9.0
Got: v20.11.1
```

Note that we won't update the WORKSPACE test version as that would mean
we need to update the Node engines for shipped packages; and we can't do
this right now without introducing a breaking change.

* build: fix missing dependency for spec bundling

The beasties JS sources weren't available for bundling in the
`bazel-bin`, and this surfaced in RBE. This commit fixes this.
2025-03-11 10:05:52 +01:00
Angular Robot
a05d93a3f8 build: update devinfra digest to 04132c6 2025-03-10 10:22:30 -07:00
Angular Robot
9041f6d6a4 build: lock file maintenance 2025-03-10 10:22:16 -07:00
Alan Agius
3e35167855 fix(@angular/build): handle postcss compilation errors gracefully
Improves error handling in the PostCSS compilation process to prevent crashes and allow recovery.

Closes #29789
2025-03-10 14:41:59 +01:00
Alan Agius
596b9ae60c refactor(@angular/build): remove esbuild sourcemap workarounds
These are no longer requires since 0.25.1
2025-03-10 13:33:16 +01:00
Angular Robot
97ed10b964 build: update github/codeql-action action to v3.28.11 2025-03-10 11:38:23 +01:00
Alan Agius
4c85ca11a4 build: update angular 2025-03-10 11:34:25 +01:00
Charles Lyding
770b993c56 test: update E2E tests to account for .ng.html template extension 2025-03-10 09:43:21 +01:00
Charles Lyding
dc2f65999a fix(@schematics/angular): generate component templates with a .ng.html file extension
To align with the updated style guide, Angular v20 will generate
component templates with a `.ng.html` file extension instead of
the previous `.html` by default. Projects will automatically
use this new template extension. Projects can however opt-out of
component generation using `.ng.html` by setting the `ngHtml`
option to false for the component schematic. This can be done as
a default in the `angular.json` or directly on the commandline
via `--no-ng-html` when executing `ng generate`.
2025-03-10 09:43:21 +01:00
Angular Robot
312cc72192 build: lock file maintenance 2025-03-10 09:29:46 +01:00
Angular Robot
65a5ff49f1 build: update all non-major dependencies 2025-03-10 08:48:23 +01:00
Alan Agius
beab546bf2 fix(@angular/build): remove duplicate prebundling warning
This warning is already displayed during the normalization of options. See: b5a86709b7/packages/angular/build/src/builders/dev-server/options.ts (L56)
2025-03-07 15:33:19 +01:00
Alan Agius
dd7fe11f4b refactor(@schematics/angular): remove v19 migrations
These migrations are no longer executed.
2025-03-07 15:32:52 +01:00
Angular Robot
b5a86709b7 build: update all non-major dependencies 2025-03-07 11:23:08 +01:00
Alan Agius
41f2821a6b build: update angular 2025-03-07 09:51:12 +01:00
Angular Robot
956e806841 build: update devinfra digest to 60ad70b 2025-03-07 08:53:05 +01:00
Alan Agius
f0dd60be1e fix(@angular/build): exclude all entrypoints of a library from prebundling
The configuration now ensures that when a package is listed for exclusion, all paths within that package including sub-paths like `@foo/bar/baz`  are marked as external and not prebundled by the development server.

For example, specifying `@foo/bar` in the exclude list will prevent the development server from bundling any files from the `@foo/bar` package, including its sub-paths such as `@foo/bar/baz`.

This aligns with esbuild external option behaviour https://esbuild.github.io/api/#external

Closes #29170
2025-03-06 19:12:05 +01:00
Charles Lyding
03180fe035 feat(@schematics/angular): use TypeScript module preserve option for new projects
Newly generated projects will now use the `preserve` value for the `module` option
within the TypeScript configuration for the workspace (`tsconfig.json`). This value
was added in TypeScript 5.4 and is intended to model the behavior of modern bundlers
such as used in the default `application` builder.
This option value also has the advantage of automatically enabling `esModuleInterop`
and setting `moduleResolution` to `bundler` which are the currently generated values
for new projects. This allows explicit use of these options to be removed from the generated
file. The `resolveJsonModule` option is also enabled with `preserve` which removes
the need for developers to manually add it if JSON files are imported. JSON file imports
are fully support including unused property treeshaking with named imports in the
`application` builder.
Additional details on the option can be found here:
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-4.html#support-for-require-calls-in---moduleresolution-bundler-and---module-preserve
2025-03-06 17:55:28 +01:00
Angular Robot
29243fb363 build: update angular 2025-03-06 17:20:40 +01:00
Alan Agius
b079ef4c76 ci: renovate update Angular group to follow next tag
More info https://docs.renovatebot.com/configuration-options/#followtag
2025-03-06 16:59:35 +01:00
Alan Agius
31c81e9c68 feat(@angular/build): drop support for TypeScript older than 5.8
Narrow down the versions of TypeScript to support.

BREAKING CHANGE: TypeScript versions less than 5.8 are no longer supported.
2025-03-06 10:03:49 +01:00
Alexey Horbunov
b100c71ccd
fix(@angular/build): provide extract-i18n does not respect
`i18nDuplicateTranslation` config value (#29179)

This fixes an issue where the config was not passed.

Closes #23635
2025-03-05 19:18:51 +01:00
Alan Agius
3c9172159c feat(@angular/build): integrate Chrome automatic workspace folders
This commit integrates automatic Chrome DevTools workspace folder connection into the vite dev-server process, leveraging the experimental feature available in Chrome Canary, as described in the Chrome DevTools documentation https://chromium.googlesource.com/devtools/devtools-frontend/+/main/docs/ecosystem/automatic_workspace_folders.md
2025-03-05 17:14:18 +01:00
Alan Agius
896d98a313 release: cut the v20.0.0-next.0 release 20.0.0-next.0 2025-03-05 16:54:32 +01:00
Alan Agius
a6a1a82f79 docs: release notes for the v19.2.1 release 2025-03-05 16:46:39 +01:00
Alan Agius
005f511ef6 test: update ng-add version specifier test to bypass npm peer dependency issues
NPM's peer dependency resolution has known inconsistencies, which can cause issues when testing `ng-add`.
2025-03-05 16:37:09 +01:00
Alan Agius
1c10c0e4a9 build: lock file maintenance 2025-03-05 16:21:55 +01:00
Charles Lyding
093c5a3152 feat(@schematics/angular): directly use @angular/build in new projects
The `@angular/build` package is now used directly within all newly created
projects and replaces the previous usage of the `@angular-devkit/build-angular`
package. This has the advantage of removing the need to install all of the
Webpack related transitive dependencies contained within `@angular-devkit/build-angular`
that are used to support the `browser` builder. This results in a significant
reduction in both total dependency count and disk install size for new projects.
New projects that would prefer to use the Webpack-based `browser` builder can still
install the `@angular-devkit/build-angular` package within the workspace.

The `@angular/build@19.2.0-next.2` package currently has a total unpacked size of ~115 MB.
The `@angular-devkit/build-angular@19.2.0-next.2` package currently has a total unpacked size of ~291 MB.
2025-03-05 10:28:07 +01:00
Alan Agius
02df1be430 test: only test ng update for supported versions
Removes tests for versions 15 and 16 which are no longer in LTS.
2025-03-04 19:34:20 +01:00
Alan Agius
4f2bcdc7b7 fix(@schematics/angular): prevent error when tsconfig file is missing in application builder migration
If the root tsconfig.json is missing we should not error.

Closes #29754
2025-03-04 18:21:03 +01:00
Alan Agius
434198c69b fix(@angular/build): exclude component styles from 'any' and 'all' budget calculations
Previously, component styles were included in the 'any' and 'all' budgets, which could lead to incorrect budget violations. This update ensures that component styles are excluded from these budget calculations.

Closes #29609
2025-03-04 18:20:52 +01:00
Angular Robot
a22dd5a5b9 build: update all non-major dependencies 2025-03-04 16:16:58 +01:00
Alan Agius
6f0e90e215 fix(@angular-devkit/architect): improve error message when configuration is missing
This commit makes the error message more actionable.

Closes #29742
2025-03-04 16:16:44 +01:00
Alan Agius
280693231e perf(@angular/ssr): optimize response times by introducing header flushing
Improves SSR performance by streaming the response before inlining critical CSS. This allows for earlier header flushing, reducing time to first byte (TTFB) and improving perceived load times.
2025-03-04 16:15:35 +01:00
Angular Robot
815c0503d5 build: update angular 2025-03-04 13:29:24 +01:00
Alan Agius
d7db32ed92 test: update ssr-project-webpack
This commit updates the e2e asset to support version 20 and removes a redundant asset
2025-03-04 12:34:23 +01:00
Alan Agius
349dcd1b30 build: update Angular dev deps to version 20 2025-03-04 12:34:23 +01:00
Jan Martin
24bd93f7ba build: update fw and packagr to 20.0.0-next.0 2025-03-04 12:34:23 +01:00
Charles Lyding
c2bef38332 fix(@angular/build): allow component HMR with a service worker
When the service worker option is enabled, each code update will cause
the `ngsw.json` configuration file to change due to the different hashes
of the updated output. This is problematic for component HMR usage with
the development server since the full reload fallback logic would be triggered
due to the changed `ngsw.json` file.  To avoid this problem, the `ngsw.json`
configuration file is now special cased within the fallback logic.
2025-03-04 09:53:57 +01:00
Angular Robot
39ec21f0ca build: update dependency @vitejs/plugin-basic-ssl to v2 2025-03-04 09:53:02 +01:00
Paul Gschwendtner
5fd1cb56ab build: update dev-infra and rework windows native testing
As part of go/ng:windows-dev-future, we are changing how our
infrastructure supports Windows build & testing. Clearly:

- we will still support contributors on Windows, and we believe we will
  be improving and streamlining the experience here
- we will continue testing the Angular CLI for our Windows users. We are
  aware of the many Windows users using the `ng` CLI.

What is changing? We are no longer actively working towards a Bazel infrastructure
that supports native Windows building and testing. There are currently
two ways to contribute to Angular on Windows. That is via WSL, or via
e.g. native Windows cmd.exe, with Git Bash on top. We acknowledge that
the latter worked sometimes, but we also realize it very often breaks as
nobody on our team uses, verifies it, and it introduces extra complexity
because Bazel on Windows is quite disconnected from Linux/Mac (e.g. no
sandboxing). Going forward, to improve our team's effectiveness, and
improve our stability guarantees for Windows (and Windows contributors),
we are actively discouraging the use of Git Bash for contributing to
Angular; but instead ask for WSL to be used. I can speak as one of the
few long-term team members that have worked on Windows (without WSL) most
of my time, that WSL is great and the contributing experience is much
smoother and also easier to "guide". It's a positive change because we
won't be suggesting "two ways to contribute on Windows", where in
reality one is very brittle and can break at any time!

---

For testing of the Angular CLI: We will continue to maintain the
capability to cross-compile via Bazel with Windows as the target
platform. This allows us to build the e2e tests for Windows, and run
them natively outside WSL to ensure native Windows `ng` CLI testing!
This is what this change mostly does.

Notably, two things are missing here and will be followed up:

- caching of the e2e tests on Windows is not properly functioning yet.
- caching of the WSL node modules + nvm is not working properly yet.

Other than that, we are seeing very similar timing and results of the
Windows tests, so this change unblocks our `rules_js` migration.
2025-03-03 21:44:50 +01:00
Charles Lyding
c8c73185a6 fix(@angular/build): ensure matching coverage excludes with karma on Windows
When on Windows, the coverage exclusion paths need to be made
absolute via the Node.js path builtin to ensure matching
with the files during the build process.
2025-03-03 20:18:01 +01:00
Charles Lyding
c39c3440cf refactor(@angular/build): replace fast-glob usage with tinyglobby
Usage of the `fast-glob` package has been replaced with the `tinyglobby`
package throughout `@angular/build`. The change reduces the number of
transitive dependencies related to these packages from 17 to 2 while
also maintaining equivalent functionality. Additionally, the `tinyglobby`
package is used by other dependencies such as `vite` and `copy-webpack-plugin`
which has the potential to further reduce overall transitive dependencies
for a project.
2025-03-03 16:57:37 +01:00
Alan Agius
337bc3cae6 refactor(@angular/build): remove file: prefix from JIT component resource URLs in sourcemaps
Previously, JIT component resource URLs in sourcemaps included a `file:` prefix (e.g., `file:src/app/app.component.html`). This change removes the `file:` prefix to ensure cleaner source mappings.
2025-03-03 16:57:24 +01:00
Alan Agius
d63e31c326 refactor(@angular/ssr): remove deprecated provideServerRoutesConfig dev-preview API
`provideServerRouting` should be used instead.
2025-03-03 15:59:52 +01:00
Alan Agius
e6be37601d refactor(@angular-devkit/schematics): remove deprecated NodePackageLinkTask
BREAKING CHANGE: The `NodePackageLinkTask` has been removed without a replacement. Create a custom task if needed.

Note: This does not affect application developers.
2025-03-03 15:59:49 +01:00