Commit graph

346 commits

Author SHA1 Message Date
arturovt
feb86e3fde fix(common): remove placeholder image listeners once view is removed
Prior to this commit, attempting to resolve a `ChangeDetectorRef` after views or app have been destroyed would result in an error. In this commit, we clean up listeners once the view is destroyed, before the placeholder loads or fails to load.
2025-11-10 12:05:20 -08:00
SkyZeroZx
a3639e2258 feat(common): Blocks IPv6 localhost from preconnect checks
Prevents unnecessary preconnect warnings by adding IPv6 loopback ('[::1]') to the blocklist.
2025-10-24 18:46:43 +02:00
Joey Perrott
a1868c9d13 feat(common): update to cldr 47 (#64032)
Update to CLDR version 47 for localization

PR Close #64032
2025-10-21 23:23:30 +00:00
Matthieu Riegler
9eac43cf46 feat(common): Support of optional keys for the KeyValue pipe (#48814)
This commit is extending the capabilities of the KeyValue pipe by allowing interfaces with optional keys.

fixes angular#46867

PR Close #48814
2025-10-02 16:58:40 +00:00
kirjs
05370837fc Revert "feat(common): Support of optional keys for the KeyValue pipe (#48814)" (#64179)
This reverts commit 99c5269ee8.

PR Close #64179
2025-10-01 12:45:32 -04:00
Matthieu Riegler
99c5269ee8 feat(common): Support of optional keys for the KeyValue pipe (#48814)
This commit is extending the capabilities of the KeyValue pipe by allowing interfaces with optional keys.

fixes #46867

PR Close #48814
2025-10-01 08:58:47 -04:00
Joey Perrott
a9145f3856 Revert "feat(common): update to cldr 47 (#63923)" (#64031)
This reverts commit 8ca3e3a0bc.

PR Close #64031
2025-09-24 15:03:43 +00:00
Joey Perrott
8ca3e3a0bc feat(common): update to cldr 47 (#63923)
Update to CLDR version 47 for localization

PR Close #63923
2025-09-23 19:57:00 +00:00
Andrew Scott
c3576506b3 refactor(core): Update tests for zoneless by default (#63668)
This updates tests and examples only to prepare for zoneless by default.

These changes were identified and made as part of #63382. Anything that
failed gets `provideZoneChangeDetection` unless the fixes were easily
and quickly determined.

It also adds the zoneless provider to the `initTestEnvironment` calls
for tests in this repo to prevent regressions before #63382 is merged.

PR Close #63668
2025-09-09 14:41:56 -07:00
Andrew Scott
c795960ada feat(common): Add experimental support for the Navigation API (#63406)
The navigation API is part of interop 2025. You can find the
implementation status for each major browser here:

https://wpt.fyi/results/navigation-api?label=master&label=experimental&aligned&view=interop&q=label%3Ainterop-2025-navigation

https://developer.mozilla.org/en-US/docs/Web/API/Navigation_API

BREAKING CHANGE: (test only) - `TestBed` now provides a fake `PlatformLocation`
implementation that supports the Navigation API. This may break some
tests, though we have not observed any failures internally. You can revert to the
old default for `TestBed` by providing the `MockPlatformLocation` from
`@angular/common/testing` in your providers:
`{provide: PlatformLocation, useClass: MockPlatformLocation}`

PR Close #63406
2025-08-28 11:48:03 -07:00
Joey Perrott
2fcafb65c5 build: rename defaults2.bzl to defaults.bzl (#63383)
Use defaults.bzl for the common macros

PR Close #63383
2025-08-25 15:45:01 -07:00
Matthieu Riegler
25f593ce2a refactor(common): removengModuleFactory input of NgComponentOutlet (#62838)
This was deprecated by #44815

BREAKING CHANGE: NgModuleFactory has been removed, use NgModule instead.

PR Close #62838
2025-08-20 13:27:18 +00:00
Joey Perrott
cbc258eec8 build: remove ts_project_interop infrastructure (#62908)
Remove the interop macros and final usages

PR Close #62908
2025-07-31 09:12:58 +00:00
Matthieu Riegler
5f759999a8 refactor(common): replace aio links to adev (#62839)
The is a doc change + a minor test change (to remove test logs that mention aio)

PR Close #62839
2025-07-29 09:55:26 +00:00
Joey Perrott
b84859073b build: migrate to use web test runner rules (#62292)
Migrate karma tests throughout the repo to use the new web test runner based rule instead

PR Close #62292
2025-06-26 17:19:10 +00:00
Tristan Bastian
58aedc37d1 feat(common): add support for a custom EnvironmentInjector to NgComponentOutlet directive (#54764)
Signed-off-by: Tristan Bastian <tristan.bastian@cumulocity.com>

PR Close #54764
2025-06-25 17:02:19 +00:00
Joey Perrott
3a0cfd544d build: migrate to using new jasmine_test (#62086)
Use the new jasmine_test based on rules_js instead of jasmine_node_test from rules_nodejs

PR Close #62086
2025-06-18 08:27:26 +02:00
Joey Perrott
dfbdbbe882 refactor: use zone.js from npm instead of packages/zone.js throughout repo (#61977)
Use zone.js from npm isntead of from the repo going forward

PR Close #61977
2025-06-10 12:02:03 -07:00
arturovt
ef10aa4005 feat(common): support decoding in NgOptimizedImage (#61905)
This commit adds the ability to set the decoding attribute in NgOptimizedImage. It proxies the binding onto the host image element. If no binding is provided, it defaults to "auto", which matches the browser's default behavior. This approach avoids any breaking changes resulting from the update.

PR Close #61905
2025-06-09 09:02:17 -07:00
Rafal Slawik
82327f2092 feat(common): accept undefined inputs in NgTemplateOutlet (#61404)
Extend types of inputs to include `undefined` to avoid `?? null` when using singals (e.g. `viewChild`).

Fixes #51225

PR Close #61404
2025-05-25 14:26:42 -07:00
Matthieu Riegler
dba912dd07 refactor(platform-browser): replace platform-browser-dynamic with platform-browser (#61498)
The former isn't needed anymore and is now deprecated.

PR Close #61498
2025-05-21 14:01:49 +00:00
Joey Perrott
3440338d45 build: migrate common to use rules_js based toolchain (#61433)
Migrate packages/common to use ts_project and ng_project.

PR Close #61433
2025-05-20 15:07:56 +00:00
Paul Gschwendtner
3a106a35bc build: move private testing helpers outside platform-browser/testing (#61472)
These helpers are often imported by various tests throughout the
repository, but the helpers aren't exported/exposed from the public
entry-point; even though they confusingly reside in there.

This commit fixes this, and moves the helpers into
`packages/private/testing`. This is a preparation for the `ts_project`
migration where we don't want to leverage deep imports between packages.

PR Close #61472
2025-05-20 10:00:43 +00:00
Paul Gschwendtner
032b802f54 build: remove irrelevant madge circular deps tests (#61156)
We don't need this tooling anymore because we are already validating
that there are no circular dependencies via the `ng-dev` tooling that
checks `.ts` files directly.

Also these tests never actually failed to my knowledge.

PR Close #61156
2025-05-07 11:28:59 -07:00
Andrew Scott
b7d3f3dbfc feat(common): Allow passing ScrollOptions to ViewportScroller (#61002)
Adds ScrollOptions as an option second argument to ViewportScroller
scrollTo* functions.

Part of changes needed to address #58258

PR Close #61002
2025-04-29 12:23:12 -07:00
Alan Agius
cbbea70fa3 fix(common): issue a warning instead of an error when NgOptimizedImage exceeds the preload limit (#60879)
This should not be treated as a hard error, as it doesn’t break the application but merely degrades performance.

Closes #60871

PR Close #60879
2025-04-16 12:01:26 -04:00
arturovt
ad5fbd944d refactor(common): drop value not a number message in production (#60699)
Drops value not a number message in production.

PR Close #60699
2025-04-02 19:20:11 +00:00
TJ Lavelle
c8c828ee58 refactor(common): update AsyncPipe to support PromiseLike (#60551)
Updates the AsyncPipe to work with PromiseLike, in addition to Promise.

PR Close #60551
2025-04-01 17:56:39 +00:00
Andrew Kushnir
3fa7b2b136 refactor(common): convert scripts within packages/common to relative imports (#60623)
This commit updates scripts within `packages/common` to relative imports as a prep work to the upcoming infra updates.

PR Close #60623
2025-04-01 15:58:51 +00:00
arturovt
5317979738 refactor(common): drop error messages in production (#60415)
Drops more error messages in production.

PR Close #60415
2025-03-31 18:08:37 +00:00
Kristiyan Kostadinov
785a1110e6 fix(common): resolve host binding type issues (#60481)
Fixes type issues in the host bindings of `NgOptimizedImage`.

PR Close #60481
2025-03-20 11:55:52 -07:00
Andrew Scott
739cadae62 fix(common): Handle errors in async pipe subscriptions (#60057)
`AsyncPipe` would previously promise rejections unhandled and
subscription errors uncaught. This is more or less fine in a Zone-based
application because errors inside the Angular Zone are caught be the
Zone's error trap and reported to `ErrorHandler`. However, in zoneless
applications, these errors are never caught or reported by the FW and
can reach the node process in SSR and cause it to shut down.

BREAKING CHANGE: `AsyncPipe` now directly catches unhandled errors in
subscriptions and promises and reports them to the application's
`ErrorHandler`. For Zone-based applications, these errors would have
been caught by ZoneJS and reported to `ErrorHandler` so the result is
generally the same. The change to the exact mechanism for reporting can
result in differences in test environments that will require test
updates.

PR Close #60057
2025-03-04 17:35:01 +00:00
Stephen Hicks
74cceba587 feat(common): throw error for suspicious date patterns (#59798)
Adjusts the date pipe and formatDate function to detect suspicious usages of the week-numbering year formatter without including the week number, as this is often confused for the calendar year and likely to result in incorrect results near New Years, meaning that those issues aren't typically caught during development. This commit starts throwing a development-only error to reveal this issue right away.

BREAKING CHANGE:

Using the `Y` formatter (week-numbering year) without also including `w` (week number) is now detected as suspicious date pattern, as `y` is typically intended.

PR Close #59798
2025-02-24 17:15:03 -05:00
Andrew Scott
8657a0e4cc refactor(core): Add fake navigation to primitives for code sharing (#59857)
This moves the `FakeNavigation` implementation to the primitives folder
so its implementation can be shared with Wiz. This class was initially
copied directly from the Wiz implementation, with some small modifications.
There will still need to be some work done to align the implementations
and fix anything internally that needs adjusting.

PR Close #59857
2025-02-19 20:09:10 +00:00
arturovt
10cdf0afae refactor(common): tree-shake PreloadLinkCreator for client bundles (#59431)
In this commit, we tree-shake the `PreloadLinkCreator` for client bundles because it's targeting only server code. We use the pending tasks service to contribute to app stability by waiting for the module to load.

PR Close #59431
2025-01-24 17:17:58 +01:00
Sheik Althaf
9658dd1fe3 refactor(common): remove standalone: true (#58949)
Removed the standalone true flag from common packages.

PR Close #58949
2024-12-04 12:41:51 +01:00
Kristiyan Kostadinov
e4c50b3bea feat(common): expose component instance in NgComponentOutlet (#58698)
Exposes the current instance of the component in the `NgComponentOutlet` directive.

PR Close #58698
2024-11-20 08:08:21 -08:00
Devashish Sarmah
24c6373820 feat(common): add optional rounded transform support in cloudinary image loader (#55364)
Currently, the cloudinary image loader doesn't support rounded transform.
Add a new prop called `rounded` to the existing `ImageLoaderConfig.loaderParams`

test(common): add test case for cloudinary loader rounded option

add test case for the rounded transform option of cloudinary loader

PR Close #55364
2024-10-23 07:59:13 -07:00
Sebastian Barfurth
13c13067bc feat(common): disable keyvalue sorting using null compareFn (#57487)
The keyvalue pipe sorts the entries of the input by key. This has been the subject of debate in the past (https://github.com/angular/angular/issues/42490). The core of the discussions is that it is often desirable (and perhaps expected) that they natural ordering of the input is respected. There are at least two workarounds to restore natural ordering, such as a `compareFn` that simply returns `1` or a custom pipe. However, both of these require code for pipe consumers to maintain or  copy around to many places.

Allowing `null` as `compareFn` and treating it as "natural order" is fairly simple to understand, backward compatible and was suggested a few times on https://github.com/angular/angular/issues/42490 where it seemed to be received well. Using `null` is also possible in templates without any component code changes.

PR Close #57487
2024-10-16 18:18:19 +00:00
Matthieu Riegler
09df589e31 refactor(core): Migrate all packages with the explicit-standalone-flag schematic. (#58160)
All components, directives and pipes will now use standalone as default.
Non-standalone decorators have now `standalone: false`.

PR Close #58160
2024-10-14 14:58:57 +00:00
Joey Perrott
9dbe6fc18b refactor: update license text to point to angular.dev (#57901)
Update license text to point to angular.dev instead of angular.io

PR Close #57901
2024-09-24 15:33:00 +02:00
Alex Castle
50f08e6c4b feat(common): automatically use sizes auto in NgOptimizedImage (#57479)
Prepend 'auto' to value of the `sizes` prop generated by NgOptimizedImage, when image has a responsive srcset and is lazy-loaded.

PR Close #57479
2024-08-27 13:14:48 -07:00
Kristiyan Kostadinov
513a4fe05e refactor(core): replace usages of removeChild (#57203)
These changes replace most usages of `removeChild` with `remove`. The latter has the advantage of not having to look up the `parentNode` and ensure that the child being removed actually belongs to the specific parent.

The refactor should be fairly safe since all the browsers we cover support `remove`. [Something similar was done in Components](https://github.com/angular/components/pull/23592) some time ago and there haven't been any bug reports as a result.

PR Close #57203
2024-08-07 16:46:09 +00:00
Matthieu Riegler
2c4613a002 fix(common): Don't run preconnect assertion on the server. (#56213)
The `window` global is patched by domino on the server but the value of `window.location.href` isn't a valid base.

Before this change `getUrl()` would throw when running in devmode on the server.

Fixes #56207

PR Close #56213
2024-07-16 09:53:33 -07:00
Matthieu Riegler
d9fe17a3df refactor(common): Fire priority check on stable. (#56776)
To support routing on app init, the directive will now fire the priority check when the apps become stable.

fixes #56757

PR Close #56776
2024-07-03 14:40:47 +00:00
Matthieu Riegler
f407e3ce6f refactor(common): allow string urls in NgOptimizedImage input (#54901)
With this commit it is now possible to pass an url as placeholder for the image directive.

PR Close #54901
2024-07-01 18:13:24 +00:00
Andrew Kushnir
344775344b Revert "fix(common): Don't run preconnect assertion on the server. (#56213)" (#56740)
This reverts commit 39e48ce675.

PR Close #56740
2024-06-27 17:44:42 +00:00
Matthieu Riegler
39e48ce675 fix(common): Don't run preconnect assertion on the server. (#56213)
The `window` global is patched by domino on the server but the value of `window.location.href` isn't a valid base.

Before this change `getUrl()` would throw when running in devmode on the server.

Fixes #56207

PR Close #56213
2024-06-27 15:54:12 +00:00
Pawel Kozlowski
08f56d980b refactor(common): remove ng_switch ability to use == equality check (#56426)
In Angular v17 we've alligned NgSwitch equality check with the build in control
flow to be ===. At the same time we've left the ability to use ==. This ability was
controlled by the NG_SWITCH_USE_STRICT_EQUALS const targetted by the G3 patch.

This commits removes the infrastructure to swap equality operator in preparation
for the G3 patch removal.

PR Close #56426
2024-06-27 15:07:57 +00:00
Matthieu Riegler
cc4cb9608a refactor(common): Log a warning when the priority attribute of NgOptimizedImage is used too often. (#56669)
When the DOM content is loaded, Angular will log a warning message if the `priority` attribute is applied to often on `NgOptimizedImage` directive instances.

PR Close #56669
2024-06-26 12:43:00 -07:00