Commit graph

522 commits

Author SHA1 Message Date
Adam Koch
980c64abaa docs: remove incorrect documentation around the use of timezone abbreviations (#57425)
The ability to use an abbreviated timezone was removed in v5 (issue https://github.com/angular/angular/issues/20225 discusses this) and no alternative has been merged. See issue https://github.com/angular/angular/issues/40865 and PR https://github.com/angular/angular/pull/48482 The text suggests there is a way to pass in a timezone other than by an offset but there isn't.

PR Close #57425
2024-08-20 10:51:37 -07: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
cexbrayat
229dd8355e fix(common): typo in warning for NgOptimizedDirective (#56817)
The warning message for the `PLACEHOLDER_DIMENSION_LIMIT_EXCEEDED` check has a repetition of `of`.

PR Close #56817
2024-07-05 13:03:56 +02: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
Pawel Kozlowski
b5c2e91f8f refactor(common): remove remaining code for NgSwitch equality patch (#56806)
This change is the final cleanup after removing NgSwitch's equality patch
that was used in G3 to allow == matching for a certain period of time. This
code is no longer needed as both the external ecosystem and G3 are using
=== equality for matching NgSwitch cases.

PR Close #56806
2024-07-02 14:16:24 +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
cexbrayat
f25653e231 fix(common): typo in NgOptimizedImage warning (#56756)
A space is missing in the warning message for `TOO_MANY_PRIORITY_ATTRIBUTES`.

PR Close #56756
2024-06-28 18:38:25 +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
garrettld
87c5f3c521 docs(common): fix FormatWidth.Short description (#55821)
PR Close #55821
2024-05-20 23:39:06 -07:00
Kristiyan Kostadinov
aa8df1d029 refactor(core): clean up clang comments and workarounds (#55750)
Since we aren't using clang anymore, we can remove the comments and the workarounds that were in place to prevent it from doing the wrong thing.

PR Close #55750
2024-05-13 11:10:36 -07:00
Matthieu Riegler
d34c033902 refactor(common): Deprecate Local Data API functions (#54483)
Ahead of delegating the i18n subsystem to the `Intl` API, this commit introduce the intention to remove those functions from the public API.

DEPRECATED: `getCurrencySymbol`, `getLocaleCurrencyCode`, `getLocaleCurrencyName`, `getLocaleCurrencySymbol`, `getLocaleDateFormat`, `getLocaleDateTimeFormat`, `getLocaleDayNames`, `getLocaleDayPeriods`, `getLocaleDirection`, `getLocaleEraNames`, `getLocaleExtraDayPeriodRules`, `getLocaleExtraDayPeriods`, `getLocaleFirstDayOfWeek`, `getLocaleId`, `getLocaleMonthNames`, `getLocaleNumberFormat`, `getLocaleNumberSymbol`, `getLocalePluralCase`, `getLocaleTimeFormat`, `getLocaleWeekEndRange`, `getNumberOfCurrencyDigits`

PR Close #54483
2024-04-23 12:22:43 -07:00
Alan Agius
3b0de30b37 refactor(common): remove deprecated isPlatformWorkerApp and isPlatformWorkerUi API (#55302)
BREAKING CHANGE: The deprecated `isPlatformWorkerUi` and `isPlatformWorkerApp` have been removed without replacement, as they serve no purpose since the removal of the WebWorker platform.

PR Close #55302
2024-04-17 08:00:01 +02:00
Matthieu Riegler
1c6553e823 refactor(compiler-cli): Link to adev (#55043)
Replace aio links with to adev guides

PR Close #55043
2024-04-09 12:23:09 -07:00
Matthieu Riegler
457d02cca3 docs: Use new Urls to drop the docs url mapper (#55043)
PR Close #55043
2024-04-09 12:23:09 -07:00
Johnny Gérard
2a6f809507 fix(common): invalid ImageKit quality parameter (#55193)
The current quality parameter is ignored by ImageKit.

PR Close #55193
2024-04-05 14:55:13 +00:00
Johnny Gérard
50da50103f docs(common): clean up comment (#55088)
PR Close #55088
2024-03-29 13:02:44 -07:00
Matthieu Riegler
f523415203 docs: drop glossary links (#55044)
PR Close #55044
2024-03-28 13:02:50 -07:00
Matthieu Riegler
ee3bb81f99 refactor(common): request low quality placeholder images (#54899)
For every built-in load, this commit adds a parameter to load low quality placeholder images. Using 20/100 as base value.

PR Close #54899
2024-03-25 11:17:33 -07:00
Kristiyan Kostadinov
974958913c feat(core): support TypeScript 5.4 (#54414)
Adds support for TypeScript 5.4 to the project.

PR Close #54414
2024-02-26 18:29:09 -08:00
Andrew Scott
707bfc9b32 perf(common): AsyncPipe should not call markForCheck on subscription (#54554)
This commit prevents `AsyncPipe` from calling `markForCheck` when values
are synchronously emit during subscription to an observable. This
prevents subscriptions to `Replay` observables from needlessly walking
up to the root of the view tree during template execution for each
new replay observable in the template.

PR Close #54554
2024-02-23 09:20:02 -08:00
Kristiyan Kostadinov
219445cda4 fix(common): image placeholder not removed in OnPush component (#54515)
Fixes that the placeholder wasn't being removed when an optimized image is placed in an `OnPush` component.

Fixes #54478.

PR Close #54515
2024-02-20 09:49:58 -08:00
ascorbic
03c3b3eb79 feat(common): add Netlify image loader (#54311)
Add an image loader for Netlify Image CDN. It is slightly different in implementation from existing loaders, because it allows absolute URLs

Fixes #54303

PR Close #54311
2024-02-08 16:17:57 +00:00
Matthieu Riegler
122213d37d fix(common): The date pipe should return ISO format for week and week-year as intended in the unit test. (#53879)
ISO 8601 defines
* Monday as the first day of the week.
* week 01 is the week with the first Thursday

Therefore:
Sunday Dec 31st 2023 is the last day of the last week of the year : W52 2023.

PR Close #53879
2024-01-31 16:41:10 +00:00
Matthieu Riegler
4a44f73288 docs: Update docs about equality. (#54158)
Since v17, `ngSwitch` uses a strict equality.

Fixes #54156

PR Close #54158
2024-01-31 15:07:52 +00:00
Joey Perrott
0460a9dfaf refactor: migrate common to prettier formatting (#54150)
Migrate formatting to prettier for common from clang-format

PR Close #54150
2024-01-30 16:08:07 +00:00
kabrunko-dev
f3567bbc26 refactor(common): simplify i18n plural and select pipe metadata (#53939)
Remove pure property from pipe decorator

PR Close #53939
2024-01-30 15:06:24 +00:00
kabrunko-dev
3c881acc5d refactor(common): simplify date pipe metadata (#53939)
Remove pure property from date pipe decorator

PR Close #53939
2024-01-30 15:06:24 +00:00
Andrew Scott
15c48113c2 refactor(router): Update integration tests to cover navigation and history API (#53799)
This commit updates the router integration tests to cover both the
classic History and the new Navigation API. There is more work to be
done here, but this commit works to prove the efficacy of the
`FakeNavigation` implementation.

PR Close #53799
2024-01-30 15:04:02 +00:00
Alex Castle
f5c520b836 feat(common): add placeholder to NgOptimizedImage (#53783)
Add a automatic placeholder implementation supporting loader-based and data URL placeholders

PR Close #53783
2024-01-29 16:00:38 +00:00
Matthieu Riegler
7800a3c9f5 refactor(core): remove InjectionToken descriptions in optimized builds. (#53747)
We started guarding the `InjectionToken` descriptions with `ngDevMode`. Let's generalize that accross the FW.

PR Close #53747
2024-01-26 19:12:41 +00:00
Matthieu Riegler
89ab1c18a1 refactor(common): Use Nullish coalescing assignment when possible. (#53931)
Inspired by #53923, lets simplify code when possible.

PR Close #53931
2024-01-26 16:58:36 +00:00
Andrew Scott
5996d3fa6b Revert "refactor(router): Update integration tests to cover navigation and history API (#53799)" (#53860)
This reverts commit eb2e879a00.

PR Close #53860
2024-01-09 14:30:50 -08:00
Andrew Scott
eb2e879a00 refactor(router): Update integration tests to cover navigation and history API (#53799)
This commit updates the router integration tests to cover both the
classic History and the new Navigation API. There is more work to be
done here, but this commit works to prove the efficacy of the
`FakeNavigation` implementation.

PR Close #53799
2024-01-09 12:56:47 -08:00
Joey Perrott
1be6b0a58a fix(common): remove unused parameters from the ngClass constructor (#53831)
Remove unused parameters which were only being kept because of a downstream usage in flex layout which is deprecated and end of life

PR Close #53831
2024-01-08 14:38:50 -08:00
Kristiyan Kostadinov
dd052dc0d6 fix(common): server-side rendering error when using in-memory scrolling (#53683)
Fixes that the `BrowserViewportScroller` was throwing an error during server-side rendering because it was accessing `window` directly. Also removes some assertions that aren't necessary anymore.

Fixes #53682.

PR Close #53683
2024-01-03 10:28:55 -08:00
arturovt
29c5416d14 fix(common): remove load on image once it fails to load (#52990)
This commit adds an `error` listener to image elements and removes both
`load` and `error` listeners once the image loads or fails to load. The `load`
listener would never have been removed if the image failed to load.

PR Close #52990
2023-11-20 08:58:06 -08:00
Pawel Kozlowski
6c8776ff71 fix(core): limit rate of markers invocations (#52742)
This PR assures that the performance markers are invoked
only once for a given feature.

Closes #52524

PR Close #52742
2023-11-09 19:58:26 +00:00
Tom Wilkinson
029edea32a refactor(common): Update packages/common/src/navigation/platform_navigation.ts (#52363)
Co-authored-by: Andrew Scott <atscott01@gmail.com>

PR Close #52363
2023-11-09 18:01:33 +00:00
Thomas Wilkinson
27f5eed017 refactor(common): Add fake implementation of PlatformNavigation. (#52363)
This implementation does most, but not all, of the things the native
Navigation API does. Also adds a spec that tests all the currently
supported behaviors.

PR Close #52363
2023-11-09 18:01:33 +00:00
Thomas Wilkinson
77770c6d5b refactor(common): Add a new platform_navigation that provides the Navigation API. (#52363)
This allows using the Navigation API in Angular packages like Router.

PR Close #52363
2023-11-09 18:01:33 +00:00
Alan Agius
93d32a9acb fix(core): guard usages of performance.mark (#52505)
While `performance.mark` is available on all supported browsers and node.js version this API is not available in JSDOM which is used by Jest and Cloudflare worker.

This commit, updates the usage to a safer variant.

PR Close #52505
2023-11-03 07:43:36 -07:00
Alex Castle
f86fb8eb03 fix(common): apply fixed_srcset_width value only to fixed srcsets (#52459)
add logic to NgOptimizedImage to keep fixed_srcset_width from applying to large responsive images, which is incorrect behavior

PR Close #52459
2023-10-31 14:57:19 -07:00
Alvaro Junqueira
56598a16a7 docs: the Component import is not being used (#52323)
PR Close #52323
2023-10-25 09:35:21 -07:00
Alex Castle
e33a0ff3dd docs(common): add preconnect generation to NgOptimizedImage docs (#52248)
add a note on automated preconnect generation to the NgOptimizedImage docs' preconnect section, and add a related FAQ entry.

PR Close #52248
2023-10-24 09:26:06 -07:00
Alex Castle
8fff07cf53 refactor(common): use performance API for NgOptimizedImage feature logging (#52205)
add a standard performance marker that can be viewed in Chrome dev tools and other tooling. See more info
at https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark

PR Close #52205
2023-10-19 09:39:06 -07:00
cexbrayat
b1cb0b395b fix(common): missing space in ngSwitch equality warning (#52180)
This adds a missing space between the sentences of the `===` vs `==` ngSwitch warning.

PR Close #52180
2023-10-12 15:44:46 +02:00
Pawel Kozlowski
28a5925f53 fix(common): use === operator to match NgSwitch cases (#51504)
This change adjust the equality comparator used by NgSwitch - now it
defaults to === from previously used ==. This change is based on the
following reasoning:
- align behaviour with the built-in switch block);
- improve performance (avoid type coercion);
- enable better type-checking.

BREAKING CHANGE:

the NgSwitch directive now defaults to the === equality operator,
migrating from the previously used ==. NgSwitch expressions and / or
individual condition values need adjusting to this stricter equality
check. The added warning message should help pinpointing NgSwitch
usages where adjustements are needed.

Fixes #33873

PR Close #51504
2023-10-09 10:10:21 -07:00