Commit graph

25621 commits

Author SHA1 Message Date
Bob Watson
2e2135bf18 docs: add missing documentation setup instructions (#48174)
PR Close #48174
2022-11-22 11:39:25 -08:00
Wooshaah
7fbb53f52d docs(forms): fix typos in removeValidators and hasValidator usage notes (#48144)
PR Close #48144
2022-11-22 11:39:02 -08:00
Matthieu Riegler
5127a4d5ed refactor(platform-browser): Remove ViewEncapsulation.Native warning (#48101)
ViewEncapsulation.Native has been dropped in v11, let's remove this warning.

PR Close #48101
2022-11-22 11:38:25 -08:00
Andrew Scott
83f0b7b7b2 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` (414b1b2d5f/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
bc148c30d5 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
73f03ad2d2 feat(router): Add new NavigationSkipped event for ignored navigations (#48024)
The Router currently silently ignores navigations for two reasons:

1. By default, same URL navigations are ignored. When this situation is
   encountered, the navigation is ignored without any events
2. A `UrlHandlingStrategy` may ignore some URLs. For situations when the
   strategy returns `false` for `shouldProcessUrl`, the Router silently
   ignores the URL and updates its internal state without running
   matching, guards, or resolver logic.

This commit adds new `NavigationSkipped` events for the above two situations.

PR Close #48024
2022-11-22 11:34:49 -08:00
Andrew Scott
ffc427bffc 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:18 -08:00
Alan Agius
57a9f67ae8 docs: fix dates in release guide (#48173)
A version always stays for about a year in LTS.

PR Close #48173
2022-11-22 11:32:01 -08:00
Kristiyan Kostadinov
fd2eea5961 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
mgechev
c5d176ceb5 docs: add state of javascript banner (#48160)
PR Close #48160
2022-11-22 09:45:42 -08:00
Dylan Hunn
b0bc5783a7
docs: release notes for the v12.2.17 release 2022-11-22 09:44:22 -08:00
Nebojsa Cvetkovic
1976e37475 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
Ikko Ashimine
4ce9650ce4 docs: fix typo in navigation.json (#48127)
documenation -> documentation
PR Close #48127
2022-11-21 13:45:51 -08:00
Andrew Scott
b0a62bea47 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:05 -08:00
Ivan Rodriguez
f376bf8deb docs: fix typo in cli-builder.mf (#48129)
Replace `@example/my-builder` with `@example/my-builder`
PR Close #48129
2022-11-21 13:44:41 -08:00
Joe Roxbury
29b198f0c9 docs(forms): add FormRecord class to API summary (#48136)
Add the missing FormRecord class to the
Reactive forms API summary which is located under Developer Guides ->
Forms -> Reactive Forms.

Fixes #47808

PR Close #48136
2022-11-21 13:44:17 -08:00
Alan Agius
80d0cb5b5b docs: add version 15 to active version (#48148)
With this change we update the releases docs to include version 15 as an active version and mark version 14 as an LTS.

Closes #48116

PR Close #48148
2022-11-21 13:43:45 -08:00
Dylan Hunn
ed50032316 docs: release notes for the v13.3.12 release 2022-11-21 13:16:28 -08:00
Dylan Hunn
6618b25426 docs: release notes for the v14.2.12 release 2022-11-21 12:55:25 -08:00
Andrew Scott
0a8b943d10 Revert "refactor(router): Remove promise catch and re-reject (#48067)" (#48135)
This reverts commit 07c9396824. This
change caused test failures (both unit and integration). Though the code
looks like it should be a no-op update, it's possible it affecting
something to do with microtasks, zoneJS, and change detection. More
investigation would need to be done into the exact nature of the
failures.

PR Close #48135
2022-11-21 09:24:00 -08:00
Andrew Scott
02fb43a347 Revert "Revert "refactor(router): Simplify router defaults by making the defaults Injectable" (#48121)" (#48135)
This reverts commit 57d9296802. The
original commit was not problematic and was mistakenly reverted.

PR Close #48135
2022-11-21 09:24:00 -08:00
Mikhail Savchuk
b653ee340e docs: fix typo in image-directive.md (#48115)
PR Close #48115
2022-11-18 12:17:13 -08:00
Joey Perrott
8d81fcbe20 build: add labeled trigger for assistant-to-the-branch-manager (#48119)
Add the labeled trigger

PR Close #48119
2022-11-18 12:16:48 -08:00
Dylan Hunn
57d9296802 Revert "refactor(router): Simplify router defaults by making the defaults Injectable" (#48121)
This reverts commit 18033d5ed2.

PR Close #48121
2022-11-18 12:16:17 -08:00
Greg Magolan
764fa3d9c3 fix(language-service): update packages/language-service/build.sh script to work with vscode-ng-language-service's new Bazel build (#48120)
Part of fix for angular/vscode-ng-language-service#1815

PR Close #48120
2022-11-18 10:21:05 -08:00
Bjarki
414b1b2d5f docs: extract XSS security doc URL into a constant (#48082)
We plan to change the link in google3 to point to google3-specific
documentation. Replacing a single constant will make for a smaller and
more maintainable patch.

PR Close #48082
2022-11-17 13:21:16 -08:00
Volodymyr
8a45dab754 docs: Changed documentation for providers vs. viewProviders (#47281)
Content in ```<ng-content></ng-content>``` sees ```viewProviders``` from ```app-root```

PR Close #47281
2022-11-17 13:20:20 -08:00
Matthieu Riegler
d321880440 fix(forms): FormBuilder.group return right type with shorthand parameters. (#48084)
Extract AbstractControlOptions from type when used in shorthand parameters on FormBuilder.group

Fixes 48073

PR Close #48084
2022-11-17 11:04:54 -08:00
Andrew Scott
1df0ed7d6e fix(router): Ensure renavigating in component init works with enabledBlocking (#48063)
The way to complete the `Subject` in a way that is able to be read on
the subject properties itself is to call `unsubscribe`:
afac3d5743/src/internal/Subject.ts (L101-L104)
This sets the `closed` property to `true` whereas `complete` does not.

fixes #48052

PR Close #48063
2022-11-17 11:01:13 -08:00
Dylan Hunn
ef6dbc8850 refactor(compiler): Add getPotentialPipes API method. (#48090)
`getPotentialPipes` returns possible pipes which can be used in the provided context, whether already in scope or requiring an import.

This is necessary to implement auto-import support for pipes in the language service.

PR Close #48090
2022-11-17 11:00:50 -08:00
Andrew Scott
b16d33293a docs(router): Further document rawUrlTree (#48108)
Further document the rawUrlTree and how it's used internally in the Router.

PR Close #48108
2022-11-17 11:00:27 -08:00
Kristiyan Kostadinov
779a76fa5a fix(forms): don't mutate validators array (#47830)
Fixes that the `AbstractControl` was mutating the validators arrays being passed into the constructor an helper methods like `setValidators`.

Fixes #47827.

PR Close #47830
2022-11-17 09:36:14 -08:00
Matthieu Riegler
f8f8928210 fix(devtools): prevent devTools to load when not text/html document (#48021)
On Firefox, Angular DevTools was breaking the XML display because of the script injected
Based on contentType, we won't inject that script anymore

Fixes #48017

PR Close #48021
2022-11-17 09:35:40 -08:00
Matthieu Riegler
b51929a394 fix(router): correct type of nextState parameter in canDeactivate (#48038)
Correct type of nextState parameter in canDeactivate guard to indicate it's never undefined

Fixes #47153

PR Close #48038
2022-11-17 09:35:02 -08:00
Pawel Kozlowski
1e561f9d86 refactor(core): remove usage of the useCapture arg to the listener instruction (#48046)
The useCapture argument of the listener instruction was only
meaningful in the Renderer3 case. Since the Renderer3 code was
removed this argument has no use. Note that we can perform
additional cleanup and remove the useCapture argument from the
listener instruction (this would require change to the instruction
signature, though).

PR Close #48046
2022-11-17 09:34:30 -08:00
Pawel Kozlowski
89f044375f refactor(core): remove Renderer3-related cleanup code paths (#48046)
Renderer3 had to store reference to the listener function in order to
properly cleanup event listeners. Since the Renderer3 abstraction was
removed the corresponding code path is no longer needed (Renderer2
returns a cleanup function that can be called directly).

PR Close #48046
2022-11-17 09:34:30 -08:00
Joey Perrott
b592cdab53 build: update action version (#48058)
Update to the latest version of the assistant to the branch manager action

PR Close #48058
2022-11-17 09:33:49 -08:00
George Kalpakas
79bd0f1e96 build(docs-infra): upgrade cli command docs sources to 6ccbc6b4c (#48076)
Updating [angular#main](https://github.com/angular/angular/tree/main) from
[cli-builds#main](https://github.com/angular/cli-builds/tree/main).

##
Relevant changes in
[commit range](23b229e89...6ccbc6b4c):

**Modified**
- help/build.json
- help/generate.json

##
Relevant changes in
[commit range](22d1977c5...6ccbc6b4c) since PR #48018:

**Modified**
- help/build.json

##
Closes #48018

PR Close #48076
2022-11-17 09:32:06 -08:00
Angular Robot
80e3c28995 build: update dependency @nguniversal/builders to v15 (#48093)
See associated pull request for more information.

PR Close #48093
2022-11-17 09:30:51 -08:00
Andrew Scott
0a8b8a66cd docs(router): Deprecate public members of Router that are meant to be configured elsewhere (#48006)
None of the public properties of the `Router` are meant to be writeable.
They should all be configured using other methods, all of which have been
documented.

DEPRECATED: router writable properties

The following strategies are meant to be configured by registering the
application strategy in DI via the `providers` in the root `NgModule` or
`bootstrapApplication`:
* `routeReuseStrategy`
* `titleStrategy`
* `urlHandlingStrategy`

The following options are meant to be configured using the options
available in `RouterModule.forRoot` or `provideRouter`.
* `onSameUrlNavigation`
* `paramsInheritanceStrategy`
* `urlUpdateStrategy`
* `canceledNavigationResolution`

The following options are available in `RouterModule.forRoot` but not
available in `provideRouter`:
* `malformedUriErrorHandler` - This was found to not be used anywhere
  internally.
* `errorHandler` - Developers can instead subscribe to `Router.events`
  and filter for `NavigationError`.

PR Close #48006
2022-11-17 09:26:20 -08:00
Andrew Scott
02b18dc5b0 refactor(router): Simplify router defaults by making the defaults Injectable (#48022)
The router has several default strategy implementations that are either
assigned via `new XStrategy()` property assignements or via the factory
function for the `Router` itself. These can be simplified by providing
the default implementation in the strategy `Injectable`. Custom
implementations can still override the defaults by specifying them in
the `providers` list.

Notably, this change also makes the `UrlHandlingStrategy` and
`RouteReuseStrategy` defaults injectable via DI rather than having to
indirectly grab them by going through the `Router` instance and
accessing the properties.

PR Close #48022
2022-11-17 09:25:40 -08:00
Andrew Scott
6732618399 refactor(router): remove unused currentRawUrl property from transition (#48067)
The currentRawUrl property of the transition is no longer used after various refactorings in the code over
the past couple years

PR Close #48067
2022-11-17 09:25:05 -08:00
Andrew Scott
07c9396824 refactor(router): Remove promise catch and re-reject (#48067)
It is not clear what the intention of the promise catch and reject is. Potentially this is
legacy code built around some ZoneJs bug that doesn't exist anymore.

PR Close #48067
2022-11-17 09:25:05 -08:00
Dylan Hunn
192207ec9a refactor(language-service): Move some quick fix code into a shared file (#48074)
The `fix_missing_import` quick fix has several generic helper functions that deal with imports and decorators, which I want to reuse for other import-related features. Move these functions into `ts_utils.ts` instead. No substantive code changes are present.

PR Close #48074
2022-11-16 17:46:24 -08:00
Bob Watson
032a488d02 docs: add info about v15 changes and update process (#47951)
PR Close #47951
2022-11-16 16:13:30 -08:00
Jessica Janiuk
c9cb0c014f docs: Add v15 release blog post link to changelog (#48094)
PR Close #48094
2022-11-16 14:36:10 -08:00
Jessica Janiuk
893ec32726 docs: release notes for the v15.0.0 release 2022-11-16 09:49:00 -08:00
Jessica Janiuk
174c0dbaea docs: release notes for the v14.2.11 release 2022-11-16 09:20:27 -08:00
Jeremy Elbourn
fc4714113c docs: add host directives guide (#48057)
PR Close #48057
2022-11-15 20:36:59 +00:00
Jessica Janiuk
38b2ed314d docs: release notes for the v15.0.0-rc.4 release 2022-11-14 12:09:20 -08:00