9210 Commits

Author SHA1 Message Date
Konstantin Kharitonov bf44dc234a fix(common): Update Location to support base href containing origin (#48327)
In case `APP_BASE_HREF` is set including `origin` the further usage of it might cause failure

e.g.
If an app is placed on `https://example.com` and bundles are on `https://cdn-example.com` you have to set `APP_BASE_HREF` up as `https://example.com/` and build the app with `--base-href` as `https://cdn-example.com/` but it does not work because of the bug

Fixes #48175

PR Close #48327
2022-12-07 09:18:01 -08:00
Angular Robot 7df1989940 build: update cross-repo angular dependencies (#47882) (#48384)
See associated pull request for more information.

PR Close #47882

(cherry picked from commit 7c4e9ce5c0)

PR Close #48384
2022-12-07 09:09:30 -08:00
Angular Robot 6b6bf6332b build: update all non-major dependencies (#48372) (#48384)
See associated pull request for more information.

PR Close #48372

(cherry picked from commit 126573d76b)

PR Close #48384
2022-12-07 09:09:30 -08:00
Alan Agius cb7365a7bd refactor(compiler): replace flatten and map with flatMap. (#48378)
Replace custom `flatten` and `map` with native `flatMap` usage.

Benchmark:
| Test case name 	| Result                                                 	|
|----------------	|--------------------------------------------------------	|
| flatten & map  	| flatten & map x 1,182 ops/sec ±2.18% (63 runs sampled) 	|
| flatMap        	| flatMap x 6,011 ops/sec ±0.91% (35 runs sampled)       	|

The fact that `flatMap` is faster is also highlighted in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap

PR Close #48378
2022-12-07 09:08:26 -08:00
Kristiyan Kostadinov e4dcaa513e fix(core): unable to inject ChangeDetectorRef inside host directives (#48355)
When injecting the `ChangeDetectorRef` into a node that matches a component, we create a new ref using the component's LView. This breaks down for host directives, because they run before the component's LView has been created.

These changes resolve the issue by creating the LView before creating the node injector for the directives.

Fixes #48249.

PR Close #48355
2022-12-07 09:06:46 -08:00
Alan Agius c0d04175ff refactor(core): simplify array flatten logic (#48358)
We can now use modern Javascript to get the same result.

PR Close #48358
2022-12-06 12:48:42 -08:00
dario-piotrowicz 9a5d84249a fix(compiler): make sure selectors inside container queries are correctly scoped (#48353)
improve the emulated shadowDom implementation so that it can correctly
scope selectors present inside the @container at-rule (recently added
to the css specs)

resolves #48264

PR Close #48353
2022-12-06 09:59:00 -08:00
Alan Agius 40d6a06615 refactor(core): remove old AJD workaround for G3 (#48363)
This workaround does not seem to be needed any longer.

PR Close #48363
2022-12-06 09:14:24 -08:00
Alan Agius 0b04da1fd7 refactor(core): remove several private utils and APIs (#48357)
These APIs are no longer used.

PR Close #48357
2022-12-05 14:35:10 -08:00
Alan Agius a4c82ba25b refactor(compiler): remove unused projection const (#48357)
`projection` const is unused in `serializePlaceholderValue`.

PR Close #48357
2022-12-05 14:35:09 -08:00
Alan Agius 28b0b89cb2 refactor(common): remove unused setDOM (#48357)
Remove unused `setDOM` method is unused.

PR Close #48357
2022-12-05 14:35:09 -08:00
Alex Castle 50b1c2bf52 fix(common): Don't generate srcsets with very large sources (#47997)
Fix an issue where users could inadvertently generate very large source images in ngOptimizedImage

PR Close #47997
2022-12-05 12:12:14 -08:00
Andrew Scott 06c34cd99a refactor(router): Remove assignExtraOptionsToRouter helper function (#48313)
This commit removes the unnecessary `assignExtraOptionsToRouter` helper
function. This helper is not necessary because the options can be
retrieved from DI and assigned during the construction on the Router.

PR Close #48313
2022-12-05 12:01:57 -08:00
Andrew Scott 58e55495f2 refactor(router): Eliminate constructor parameters in Router class (#48313)
The Router constructor and `setupRouter` factory mainly exist as a
legacy configuration. Since the Router's creation, the style in Angular
has evolved quite a bit. This commit eliminates and cleans up some
unnecessary comlicated code paths related to the router
constructor/factory.

Note that there are edits to the `setupTestingRouter` that could be seen
as breaking. However, it is not for several reasons:

1. The function is documented as a factory function. If used as
   documented, the parameters should match what's available in DI
2. The function is totally unused by the Router itself and is not used
   in g3 either. I believe it was made publicApi by an error when
   updating documentation annotations long ago.

PR Close #48313
2022-12-05 12:01:57 -08:00
Alan Agius 2af638818a refactor(platform-browser): simplify flattenStyles method (#48293)
With this change we simplify the `flattenStyles` logic using modern JavaScript.

PR Close #48293
2022-12-02 11:36:13 -08:00
Andrew Scott 167bc0d163 fix(compiler-cli): Produce diagnostic rather than crash when using invalid hostDirective (#48314)
Because the language service uses the compiler, we try to produce as
much useful information as possible rather than throwing hard errors.
Hard errors cause the compiler to crash. While this can be acceptable
when compiling a program as part of a regular build, this is undesirable
for the language service.

PR Close #48314
2022-12-01 13:43:31 -08:00
Pawel Kozlowski d933b17170 refactor(core): remove debug data structures (#48281)
This commit removes several debug data structures from
the framework runtime. The data structures in question
were introduced in the framework in the past with the
idea of having debugging aid in the form of the human-redable
data structures. It turned out that in practice those
data structures were not used (most of the fwk developers
didn't even know about their existence!), yet we kept
paying the price of maintaining those duplicated (prod
and debug) version of the data structures.

PR Close #48281
2022-11-30 09:27:59 -08:00
Andrew Scott 2a445923ee refactor(router): Remove DeprecatedLoadChildren (#48292)
This option has already been removed from availability externally. Internally, the last use has been removed
for the type on Route.loadChildren. More testing will be necessary to verify nothing relies on the other
code paths.

PR Close #48292
2022-11-30 08:29:11 -08:00
Andrew Scott 82756e8a5f refactor(router): Move navigationId handling to the transition manager (#48257)
The navigationId is really just a count of how many navigations have been
processed through the navigation pipeline. This tracking should be
done as part of the navigation transition handler

PR Close #48257
2022-11-29 14:55:53 -08:00
Andrew Scott 60af2d091c refactor(router): Move transition subject into transition handler (#48257)
The navigation transitions subject belongs in the navigation transitions handler
rather than the Router.

PR Close #48257
2022-11-29 14:55:53 -08:00
Andrew Scott 92066f162d refactor(router): directly inject internal properties from DI (#48257)
Rather than accessing router internal properties that are available in DI,
this commit directly injects those dependencies in the navigation transition
handler. Note that there are several other items that _should_ be injectable
in DI (like the TitleStrategy) but because those are part of the Router public
interface and writeable(!), they might be changed during runtime. We
have to get these other items from the Router for now...

PR Close #48257
2022-11-29 14:55:53 -08:00
Andrew Scott 0a36f4fbc8 refactor(router): Get EnvironmentInjector directly in transition handler (#48257)
Remove the NgModuleRef from the internal interface of the Router. This
was only used to get the injector (equivalent to EnvironmentInjector).
Instead, the navigation transition handler can directly inject the
EnvironmentInjector

PR Close #48257
2022-11-29 14:55:53 -08:00
Andrew Scott 8e46fb5676 refactor(router): Move configLoader to transition handler (#48257)
The ConfigLoader is only used as part of the navigation transition.
Moving the loader there completes the removal of event triggering in
the router code. This all now lives in the transition handler (plus
the router scroller, but let's ignore that...).

PR Close #48257
2022-11-29 14:55:53 -08:00
Andrew Scott f36cf49330 refactor(router): Move events subject to transition class (#48257)
The events observable is part of the lifecycle of a navigation. This should
be contained in the NavigationTransitions class rather than the Router.
This Subject is re-exported by the router as an observable to maintain
the public API

PR Close #48257
2022-11-29 14:55:52 -08:00
Andrew Scott 2409dd6530 refactor(router): remove malformedUriHandler from interface passed to transitions (#48257)
The malformedUriHandler is not used during the navigation transition and can be removed form the interface

PR Close #48257
2022-11-29 14:55:52 -08:00
Rokas Brazdžionis bec0007c82 docs: update date pipe default timezone injection token reference (#48274)
replace deprecated `DATE_PIPE_DEFAULT_TIMEZONE` with `DATE_PIPE_DEFAULT_OPTIONS`
PR Close #48274
2022-11-29 09:40:28 -08:00
Andrew Scott a192dea677 Revert "refactor(router): remove malformedUriHandler from interface passed to transitions (#48257)" (#48270)
This reverts commit c20a7eeba6.

PR Close #48270
2022-11-28 16:58:53 -08:00
Andrew Scott d29cbe885c Revert "refactor(router): Move events subject to transition class (#48257)" (#48270)
This reverts commit f88559eb48.

PR Close #48270
2022-11-28 16:58:53 -08:00
Andrew Scott 1eef647236 Revert "refactor(router): Move configLoader to transition handler (#48257)" (#48270)
This reverts commit 8c8ded8d31.

PR Close #48270
2022-11-28 16:58:53 -08:00
Andrew Scott 9745fac73f Revert "refactor(router): Get EnvironmentInjector directly in transition handler (#48257)" (#48270)
This reverts commit 03519968c0.

PR Close #48270
2022-11-28 16:58:52 -08:00
Andrew Scott 7032bf0780 Revert "refactor(router): directly inject internal properties from DI (#48257)" (#48270)
This reverts commit ce38759f54.

PR Close #48270
2022-11-28 16:58:52 -08:00
Andrew Scott 88aec875c0 Revert "refactor(router): Move transition subject into transition handler (#48257)" (#48270)
This reverts commit 0d88348430.

PR Close #48270
2022-11-28 16:58:52 -08:00
Andrew Scott f2d20d5c50 Revert "refactor(router): Move navigationId handling to the transition manager (#48257)" (#48270)
This reverts commit ea114a0034.

PR Close #48270
2022-11-28 16:58:52 -08:00
Matthieu Riegler c0601db72c test(core): remove some ViewEngine related test code (#48238)
Some tests had comments relating to ViewEngine that were not needed anymore since VE was dropped.

PR Close #48238
2022-11-28 13:08:23 -08:00
Matthieu Riegler aa920aa89a refactor(router): remove non-null assertions (#48244)
As part of #24571, removing non-null assertions (where appropriate)

PR Close #48244
2022-11-28 13:07:59 -08:00
Andrew Scott ea114a0034 refactor(router): Move navigationId handling to the transition manager (#48257)
The navigationId is really just a count of how many navigations have been
processed through the navigation pipeline. This tracking should be
done as part of the navigation transition handler

PR Close #48257
2022-11-28 11:54:43 -08:00
Andrew Scott 0d88348430 refactor(router): Move transition subject into transition handler (#48257)
The navigation transitions subject belongs in the navigation transitions handler
rather than the Router.

PR Close #48257
2022-11-28 11:54:43 -08:00
Andrew Scott ce38759f54 refactor(router): directly inject internal properties from DI (#48257)
Rather than accessing router internal properties that are available in DI,
this commit directly injects those dependencies in the navigation transition
handler. Note that there are several other items that _should_ be injectable
in DI (like the TitleStrategy) but because those are part of the Router public
interface and writeable(!), they might be changed during runtime. We
have to get these other items from the Router for now...

PR Close #48257
2022-11-28 11:54:43 -08:00
Andrew Scott 03519968c0 refactor(router): Get EnvironmentInjector directly in transition handler (#48257)
Remove the NgModuleRef from the internal interface of the Router. This
was only used to get the injector (equivalent to EnvironmentInjector).
Instead, the navigation transition handler can directly inject the
EnvironmentInjector

PR Close #48257
2022-11-28 11:54:43 -08:00
Andrew Scott 8c8ded8d31 refactor(router): Move configLoader to transition handler (#48257)
The ConfigLoader is only used as part of the navigation transition.
Moving the loader there completes the removal of event triggering in
the router code. This all now lives in the transition handler (plus
the router scroller, but let's ignore that...).

PR Close #48257
2022-11-28 11:54:43 -08:00
Andrew Scott f88559eb48 refactor(router): Move events subject to transition class (#48257)
The events observable is part of the lifecycle of a navigation. This should
be contained in the NavigationTransitions class rather than the Router.
This Subject is re-exported by the router as an observable to maintain
the public API

PR Close #48257
2022-11-28 11:54:43 -08:00
Andrew Scott c20a7eeba6 refactor(router): remove malformedUriHandler from interface passed to transitions (#48257)
The malformedUriHandler is not used during the navigation transition and can be removed form the interface

PR Close #48257
2022-11-28 11:54:43 -08:00
Andrew Scott 621013af2a refactor(router): move lastSuccesfulNavigation to navigation transitions (#48257)
lastSuccessfulNavigation is only used in the transition so it does not need to live in Router

PR Close #48257
2022-11-28 11:54:43 -08:00
Kristiyan Kostadinov 458d62b7b8 build: update angular version of in-memory-web-api (#48218)
Bumps up the required Angular version of `angular-in-memory-web-api` to 15.

Fixes #48197.

PR Close #48218
2022-11-28 09:13:47 -08:00
Alan Agius 1e483ebe18 refactor(platform-server): remove Injector dependency for initDominoAdapter factory (#48231)
The injector is not used by this factory.

PR Close #48231
2022-11-28 09:12:36 -08:00
Alan Agius dab7198a1f refactor(core): remove unused private APIs (#48234)
Remove private code which is not used by the Framework.

PR Close #48234
2022-11-28 09:11:26 -08:00
JoostK 86a21f5569 fix(compiler-cli): accept inheriting the constructor from a class in a library (#48156)
The stricter checks under `strictInjectionParameters` in Angular 15 now enforce that
an inherited constructor must be compatible with DI, based on whether all parameters
are valid injection tokens. There is an issue when the constructor is inherited from
a class in a declaration file though, as information on the usage of `@Inject()` is
not present within a declaration file. This means that this stricter check cannot be
accurately performed, resulting in false positives.

This commit disables the stricter check to behave the same as it did prior to
Angular 15, therefore avoiding the false positive.

Fixes #48152

PR Close #48156
2022-11-23 12:10:37 -08:00
Kristiyan Kostadinov 665d4650cd refactor(language-service): make selector nullable (#48193)
This is a follow-up from https://github.com/angular/angular/pull/48147. Changes the `DirectiveSymbol.selector` to be nullable since it's possible to have directives without a selector.

PR Close #48193
2022-11-23 09:27:03 -08:00
Andrew Scott dc23ad4978 refactor(router): extract navigation transition code to a new file (#48187)
This commit extracts the Router's navigation "transitions" to a separate
file. The goal here is twofold:

- Separate the Router's logic into more manageable chunks. Rather than
  having to always edit a 1000+ line file, this separates different
  pieces into smaller, more focused files
- More importantly, this sets the groundwork for separating the Router
  state from the individual navigation transition. That is, it would be
  good for the rxjs pipeline to _not_ modify the Router state but only
  keep track of its own intermediate stages and emit outwards during
  important events. The Router can subscribe to those events and make
  updates to its state. This would theoretically allow us to swap those
  implementations independently. That is, the Router's state management
  can be changed without changing the transition handling and
  vice-versa.

PR Close #48187
2022-11-22 18:58:38 -08:00
Joey Perrott 8600b3077d build: reformat BUILD files
Reformat BUILD file usage of globs.
2022-11-22 13:51:19 -07:00