1
0
mirror of https://github.com/angular/angular-cli.git synced 2025-05-25 16:57:51 +08:00

16171 Commits

Author SHA1 Message Date
Angular Robot
1355d086fe build: update all non-major dependencies 2025-02-12 08:49:47 -08:00
Charles Lyding
964fb778b7 fix(@angular/build): support per component updates of multi-component files
The HMR component update candidate analysis has been improved to now perform
more fine-grained checks for cases where more than one component is present
in a single TypeScript file. Previously it was possible for all components
present in a TypeScript file to be considered update candidates when only
one of the components had relevant changes to its template and/or styles.
2025-02-12 11:34:45 -05:00
Alan Agius
25007e125d ci: temporary disable updating esbuild
Versions 0.25.0 breaks sourcemaps, this requires further investigation and if it's possible to mitigate from our end.
2025-02-12 14:14:21 +01:00
Alan Agius
be15b886c7 fix(@angular/build): configure Vite CORS option
Vite's `allowedHosts` option does not enable CORS; instead, it allows the dev server to respond to requests with a matching hostname (e.g., http://example.com/main.js). It only verifies that the request’s hostname is on the allowed list. However, this does not consider the `origin` in the case of a CORS request.

This commit updates Vite's configuration to enable CORS.

Closes 
2025-02-12 10:43:18 +01:00
Alan Agius
b50b6ee920 perf(@angular/build): cache translated i18n bundles for faster builds
When disk caching is enabled, translated i18n bundles are stored on disk, improving performance and speeding up both incremental and non-incremental builds.
2025-02-11 20:15:54 +01:00
Younes Jaaidi
523d539c66 feat(@angular-devkit/build-angular): add aot option to karma 2025-02-11 08:47:37 -08:00
Alan Agius
8faaf51d61 refactor(@angular/build): remove outdated allowedHosts warning
The warning is no longer accurate, as `allowedHosts` is now used in Vite.
2025-02-11 17:08:32 +01:00
Alan Agius
833dc986db fix(@angular/ssr): properly handle baseHref with protocol
Enhances handling of `baseHref` when it includes a full URL with a protocol.

Closes 
2025-02-10 15:33:31 -08:00
Angular Robot
e99f2c2efd build: lock file maintenance 2025-02-10 15:26:20 -08:00
Angular Robot
4db39ac03b build: update github/codeql-action action to v3.28.9 2025-02-10 15:26:07 -08:00
Charles Lyding
beefed839f fix(@angular/build): always provide Vite client helpers with development server
In addition to the WebSocket code, the Vite client module contains helper
functions which may be injected into modules at request time. These helpers
are required for certain behavior to function. Previously, when `--no-live-reload`
was used, these helpers may not have been available which led to runtime
errors. These runtime errors will no longer occur. However, the browser console
will now log that the Vite client cannot connect to the development server
WebSocket. This is expected in this case since live reload functionality
was disabled and the server side is intentionally not available.
2025-02-10 15:25:19 -08:00
Alan Agius
b553069896 fix(@angular/build): handle unlocalizable files correctly in localized prerender
Ensure proper handling of unlocalizable files during localized prerendering to prevent errors.

Closes 
2025-02-10 17:31:58 +01:00
Alan Agius
aa0ae457b0 fix(@schematics/angular): include default export for Express app
This update is required for Firebase functions compatibility.

Closes 
2025-02-10 17:31:37 +01:00
Alan Agius
880a50c50c fix(@angular/build): exclude unmodified files from logs with --localize
Ensures that only modified files are displayed in logs when using the `--localize` flag, preventing unnecessary noise.

Closes 
2025-02-10 16:31:06 +01:00
Alan Agius
dca408b926 build: update all non-major dependencies 2025-02-10 16:29:51 +01:00
Angular Robot
0dca33c961 build: update schematics dependencies to ~5.6.0 2025-02-10 16:26:22 +01:00
Angular Robot
021985fcb1 build: update angular 2025-02-07 11:04:05 -08:00
Angular Robot
cf2d54b222 build: update all non-major dependencies 2025-02-06 15:19:51 -08:00
Alan Agius
17a7b8cf01 refactor(@angular/build): also add server.preTransformRequests
5c1360179c moved `preTransformRequests` from the `server` to `dev` section. But vite, still uses the `server` section in such cases bcdb51a1ac/packages/vite/src/node/server/index.ts (L673) and
bcdb51a1ac/packages/vite/src/node/server/middlewares/indexHtml.ts (L475)
2025-02-06 12:25:54 -08:00
Alan Agius
414736bc0f fix(@angular/ssr): accurately calculate content length for static pages with \r\n
JS engines convert `\r\n` to `\n` in template literals, potentially leading to incorrect byte length calculations. This fix ensures the correct content length is determined.

