9194 Commits

Author SHA1 Message Date
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
Derek Cormier 4199a8db08 build(bazel): fix missing dgeni dependencies
Fixes the 'Export has no declarations: unknown' warning and
unresolved type warnings.
2022-11-22 13:51:19 -07:00
Derek Cormier 500acfcf98 build(bazel): create AIO example playgrounds for manual testing
After the bazel migration, AIO examples are no longer fully formed in
the source tree.
2022-11-22 13:51:19 -07:00
Derek Cormier 8df1deaad5 build(bazel): list docs entrypoints under packages to simplify docgen
target

Follows pattern in @angular/components.
2022-11-22 13:51:19 -07:00
Derek Cormier 19fe298d11 build(bazel): merge aio/tools/defaults.bzl and tools/defaults.bzl
Detect the correct workspace for the source maps dep.
2022-11-22 13:51:19 -07:00
Derek Cormier 8062e7113f build(bazel): run aio firebase redirect tests under bazel
Adjust to run under ci.
2022-11-22 13:51:19 -07:00
Derek Cormier 8d24a91c6a build(bazel): refactor aio example e2es to fix windows performance
Use the same config flag to enable local vs npm deps as aio.
2022-11-22 13:51:19 -07:00
Derek Cormier a36034a135 build(bazel): stamp targets to build, test, and serve aio against
first party deps

Architect is not compatible with disabling the rules_nodejs linker so
these targets must use npm_link to link first party deps
2022-11-22 13:51:19 -07:00
Derek Cormier 12855f3805 build(bazel): incrementally run aio example e2e tests
Replaces the workflow where all example e2es are run at once
2022-11-22 13:51:19 -07:00
Derek Cormier c9478f78a2 build(bazel): add bazel targets for aio doc generation
This is an incremental step to produce dgeni output with bazel. The
generated outputs are not yet used by other targets.
2022-11-22 13:51:19 -07:00
Wooshaah cfc224983f docs(forms): fix typos in removeValidators and hasValidator usage notes (#48144)
PR Close #48144
2022-11-22 11:39:03 -08:00
Andrew Scott ebcca47402 refactor(router): Update RouterOutlet to not read internal route property (#48112)
The `RouterOutlet` currently reads the `_futureSnapshot` of the Route.
However, by the time `activateWith` is called, this value is the same as
`snapshot` (https://github.com/angular/angular/blob/414b1b2d5ffe8eac33749bf472af7eafcf248dba/packages/router/src/operators/activate_routes.ts#L163-L205).

This change will make it easier for developers to fork the `RouterOutlet`
implementation if necessary without needing to modify any code.

PR Close #48112
2022-11-22 11:37:38 -08:00
Andrew Scott 11d916dcfd refactor(router): Remove unnecessary logic in enabledBlocking option (#48064)
The `initNavigated` flag is not necessary. The way `enabledBlocking`
works is by blocking any navigations from finishing until the
application has bootstrapped. The bootstrap is unblocked as soon as we
hit the `afterPreactivation` step. After that point,
`afterPreactivation` is always unblocked because the `bootstrapDone`
Subject is completed/stopped. There is no need for an additional
variable to track this information.

PR Close #48064
2022-11-22 11:36:14 -08:00
Andrew Scott d50fa6b79e test(router): Update flaky tests to consistently pass (#48176)
This commit makes several updates to the bootstrap tests of the Router.
The change that made the real difference was providing
`MockPlatformLocation`. Other changes include:

* using `async/await` instead of `done`
* not providing APP_BASE_HREF (recent router refactors made this unnecessary)
* using some functional guards to simplify some tests

PR Close #48176
2022-11-22 11:33:19 -08:00
Kristiyan Kostadinov cc8b76ef7c fix(language-service): correctly handle host directive inputs/outputs (#48147)
Adds some logic to correctly handle hidden or aliased inputs/outputs in the language service.

Fixes #48102.

PR Close #48147
2022-11-22 09:47:49 -08:00
Nebojsa Cvetkovic fa5528fb5f fix(router): restore 'history.state' on popstate even if navigationId missing (#48033)
If `history.pushState()` or `history.replaceState()` were called manually without including the `navigationId` field the state was being incorrectly discarded - that logic was for maintaining the original behavior of `NavigationStart.restoredState`.

Improves on #28176, fully fixes #28108, see also #28954

PR Close #48033
2022-11-21 13:46:17 -08:00
Andrew Scott 930af9dd26 fix(common): Fix MockPlatformLocation events and missing onPopState implementation (#48113)
The MockPlatformLocation forward, back, and historyGo methods should trigger a popstate event.
Additionally, these events should just be synchronous since that's what the majority of the major
browsers do. Lastly, onPopState should be implemented the same way as onHashChange.

PR Close #48113
2022-11-21 13:45:06 -08:00