Commit Graph

29756 Commits

Author SHA1 Message Date
Sonu Kapoor 6fc2d3aea4 Update services.md 2024-03-29 16:34:01 +01:00
Andrew Scott 0b450ffa6f refactor(core): Move private export testing file to src (#55103)
This matches the private export approach for files in other packages.

PR Close #55103
2024-03-28 16:35:25 -07:00
Andrew Scott ac0a51ce3d refactor(core): Update SchedulingMode to be regular enum (#55103)
Angular recently gained a local compilation mode (see commit 345dd6d).
This is intended to be used with the TypeScript compiler option isolatedModules, which bans imports of const enums.

PR Close #55103
2024-03-28 16:35:24 -07:00
Matthieu Riegler d839c58031 docs(docs-infra): improve styling for deprecated CLI option (#54794)
Related to #54770

PR Close #54794
2024-03-28 15:48:22 -07:00
Matthieu Riegler 431fb9740d docs(docs-infra): add margin for command aliases (#54794)
PR Close #54794
2024-03-28 15:48:22 -07:00
Matthieu Riegler ec59b2fe74 docs(docs-infra): improve space between cli command options (#54794)
fixes #54767

PR Close #54794
2024-03-28 15:48:22 -07:00
Andrew Scott ea2d42507e refactor(core): Remove unused change detection flags (#55057)
This commit removes unused change detection flags.

PR Close #55057
2024-03-28 15:47:41 -07:00
Angular Robot 474b6c22da build: update dependency puppeteer-core to v22.6.1 (#55040)
See associated pull request for more information.

PR Close #55040
2024-03-28 15:46:46 -07:00
Allan Barrantes fac8d34edc docs: remove broken link from CONTRIBUTING.md (#54953)
PR Close #54953
2024-03-28 15:06:56 -07:00
Angular Robot d992be55e6 build: update eslint dependencies to v7.4.0 (#55041)
See associated pull request for more information.

PR Close #55041
2024-03-28 15:06:06 -07:00
Andrew Scott 22dd52f460 refactor(core): re-export private exports from testing (#55101)
This commit re-exports private exports  from testing package.

PR Close #55101
2024-03-28 13:54:16 -07:00
Andrew Scott f9417ea3a8 refactor(core): Privately export SchedulingMode enum (#55100)
Expose enum for early testers so they don't have to awkwardly put `0`
for Hybrid mode.

PR Close #55100
2024-03-28 13:15:03 -07:00
Andrew Scott edfc5a9c3b refactor(core): private export token to disable fixture.detectChanges error (#55098)
While we do want to discourage `fixture.detectChanges`, it is yet to be
determined how this should be accomplished (warning, documentation, etc.). At
the moment, not being able to disable the error at all is entirely
prohibitive for existing test suites to use zoneless change detection in
tests. We would much rather allow existing test suites to disable the
error and use the zoneless change detection than prevent them from using
it entirely until all the `detectChanges` calls have been fixed.
Calling `detectChanges` manually can hide errors related to change
detection timing, but it is even worse when the "PseudoApplication"
fixture used (since it runs change detection _only_ on the component
rather than through `ApplicationRef`).

PR Close #55098
2024-03-28 13:14:27 -07:00
Garrett Darnell b87b2fc05c docs(core): fix toSignal docs (#54964)
PR Close #54964
2024-03-28 13:06:43 -07:00
Angular Robot 40e41e4d33 build: update github/codeql-action action to v3.24.9 (#55039)
See associated pull request for more information.

PR Close #55039
2024-03-28 13:05:57 -07:00
Matthieu Riegler f523415203 docs: drop glossary links (#55044)
PR Close #55044
2024-03-28 13:02:50 -07:00
Ben Hong f911aef72a docs: fix outdated security guide reference (#55069)
PR Close #55069
2024-03-28 13:01:59 -07:00
Andrew Scott 914e4530b0 fix(core): test cleanup should not throw if Zone is not present (#55096)
The test hooks should not throw if applications choose not to load ZoneJS.

fixes #48198

PR Close #55096
2024-03-28 12:12:30 -07:00
Charles Lyding a48afe0d94 fix(language-service): avoid generating TS syntactic diagnostics for templates (#55091)
Angular's template files are not valid TypeScript. Attempting to get syntactic
diagnostics from the underlying TypeScript language service will result in
a large amount of false positive errors. Only actual TypeScript files should
be analyzed by the underlying TypeScript language service for syntactic errors.

PR Close #55091
2024-03-28 12:10:40 -07:00
Ben Hong d63706e9d6 docs: add missing h1 to page for skip to main content on home page (#55052)
PR Close #55052
2024-03-28 12:09:57 -07:00
JiaLiPassion ddbf6bb038 fix(zone.js): make sure fakeasync use the same id pool with native (#54600)
Close #54323

fakeAsync should use the same timerId pool with native, so they will not
conflict.

PR Close #54600
2024-03-28 10:30:25 -07:00
Dylan Hunn 6d14fc52b9 release: cut the v18.0.0-next.2 release 18.0.0-next.2 2024-03-28 10:05:21 -07:00
Dylan Hunn a64eca2a9a docs: release notes for the v17.3.2 release 2024-03-28 10:00:27 -07:00
Kristiyan Kostadinov 63688714ae fix(migrations): account for variables in imports initializer (#55081)
Fixes that the control flow migration was throwing an error if the `imports` of a component are initialized to an identifier.

Fixes #55080.

PR Close #55081
2024-03-28 09:40:31 -07:00
Matthieu Riegler f17134a7a4 docs: remove AIO guides (#54829)
PR Close #54829
2024-03-28 09:37:06 -07:00
Andrew Kushnir 86a359b399 fix(core): establish proper injector resolution order for @defer blocks (#55079)
This commit updates the `@defer` logic to establish proper injector resolution order. More specifically:

- Makes node injectors to be inspected first, similar to how it happens when `@defer` block is not used.
- Adds extra handling for the Router's `OutletInjector`, until we replace it with an `EnvironmentInjector`.

Resolves #54864.
Resolves #55028.
Resolves #55036.

PR Close #55079
2024-03-28 09:23:38 -07:00
Kristiyan Kostadinov 336916ceb0 refactor(compiler-cli): allow source file validator rule to produce a single diagnostic (#54993)
Allows for `SourceFileValidatorRule.checkNode` to produce a single diagnostic. The most common case should be one diagnostic per node so this allows us to save some array allocations.

PR Close #54993
2024-03-28 09:17:04 -07:00
Kristiyan Kostadinov 694ba79cbf fix(compiler-cli): report cases where initializer APIs are used in a non-directive class (#54993)
Expands the check for initializer APIs to also flag when the function is called on a class that isn't a component or directive.

PR Close #54993
2024-03-28 09:17:03 -07:00
Kristiyan Kostadinov 78188e877a fix(compiler-cli): add diagnostic if initializer API is used outside of an initializer (#54993)
Adds a rule that will produce a diagnostic when an initializer-based API is used outside of an initializer.

Fixes #54381.

PR Close #54993
2024-03-28 09:17:02 -07:00
Kristiyan Kostadinov 8226be6abf refactor(compiler-cli): introduce infrastructure for running additional checks against TypeScript files (#54993)
Adds the new `SourceFileValidator` that will be used to check for file-level issues that may prevent Angular from working, like invoking the `input()` function outside of an initializer. Currently only one check is planned, but this setup will allow us to easily add more in the future.

PR Close #54993
2024-03-28 09:17:01 -07:00
Kristiyan Kostadinov 3d9f01c6ec refactor(compiler-cli): add API to check if imports exist (#54993)
Adds a couple of APIs to the `ImportedSymbolsTracker` that allow us to quickly check if a specific symbol is imported in a file.

PR Close #54993
2024-03-28 09:17:00 -07:00
Matthieu Riegler 9a9ce0d419 refactor(devtools): prevent exeception on state serializer (#55061)
`Object.getPrototypeOf(obj)` returns `null` if `obj` is an empty object. `Object.getOwnPropertyDescriptors` throws on `null`/`undefined`

PR Close #55061
2024-03-28 09:14:23 -07:00
Andrew Scott e02bcf89cf fix(core): Fix clearing of pending task in zoneless cleanup implementation (#55074)
This commit fixes a mistake in #54952 where the first pending task was falsey because its ID is 0

PR Close #55074
2024-03-27 14:29:08 -07:00
Andrew Scott 80f96e7c51 refactor(core): Provide scheduler for use and coordination with zone change detection (#54952)
This commit makes the zoneless scheduler (privately) available to applications that
have ZoneJS-based change detection. This would catch any changes of
interest (signal updates, `markForCheck` calls, attaching `Dirty` views)
that happen outside the Angular Zone.

See #53844 for additional information about why this is important.
More details to come in the a future commit that makes this a public option.

PR Close #54952
2024-03-27 11:36:56 -07:00
Matthieu Riegler e523f27e67 docs: fix link to NPM release cycle page (#54793)
PR Close #54793
2024-03-27 11:33:09 -07:00
Matthieu Riegler 2a395f8917 docs: link to http security now at best-practices/security (#55060)
fixes #55058

PR Close #55060
2024-03-27 11:32:08 -07:00
Esteban Luchsinger 9e606093e6 docs: explain difference between @placeholder and @loading (#54779)
Add a sentence to the `@loading` block documentation that emphasizes more that the `@loading` block will replace the `@placeholder` block once the deferred view starts loading.

PR Close #54779
2024-03-27 11:09:15 -07:00
Andrew Scott 658cf8c384 fix(core): ComponentFixture stability should match ApplicationRef (#54949)
This change aligns the stability of `ComponentFixture` with that of
`ApplicationRef`, preventing confusing differences between the two as
more APIs start using the `PendingTasks` that may not be tracked by
`NgZone`.

BREAKING CHANGE: `ComponentFixture.whenStable` now matches the
`ApplicationRef.isStable` observable. Prior to this change, stability
of the fixture did not include everything that was considered in
`ApplicationRef`. `whenStable` of the fixture will now include unfinished
router navigations and unfinished `HttpClient` requests. This will cause
tests that `await` the `whenStable` promise to time out when there are
incomplete requests. To fix this, remove the `whenStable`,
instead wait for another condition, or ensure `HttpTestingController`
mocks responses for all requests. Try adding `HttpTestingController.verify()`
before your `await fixture.whenStable` to identify the open requests.
Also, make sure your tests wait for the stability promise. We found many
examples of tests that did not, meaning the expectations did not execute
within the test body.

In addition, `ComponentFixture.isStable` would synchronously switch to
true in some scenarios but will now always be asynchronous.

PR Close #54949
2024-03-27 11:01:28 -07:00
David Calawa 60f1d681e0 fix(router): preserve replaceUrl when returning a urlTree from CanActivate (#54042)
This commit will fix the issue of the setting of NavigationExtras.replaceUrl being lost when
returning a urlTree from a CanActivateFn.

Fixes #53503

BREAKING CHANGE: When a a guard returns a `UrlTree` as a redirect, the
redirecting navigation will now use `replaceUrl` if the initial
navigation was also using the `replaceUrl` option. If this is not
desirable, the redirect can configure new `NavigationBehaviorOptions` by
returning a `RedirectCommand` with the desired options instead of `UrlTree`.

PR Close #54042
2024-03-27 10:57:52 -07:00
Andrea Canciani f3b624553a refactor: fix a number of typos throughout the codebase (#55018)
Fix some typos detected using spellchecking tools, both in
documentation and in code (comments, identifiers).

PR Close #55018
2024-03-27 10:54:31 -07:00
vladboisa 42eab69a1f docs(docs-infra): replace link by HTTPsecurity tab (#55029)
Replace a broke link by content of HTTP Client Security Tab.

Fixes #54918 & #54922

PR Close #55029
2024-03-27 10:50:20 -07:00
Dmitrii Kuzmin 3650b3795f docs: added note about toSignal (#54996)
PR Close #54996
2024-03-27 10:49:37 -07:00
Matthieu Riegler b230bbc90d refactor(compiler): Do not extract internal methods. (#54850)
internal methods are not exposed to end users and should not be extracted.

PR Close #54850
2024-03-27 10:48:05 -07:00
JiaLiPassion e44b077cbd fix(zone.js): should not clear onhandler when remove capture listener (#54602)
Close #54581

Should not clear `onHandler` when remove capture event listeners.

PR Close #54602
2024-03-27 10:40:05 -07:00
Andrew Scott eae75ff3f9 fix(router): RouterLinkActive will always remove active classes when links are not active (#54982)
Previously, `RouterLinkActive` would only add or remove the active classes when
its active state changed. This means that if you accidentally add one of
the active classes to the static class attribute, it won't get removed
until the link becomes active and then deactives (because the class is
added at creation time and never removed until the `RouterLinkActive`
state changes from active to inactive).

fixes #54978

PR Close #54982
2024-03-27 10:16:16 -07:00
Charles Lyding f2a98cdce0 refactor(language-service): use native Array flatMap (#55011)
The custom flatMap implementation can now be removed as Array contains a
native implementation that is available for all supported Node.js versions.

PR Close #55011
2024-03-27 10:15:34 -07:00
Matthieu Riegler 14235b7f0c docs: update compat table with 17.3 (#54882)
PR Close #54882
2024-03-27 09:58:06 -07:00
Charles Lyding 4166dfc1b6 fix(language-service): prevent underlying TS Service from handling template files (#55003)
When the `angularOnly` option is disabled, the underlying TypeScript language service
was previously used for all files including `.html` template files. This can result in
incorrect responses including a large amount of invalid diagnostics for a template file.
Checks have now been added to only use the Angular Language service for template files
which can properly handle template files. Additionally, the check for a TypeScript file
name has now been expanded to encompass all current file extension forms.

PR Close #55003
2024-03-27 09:57:31 -07:00
Ben Hong 311f5527a6 docs: reduce confusion on tutorial intro and reorder how resources are introduced (#55051)
PR Close #55051
2024-03-27 09:56:42 -07:00
Doug Parker abd973d0bb release: bump Angular DevTools version to 1.0.12 (#55056)
Also fixes a typo in release docs for the Firefox `zip` command.

PR Close #55056
2024-03-27 09:55:36 -07:00