3683 Commits

Author SHA1 Message Date
Paul Gschwendtner
3af88fef8b test: update chunk file name to reflect new name
It seems that the chunk deterministic name has changed after
recent node module /lock file changes. It's unclear what specifically is
involved in Webpack's chunk name generation, but the output and all
other tests still look good; which makes this is a rather safe update to
the new chunk name. Consulting with CLI team members explained that this
can happen quite often.
2024-12-16 12:17:17 -05:00
Jan Krems
a9a3470147 fix(@angular-devkit/build-angular): jasmine.clock with app builder 2024-12-13 12:12:07 -08:00
Angular Robot
7069c3bac8 build: update dependency sass to v1.83.0 2024-12-13 11:22:39 -08:00
Angular Robot
12f2026581 build: update all non-major dependencies 2024-12-11 07:56:48 -08:00
Alan Agius
0a570c0c2e feat(@angular/build): add support for customizing URL segments with i18n
Previously, the `baseHref` option under each locale allowed for generating a unique base href for specific locales. However, users were still required to handle file organization manually, and `baseHref` appeared to be primarily designed for this purpose.

This commit introduces a new `subPath` option, which simplifies the i18n process, particularly in static site generation (SSG) and server-side rendering (SSR). When the `subPath` option is used, the `baseHref` is ignored. Instead, the `subPath` serves as both the base href and the name of the directory containing the localized version of the app.

Below is an example configuration showcasing the use of `subPath`:

```json
"i18n": {
  "sourceLocale": {
    "code": "en-US",
    "subPath": ""
  },
  "locales": {
    "fr-BE": {
      "subPath": "fr",
      "translation": "src/i18n/messages.fr-BE.xlf"
    },
    "de-BE": {
      "subPath": "de",
      "translation": "src/i18n/messages.de-BE.xlf"
    }
  }
}
```

The following tree structure demonstrates how the `subPath` organizes localized build output:
```
dist/
├── app/
│   └── browser/  # Default locale, accessible at `/`
│       ├── fr/  # Locale for `fr-BE`, accessible at `/fr`
│       └── de/  # Locale for `de-BE`, accessible at `/de`
```

DEPRECATED: The `baseHref` option under `i18n.locales` and `i18n.sourceLocale` in `angular.json` is deprecated in favor of `subPath`.

The `subPath` defines the URL segment for the locale, serving as both the HTML base HREF and the directory name for output. By default, if not specified, `subPath` will use the locale code.

Closes #16997 and closes #28967
2024-12-07 19:00:32 +01:00
Angular Robot
ffad81a4de build: update all non-major dependencies 2024-12-06 10:14:31 +01:00
Jan Krems
fb41d182ee fix(@angular-devkit/build-angular): fix webpack config transform for karma 2024-12-05 11:24:29 -08:00
Jan Martin
9e2d3fbd1f fix(@angular-devkit/build-angular): handle windows spec collisions 2024-12-05 16:31:09 +01:00
Alan Agius
f2571b3251 build: update all non-major dependencies 2024-12-04 15:37:27 +01:00
Angular Robot
d96b096704 build: update all non-major dependencies 2024-12-03 08:35:22 +01:00
Alan Agius
4e5585a27f build: update Angular packages to version 19.1.x 2024-12-02 13:12:00 +01:00
Angular Robot
3829b862d8 build: update dependency undici to v7 2024-12-02 09:03:42 +01:00
Angular Robot
3a22d4435b build: update all non-major dependencies 2024-11-27 08:39:52 -05:00
Angular Robot
399bbb7b77 build: update all non-major dependencies 2024-11-25 13:02:44 -05:00
Angular Robot
fe1af9fc97 build: update all non-major dependencies 2024-11-21 11:39:43 -08:00
cexbrayat
a9a871c414 fix(@angular-devkit/build-angular): use stylePreprocessorOptions
The `stylePreprocessorOptions` were ignored, meaning that `silenceDeprecations`, for example,
was not used when building tests.
2024-11-21 08:54:56 -08:00
Angular Robot
19b21d2084 build: update angular 2024-11-19 10:03:35 -08:00
Charles Lyding
23dac18def build: update Angular packages to v19 stable 2024-11-19 10:01:19 -05:00
Doug Parker
5d79ab7819 fix(@angular-devkit/build-angular): fix hanging terminal when browser-sync is not installed
Running the SSR dev server when `browser-sync` is not installed would print the error, but then build the browser and server targets, then hang and never return control to the user until they manually Ctrl+C. This change skips building at all if `browser-sync` is not installed, immediately returning control to the user.

This is a simple workaround, but there are two deeper bugs which would benefit from investigation:
1.  Figure out why NPM sometimes doesn't install `browser-sync`. It was happening inconsistently for me when running `ng add @angular/ssr`.
2.  Figure out why Architect does not cancel/await targets still executing when a builder completes.
2024-11-18 08:59:44 -08:00
Jan Krems
d746de59f3 fix(@angular-devkit/build-angular): bring back style tags in browser builder 2024-11-18 08:48:37 -08:00
Doug Parker
4340f5f9ad refactor: add ngServerMode to Webpack SSR dev server
This was missed in the original addition of `ngServerMode` and incorrectly caused `withEventReplay` to run browser-specific code on the server and crash.
2024-11-15 17:21:21 -08:00
Angular Robot
bec92d9fc8 build: update all non-major dependencies 2024-11-13 07:26:35 -08:00
Angular Robot
14bc784f09 build: update all non-major dependencies 2024-11-12 13:13:19 -08:00
Angular Robot
47f70d6423 build: update all non-major dependencies 2024-11-11 11:26:14 -08:00
Alan Agius
b2e2be052f refactor(@angular/ssr): remove RenderMode.AppShell in favor of new configuration option
This commit removes the `RenderMode.AppShell` option. Instead, a new configuration parameter, `{ appShellRoute: 'shell' }`, is introduced to the `provideServerRoutesConfig` method.

