16130 Commits

Author SHA1 Message Date
Angular Robot
02d87bcf33 build: update all non-major dependencies 2025-01-31 08:28:30 +01:00
Alan Agius
9b0d730871 fix(@angular/build): prevent server manifest generation when no server features are enabled
This change ensures that the server manifest is not generated if none of the server-related features are enabled.

Closes #29443
2025-01-30 19:40:54 +01:00
Charles Lyding
8efd4ca45a build: remove now unused bazel dependencies
With the conversion to `rules_js` several `@bazel` scoped npm packages
are no longer needed to build and test the repository.
2025-01-30 18:02:53 +01:00
Alan Agius
2552093278 build: re-enable latest version checks during release
This commit restores the latest version checks, which are now fixed by using the stamped versions.
2025-01-30 17:52:13 +01:00
Paul Gschwendtner
c0d20e05c3 build: switch beasties bundling to rules_js
Switches the beasties bundling to `rules_js`, using rollup directly from
the node modules installation.

Notably we are facing a small issue that doesn't cause any issues right
now, because rollup tries to dereference symlinks by default given
a bug: https://github.com/aspect-build/rules_js/issues/1827.

This means we can't rely on the jailed resolution, but in practice it
shouldn't cause an issue at this point.
2025-01-30 11:16:46 +01:00
Paul Gschwendtner
3194f5675b build: remove leftover unused rules_nodejs npm dependency
This dependency does not provide any value for the `ts_project`
compilation, nor does it seem to be necessary; so we are cleaning up
this dependency.
2025-01-30 11:16:46 +01:00
Paul Gschwendtner
2236bc185a build: remove legacy defaults.bzl macro file
This file is currently no longer necessary after migrating all consumers
to their `rules_js` variants, so we can delete the file.