Closes 
2025-02-06 11:51:26 -08:00
Alan Agius
53de5c167a docs: release notes for the v19.1.6 release 2025-02-05 13:49:47 -08:00
Charles Lyding
b24089ef86 fix(@angular/build): ensure full rebuild after initial error build in watch mode
If an initial build of an application results in an error during watch mode
(including `ng serve`), the following non-error rebuild will now always be
a full build result. This ensures that all new files are available for later
incremental build result updates.
2025-02-05 13:16:48 -08:00
Charles Lyding
5c1360179c fix(@angular/build): avoid pre-transform errors with Vite pre-bundling
Vite 6.0 change the option location of the `preTransformRequests`
to the `dev` section of the Vite configuration. While the previous `server`
section option of the same name is still present, it currently does not
change behavior when configured.
2025-02-05 13:16:32 -08:00
Angular Robot
dc11340113 build: update all non-major dependencies 2025-02-05 06:52:05 -08:00
Angular Robot
bde185c8cb build: update github/codeql-action digest to dd74661 2025-02-05 06:45:51 -08:00
Younes Jaaidi
ef7ea536fe feat(@angular-devkit/build-angular): add aot option to jest 2025-02-04 07:46:16 -08:00
Angular Robot
5123ff4a58 build: update all non-major dependencies 2025-02-04 07:19:17 -08:00
Charles Lyding
9525eee739 refactor(@angular/build): allow component update invalidation from client
If HMR is enabled, a component update has the potential to be unsupported
at runtime or may cause an exception. While build time analysis attempts
to verify that an update is possible, there could be cases that are as of
yet unknown. For those cases, the runtime can now signal this information
back to the development server which will clear the errant component update
and trigger a full page reload. This action will be logged to the development
server console along with an optional message from the client.
2025-02-04 07:11:15 -05:00
Alan Agius
25dbe7cfc1 refactor(@angular/ssr): simplify preload append logic in metadata
Replace `filter` and `map` with a `for...of` loop to improve readability in the preload append logic within metadata.
2025-02-03 15:20:18 -08:00
Alan Agius
c716ce1523 fix(@schematics/angular): skip ssr migration when @angular/ssr is not a dependency
This commit updates the `update-ssr-imports` migration to not run when the @angular/ssr` package is not listed as a dependency.

Closes 
2025-02-03 15:13:24 -08:00
Jan Martin
c48a2da287 build: Preserve newlines when gathering stdout
If the chunk happens to end in a new line or other meaningful
whitespace, stripping it can lead to two words (e.g. targets)
being squished together and broken.
2025-02-03 14:35:34 -08:00
Angular Robot
7a8ff1f099 build: update all non-major dependencies 2025-02-03 14:35:08 -08:00
Angular Robot
ed2fce1614 build: lock file maintenance 2025-02-03 13:35:18 -08:00
ilir.beqiri
4a5b76a8ee fix(@schematics/angular): remove additional newline after standalone property 2025-02-03 12:23:59 -08:00
Alan Agius
6448f80bfb fix(@angular/ssr): prioritize the first matching route over subsequent ones
Ensures that the SSR router gives precedence to the first matching route, addressing the issue where later conflicting routes.

This change prevents the incorrect prioritization of routes and ensures the intended route is matched first, aligning routing behavior.

Closes: 
2025-02-03 12:23:19 -08:00
Angular Robot
62ee0f3100 build: update angular 2025-02-03 12:20:46 -08:00
Joey Perrott
64a1b1524b ci: empty default permissions for CodeQL action 2025-01-31 11:34:48 -07:00
Angular Robot
d56da21c0d build: update angular 2025-01-31 19:03:47 +01:00
Joey Perrott
65534522ef ci: disable evalutations that arecausing codeql timeouts
Disabling js/bad-code-sanitization and js/regex-injection because a recent update caused tons of
 timeouts and we don't have anything where cryptographic usage is ultra important in our use cases.
2025-01-31 18:31:55 +01:00
Joey Perrott
09cb935efb ci: configure codeql locally within the repo to allow for customization
Moving to the configuration being in the repo allows us to specify which specific rules are run in analysis.
2025-01-31 18:31:55 +01:00
Alan Agius
9726cd084b feat(@angular/ssr): Add support for route matchers with fine-grained render mode control
This commit adds support for custom route matchers in Angular SSR, allowing fine-grained control over the `renderMode` (Server, Client) for individual routes, including those defined with matchers.

Routes with custom matchers are **not** supported during prerendering and must explicitly define a `renderMode` of either server or client.

The following configuration demonstrates how to use glob patterns (including recursive `**`) to define server-side rendering (SSR) or client-side rendering (CSR) for specific parts of the 'product' route and its child routes.

```typescript
// app.routes.ts
import { Routes } from '@angular/router';

export const routes: Routes = [
  {
    path: '',
    component: DummyComponent,
  },
  {
    path: 'product',
    component: DummyComponent,
    children: [
      {
        path: '',
        component: DummyComponent,
      },
      {
        path: 'list',
        component: DummyComponent,
      },
      {
        matcher: () => null, // Example custom matcher (always returns null)
        component: DummyComponent,
      },
    ],
  },
];
```

```typescript
// app.routes.server.ts
import { RenderMode, ServerRoute } from '@angular/ssr';

export const serverRoutes: ServerRoute[] = [
  { path: '**', renderMode: RenderMode.Client },
  { path: 'product', renderMode: RenderMode.Prerender },
  { path: 'product/list', renderMode: RenderMode.Prerender },
  { path: 'product/**/overview/details', renderMode: RenderMode.Server },
];
```

Closes 
2025-01-31 13:09:34 +01:00
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 
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