```ts
provideServerRoutesConfig(serverRoutes, { appShellRoute: 'shell' })
```
2024-11-08 19:51:35 +01:00
Jan Krems
2c9904ec7a fix(@angular-devkit/build-angular): handle basename collisions 2024-11-06 07:19:43 -08:00
Jan Krems
127811203a fix(@angular-devkit/build-angular): serve assets 2024-11-05 15:59:06 -08:00
Jan Krems
faabbbf910 fix(@angular-devkit/build-angular): remove double-watch in karma
The Karma file watching was racing with the file writes done by the
application builder. Since we already tell Karma when to reun via
`.refeshFiles()`, disabling Karma's own file watcher should make
things more reliable.

This allows removing a weird special-case in the test case and
removes the noisy "File chaned" logs generated by Karma.

Fixes https://github.com/angular/angular-cli/issues/28755
2024-11-05 14:36:01 -08:00
Charles Lyding
9f5b5eb46e fix(@angular/build): correctly use dev-server hmr option to control stylesheet hot replacement
The development server's `hmr` option will now disable both global and component
stylesheet hot replacement if explicitly disabled. These features are enabled by
default for all projects.
2024-11-05 10:59:24 +01:00
Angular Robot
316df8fbba build: update all non-major dependencies 2024-11-04 16:44:14 +01:00
Angular Robot
6a3e1f5e5d build: update dependency tslib to v2.8.1 2024-11-01 09:35:14 -04:00
Angular Robot
69768bdaa4 build: update all non-major dependencies 2024-11-01 08:25:17 -04:00
Angular Robot
170bb19074 build: update all non-major dependencies 2024-10-30 12:27:43 -04:00
Doug Parker
ed8f96a492 refactor(@angular-devkit/build-angular): adds protractor builder which throws with a clear error message
This should help users who upgrade more easily discover that the builder has been removed and find the resources needed to migrate any existing tests.
2024-10-30 11:08:19 -04:00
Jan Krems
864675188e fix(@angular-devkit/build-angular): fix --watch regression in karma
Outside of single-run mode, the karma test provider was expected to
watch for changes. In the application builder branch, we only handled
the case of an explicit `--watch` though. This meant that the karma
runner was kept running but didn't see any file changes.

Fixes https://github.com/angular/angular-cli/issues/28730
2024-10-29 10:19:41 -07:00
Alan Agius
8e2829c851 refactor(@angular/build): add handling for ngServerMode
Configure esbuild to add `ngServerMode` as define.
2024-10-29 07:44:55 +01:00
Angular Robot
afec9297dc build: update all non-major dependencies 2024-10-28 14:36:59 -04:00
Alan Agius
15677d0cb7 refactor: replace critters with beasties
The Critters project has been transferred to the Nuxt team, who will now manage its development and has been renamed to Beasties.

See: https://github.com/danielroe/beasties
2024-10-28 18:57:05 +01:00
Alan Agius
137e8e0ceb fix(@angular/build): add warning when --prerendering or --app-shell are no-ops
Both options are ineffective when used with `outputMode`, so a warning is now issued.
2024-10-28 16:08:06 +01:00
Angular Robot
1890fe4e94 build: update all non-major dependencies 2024-10-24 08:29:52 -07:00
Angular Robot
ff88c3f6a1 build: update all non-major dependencies 2024-10-23 11:49:20 +02:00
Alan Agius
b893a6ae9d refactor: remove workarounds for Safari 14 and 15
Both of these versions are no longer supported by Angular and thus these workers are no longer required.
2024-10-22 19:18:12 +02:00
Doug Parker
62877bdf2b refactor(@angular-devkit/build-angular): remove Protractor builder and schematics
BREAKING CHANGE: Protractor is no longer supported.

Protractor was marked end-of-life in August 2023 (see https://protractortest.org/). Projects still relying on Protractor should consider migrating to another E2E testing framework, several support solid migration paths from Protractor.

* https://angular.dev/tools/cli/end-to-end
* https://blog.angular.dev/the-state-of-end-to-end-testing-with-angular-d175f751cb9c
2024-10-21 14:50:18 -07:00
Angular Robot
1128773122 build: update all non-major dependencies 2024-10-21 14:32:48 -07:00
Angular Robot
c38ff43473 build: update all non-major dependencies 2024-10-18 19:54:45 +00:00
Angular Robot
1f4428f0b3 build: update all non-major dependencies 2024-10-17 14:27:54 +00:00
Alan Agius
3cbbf456c1 refactor: handle standalone by default change
In tests, add `standalone: false` where it's missing.

Note: In the future, we should update our integration tests to use a standalone app.
2024-10-17 14:20:52 +00:00
Angular Robot
74b237c18f build: update all non-major dependencies
Closes #28644 as a pr takeover
2024-10-17 09:03:51 +02:00
Angular Robot
e448cf6ee9 build: update all non-major dependencies 2024-10-15 09:30:59 -07:00
Alan Agius
b0aa88f427 refactor(@angular-devkit/build-angular): remove unused dependencies
These dependencies are no longer utilized within the `@angular-devkit/build-angular` package.
2024-10-11 13:17:37 +02:00