In follow-ups we will consider renaming `defaults2.bzl` back to this
file, or have a better name altogether.
2025-01-30 11:16:46 +01:00
Paul Gschwendtner
83b9d33946 build: migrate remaining usage of pkg_npm to rules_js
This is necessary so that we can delete the `pkg_npm` macro and fully
leverage the `rules_js` variant.
2025-01-30 11:16:46 +01:00
Paul Gschwendtner
01ea33e372 build: migrate CLI schema generation to rules_js
Migrates the CLI schema generation to `rules_js`, also significantly
simplifying the rule boilerplate.
2025-01-30 11:16:46 +01:00
Paul Gschwendtner
b40fa4073d build: migrate ts_json_schema rule to rules_js
Migrates to `rules_js` and simplifies! the `ts_json_schema` rule
2025-01-30 11:16:46 +01:00
Paul Gschwendtner
ef70b77049 build: remove usages of rules_nodejs copy_to_bin
Replaces usages of `rules_nodejs` `copy_to_bin` with the
`rules_js`/Aspect bazel lib equivalent.
2025-01-30 11:16:46 +01:00
Angular Robot
448e920e34 build: update angular 2025-01-30 08:00:17 +01:00
Angular Robot
18b5c10cb5 build: update github/codeql-action action to v3.28.8 2025-01-30 07:59:39 +01:00
Alan Agius
2431ab4208
refactor(@angular/build): update version check to account for unreleased FW packages (#29537)
In the FW integration tests the packages version is `0.0.0`. This commit update the compatibility version check to account for this.
2025-01-30 07:58:53 +01:00
Alan Agius
249f9dc26c refactor(@angular/build): remove unused import
Remove unused import.
2025-01-29 20:01:33 +01:00
Charles Lyding
319fbb6f06 refactor(@angular-devkit/core): add missing function return types
Adding explicit type information for function return types is needed
to allow the `@angular-devkit/core` package to eventually be built with
the `isolatedDeclarations` option.
2025-01-29 18:54:27 +01:00
Alan Agius
9a46be8d68 fix(@angular/build): prevent fallback to serving main.js for unknown requests
Previously, when an unknown `main.js` file was requested, the system would
automatically fall back to serving the default `main.js`. This behavior
could cause unexpected issues, such as incorrect resource loading or
misleading errors.

This fix ensures that only valid `main.js` files are served, preventing
unintended fallbacks and improving request handling.

Closes #29524
2025-01-29 17:31:55 +01:00
Alan Agius
89717452a3 release: cut the v19.2.0-next.1 release 19.2.0-next.1 2025-01-29 17:24:47 +01:00
Alan Agius
98c8fb5907 build: disable checkSchematicsAngularLatestVersion pre-release check
This is current checking `packages/schematics/angular/utility/latest-versions/package.json` but recently we change how the version is set https://github.com/angular/angular-cli/pull/29368
2025-01-29 17:19:31 +01:00
Alan Agius
954497faf0 Revert "build: update framework and ng-packagr peer-deps"
This reverts commit 5f3b6227087029b5169df5122d6218e3dc8f1a07.
2025-01-29 17:19:31 +01:00
Alan Agius
5f3b622708 build: update framework and ng-packagr peer-deps
```
Discovered errors when validating dependency ranges.
  - latest-versions: Invalid dependency range for "ng-packagr". Expected: ^19.2.0-next.0
  - latest-versions: Invalid dependency range for "@angular/core". Expected: ^19.2.0-next.0

Please fix these failures before publishing a new release.
These checks can be forcibly ignored by setting: SKIP_DEPENDENCY_RANGE_PRECHECK=1
```
2025-01-29 16:49:33 +01:00
Alan Agius
95189d54e5 docs: release notes for the v19.1.5 release 2025-01-29 16:39:07 +01:00
Alan Agius
46581db16b fix(@angular/ssr): redirect to locale pathname instead of full URL
When redirecting to the preferred locale, the previous implementation used the full URL for the 302 redirect to i18n subpaths based on the user's preferred locale. This update ensures that the redirect now uses the locale-specific pathname instead of the full URL.

Closes #29514
2025-01-29 16:18:16 +01:00
Alan Agius
05f3680525 docs: release notes for the v18.2.14 release 2025-01-29 14:48:58 +01:00
Alan Agius
7b70b9e020 docs: release notes for the v18.2.13 release 2025-01-29 11:27:14 +01:00
Paul Gschwendtner
539336e01a build: migrate remaining @angular/ssr tests to rules_js
Migrates the remaining `@angular/ssr` tests to `rules_js`.
2025-01-29 10:16:32 +01:00
Paul Gschwendtner
6a6ecee7e8 build: do not print tar command on windows for every dependency
Currently the Windows job prints the `tar` command when extracting a
dependency, for every individual package.
2025-01-29 10:16:32 +01:00
Paul Gschwendtner
832bfffc43 build: migrate @angular-devkit/build-angular tests to rules_js
Migrates the `@angular-devkit/build-angular` tests to `rules_js`. This
was a rather larger undertaking as the tests were very reliant on e.g.
the directory structure or specific node module layout; so some changes
were needed.

- the Sass files include a much larger file header now. That is because
  the npm Sass files have much larger paths, given being inside a
  symlinked pnpm store directory. E.g.

  ```

/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ../../../../../node_modules/.aspect_rules_js/css-loader@7.1.2_webpack_5.97.1/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].rules[0].oneOf[0].use[1]!../../../../../node_modules/.aspect_rules_js/postcss-loader@8.1.1_1462687623/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].rules[0].oneOf[0].use[2]!./src/test-style-a.css?ngGlobalStyle ***!
  \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
.test-a {color: red}
  ```

- Similarly to above, hashed chunk files can change given different
  paths of e.g. Webpack, or external sources.

- Tests for verifying the lazy module chunks may enable
  `preserveSymlinks` just to make the chunk names shorter and easier to
  verify, avoiding truncatd super long paths to the e.g. pnpm stores
  again.

- the ngsw-worker.js file cannot be copied using `copyFile` as that
  results in permissions being copied as well. In Bazel, now that
  the npm files are properly captured, are readonly, so subsequent
  builds (e.g. the watch tests) will fail to copy/override the file
  again! Reading and writing the file consistently seems appropriate.

- Tests relying on puppeteer and webdriver-manager worked in the past,
  by accident, because postinstall scripts (from e.g. puppeteer) were
  able to modify content of other packages (e.g. the puppeteer-core
  cache of browsers then). This does not work with `rules_js` anymore,
  so we need to keep the cache local to the puppeteer postinstall
  script. This requires a little trickery right now to ensure resolution
  of the browsers at runtime works..

- server tests did miss the `node` types to be explicitly listed (as
  they would be in a fresh project), and this caused failures. Likely
  because we no longer patch resolution.

- avoid npm-module style imports from tests within the same package.
  This is not allowed with `rules_js` and also is inconsistent.
2025-01-29 09:02:41 +01:00
Angular Robot
0fe4a5493f build: update all non-major dependencies 2025-01-29 08:30:27 +01:00
Charles Lyding
d4ee36065d fix(@angular/build): keep background referenced HMR update chunks
When HMR is enabled and a component update is sent to the development server,
the following background incremental update will no longer remove the previous
JavaScript chunk files for lazy routes. This allows the active and running
application code within the browser to still access the lazy chunks referenced
in the code. This is important for cases such as when a component in a lazy
route (that has not yet been accessed) is modified. In this case, the component
update is still processed if/when the lazy route is eventually accessed via the
module-time evaluation of the component update code.
2025-01-29 08:16:47 +01:00
Alan Agius
cae068be37 fix(@schematics/angular): update library schematic to use @angular-devkit/build-angular:ng-packagr
The library schematic currently relies on Karma, which requires `@angular-devkit/build-angular` to be installed. To address this, we now use the `ng-packagr` builder provided in this package.

Closes #29494
2025-01-29 08:15:46 +01:00
Charles Lyding
f743a63c2a refactor(@angular/build): move @angular-devkit/core to a development dependency
The `@angular-devkit/core` package is not needed at runtime within the
`@angular/build` package.
2025-01-29 07:32:37 +01:00
Angular Robot
38a809a50c build: update angular 2025-01-28 21:40:45 +01:00
Alan Agius
529cfed8fa refactor(@angular/build): remove outdated version checks
Cleaned up legacy version-checking logic.
2025-01-28 18:17:48 +01:00
Charles Lyding
e3aa483028 refactor(@angular/build): allow browser client to log console message with dev-server
The development server now supports a WebSocket event named `angular:log`.
This event allows the browser client to send log messages back to the development
server. Currently this is unused by the client and Angular runtime. But
is intended to be used in the future for such cases as propagating error messages
back to the development server console. This event is considered internal and
should not be relied upon by external code.
2025-01-28 17:37:07 +01:00
Alan Agius
0ddf6aafaa fix(@angular/build): utilize bazel stamp instead of resolving peer dependency versions
This update replaces the resolution of peer dependency versions with the use of the Bazel stamp for improved consistency and reliability.

Closes #29504
2025-01-28 16:26:21 +01:00
Alan Agius
ec05c814ee fix(@angular/ssr): rename provideServerRoutesConfig to provideServerRouting
This commit renames `provideServerRoutesConfig` to `provideServerRouting` and updates the second parameter to use the `ServerRoutes` features.

This change improves alignment with the framework's API conventions and the way features are integrated.

### Example Usage:
Before:
```typescript
provideServerRoutesConfig(serverRoutes, { appShellRoute: 'shell' })
```

After:
```typescript
provideServerRouting(serverRoutes, withAppShell(AppShellComponent))
```
2025-01-28 09:25:42 +01:00
skander23000
6f9a764526
docs: fix relative link to README not working on npm repo (#29496)
The link to the README was relative, which caused it to break when viewed on the npm repository. The link has been updated to an absolute URL to ensure it works properly.
2025-01-28 09:08:50 +01:00
Angular Robot
99326b90a4 build: lock file maintenance 2025-01-28 09:07:44 +01:00
alexfriesen
57ae111e28 refactor(@angular/ssr): drain node stream 2025-01-28 09:07:25 +01:00
Angular Robot
6e013b7e5d build: update github/codeql-action action to v3.28.6 2025-01-28 09:07:13 +01:00
Charles Lyding
694ef8e6e4 fix(@angular/build): allow tailwindcss 4.x as a peer dependency
To support usage of the newly released Tailwind CSS 4.0.0, the peer dependency
range has been update to include `^4.0.0`. This prevents potential installation
warnings/error when using various package managers.
Use of Tailwind CSS 4+ requires either the `application` (new project default) or
`browser-esbuild` builder. Both of which support custom postcss configuration
via a `.postcssrc.json` file.

For instructions on the setup of Tailwind CSS with Angular, please see the
Tailwind CSS documentation here: https://tailwindcss.com/docs/installation/framework-guides/angular
2025-01-27 12:30:33 -05:00
Charles Lyding
531dcdca46 fix(@angular/build): support template updates that also trigger global stylesheet changes
In some cases a change to a component template may cause changes to other
aspects of the application. Tailwind, for instance, may cause changes to the
global stylesheets when class usage is changed in a template. To support hot
module replacement of the component template in these cases, stylesheet changes
are now analyzed and separated during the update process. This allows both a hot
update of the template and the global stylesheet during the rebuild instead
of the previously required full page reload.
2025-01-27 15:50:11 +01:00
Angular Robot
0fcbfd30ed build: update dependency @stylistic/eslint-plugin to v3 2025-01-27 15:09:50 +01:00
Angular Robot
d47971c9e4 build: update all non-major dependencies to v7.26.7 2025-01-27 14:16:22 +01:00
Angular Robot
8fb9f9647e build: update github/codeql-action action to v3.28.5 2025-01-26 18:43:07 -05:00
Angular Robot
8bc43bcdf5 build: update github/codeql-action action to v3.28.4 2025-01-24 09:06:00 -05:00
Angular Robot
e00ea8e1fb build: update all non-major dependencies 2025-01-24 07:23:41 -05:00
Alan Agius
1a3ef3b60b fix(@angular/build): disable TypeScript removeComments option
Disables TypeScript's `removeComments` option to ensure important annotations like `/* @__PURE__ */`
and `/* vite-ignore */` are preserved. TypeScript's comment removal can be too aggressive,
potentially stripping out critical information needed by bundlers for dead code elimination.
Non-essential comments will be handled by the bundler, so removing them in TypeScript isn't necessary
and could lead to an increase in the final bundle size.

Closes #29470
2025-01-24 13:20:56 +01:00
Alan Agius
1e088f558a build: update ng-packagr to ^19.2.0-next.0
Bump ng-packagr version.
2025-01-24 12:56:04 +01:00