30600 Commits

Author SHA1 Message Date
Dylan Hunn be6c246115 release: cut the v18.1.3 release 18.1.3 2024-07-31 10:17:09 -07:00
Andres Olivares 69b5a317ec refactor(devtools): Use Chrome DevTools Performance extension API (#55805)
This change is a proof of concept of how the new Chrome DevTools
Performance extension API (https://bit.ly/rpp-e11y) can be used to
surface Angular runtime data directly in the Chrome DevTools Performance
panel.

Specifically, it implements the following changes:

1. Use the profiling status notification API to toggle the Timing API:
The notification API is implemented under the
chrome.devtools.performance extension namespace and consits of two
events: ProfilingStarted and ProfilingStopped, dispatched when the
Performance panel has started and stopped recording, respectively. This
API is used to enable the Timings API when the recording has started in
the Performance panel and disable it when recording has stopped.

2. Use the User Timings `detail` field format specification of the
Performance extension API
(https://developer.mozilla.org/en-US/docs/Web/API/Performance_API/User_timing)
to inject data collected by the Angular Profiler into the
Performance panel timeline. Angular Profiler uses several hooks to
measure framework tasks like change detection. With this change, this
measurements are visible in the same context as the runtime data
collected by the browser in the Performance Panel timeline.

Note: to enable the user timings to be collected in the first place, one
needs to open the Angular DevTools panel so that the related artifacts
are loaded in the page. This shortcoming can be fixed in a follow up so
that the extra step isn't necessary.

PR Close #55805
2024-07-31 16:04:53 +00:00
Paul Gschwendtner 7459d09a23 ci: update license checking to latest version (#57211)
This may help with detecting the license of google-protobuf- which
is a transitive dependency of `@bazel/worker`

PR Close #57211
2024-07-31 16:04:13 +00:00
Paul Gschwendtner 2ece9509a0 test: update symbol golden after lock file maintenance (#57211)
Lock file maintenance updated Terser, which impacts the bundle
optimizations being tested via the symbol golden tests.

There was a small noticable change in the symbol golden where
`withDomHydration` is now preserved, and the underlying function
that was previously detected is gone. Seemingly Terser now inlines
this function and had to preserve `withDomHydration` as the entry point.

PR Close #57211
2024-07-31 16:04:13 +00:00
Paul Gschwendtner 722a4669b9 build: lock file maintenance (#57211)
See associated pull request for more information.

PR Close #57211
2024-07-31 16:04:13 +00:00
Paul Gschwendtner b3cc9e9c3b build: replace deprecated inquirer with new npm package (#57211)
The new package comes with types by default, and also has a nicer
API.

The old package had broken types and couldn't be used anymore; and
it's deprecated/unmaintained. We did a similar switch in
angular/dev-infra.

PR Close #57211
2024-07-31 16:04:13 +00:00
Matthieu Riegler 103a4dccdc docs(docs-infra): extract captured group from heading custom id regexp (#57206)
Backport of angular/dev-infra#2202

PR Close #57206
2024-07-31 16:03:28 +00:00
Angular Robot eadfa39767 build: update scorecard action dependencies (#57150)
See associated pull request for more information.

PR Close #57150
2024-07-31 14:00:40 +00:00
Jeremy Elbourn ec4bac0a3a docs: add docs authoring guide (#56505)
This new contributor guide includes information for authoring Angular
documentation.

PR Close #56505
2024-07-31 13:58:53 +00:00
Badshah d16071a5a0 docs: fix appRoutes constant was not passed correctly to provideRouter (#57070)
PR Close #57070
2024-07-31 13:58:21 +00:00
Kristiyan Kostadinov 1f9e090910 fix(compiler-cli): emitting references to ngtypecheck files (#57138) (#57202)
Follow-up to #56961 which doesn't appear to have caught all the cases. This change moves the pre-emit untagging to `NgCompiler.prepareEmit` which seems to cover a bit more comared to `NgtscProgram.emit`.

Fixes #57135.

PR Close #57138

PR Close #57202
2024-07-31 13:57:37 +00:00
Andrew Scott 62ade76cf8 refactor(core): Update callback schedulers to cancel pending timers (#57186)
Rather than leaving the timers around as no-ops, this commit updates the
logic to also attempt to clear or cancel the timers. This is helpful for
the eventual goal of running the scheduler in the `fakeAsync` zone (if
the test is running in `fakeAsync`) rather than scheduling in the root
zone and making it impossible to flush.

PR Close #57186
2024-07-30 18:05:09 +00:00
Andrew Scott 0def76f3b3 refactor(core): Private option to rethrow ApplicationRef.tick errors in tests (#57153)
This creates a private option that can be used internally while we
migrate this to the default and only behavior. ~200 tests in TGP have errors
that are being swallowed (console.log) and not causing the test to fail.
We can first explicitly opt those out, flip the default internally, then
"fix" them by adding expect...toThrow.

PR Close #57153
2024-07-30 18:04:27 +00:00
Bouguima, Walid 0fbcd6ed28 docs: broken HammerLoader reference fix (#55836)
*Fixing broken documentation reference to HammerLoader in HammerLoaderInjectionToken page

PR Close #55836
2024-07-30 16:56:34 +00:00
David LJ 0016849ca1 docs: update app shell model link (#57162)
PR Close #57162
2024-07-30 16:55:43 +00:00
Paweł Kubiak e5e5fedf54 fix(docs-infra): skip navigation to card if user clicks on anchor (#57081)
fix(docs-infra): skip navigation to card if user clicks on anchor

If user clicks on anchor inside member card (Reference) then skip navigation to card section and allow to navigate to anchor link.

Use correct RxJs operator.
Fix DI: destroy ReferenceScrollHandler when navigate outside of reference pages.

fix: scroll to the of the card only after click on card header
fix: remove import of filter operator

PR Close #57081
2024-07-30 16:52:43 +00:00
Enea Jahollari 352fa3d8ad docs: fix formatting and highlighting issues (#57144)
PR Close #57144
2024-07-30 16:52:10 +00:00
Andrew Scott b0657bcce9 docs: More updates to components scenarios guide (#57052)
PR Close #57052
2024-07-30 16:51:11 +00:00
Angular Robot 130ff94400 build: update all non-major dependencies (#57178)
See associated pull request for more information.

PR Close #57178
2024-07-30 16:44:42 +00:00
Kristiyan Kostadinov eaa83f9d27 fix(core): hydration error in some let declaration setups (#57173)
Fixes that we were throwing an assertion error during hydration if a `@let` declaration is used before and immediately inside of a container.

Fixes #57160.

PR Close #57173
2024-07-30 16:43:46 +00:00
Sheik Althaf 6489397b99 refactor(devtools): use signal apis in injection and router tree (#57047)
Refactor the injection and router tree components to use signal apis, in future we can make the components onPush and zoneless

PR Close #57047
2024-07-30 16:42:15 +00:00
David LJ 15e0214037 docs: update ng generate command references (#57161)
PR Close #57161
2024-07-30 16:41:39 +00:00
Joey Perrott 81b30dcef0 refactor(docs-infra): migrate @angular/docs from dev-infra into adev directory (#57132)
To increase the ease of development we are moving @angular/docs into the adev directory within this repo. While
we are doing this to improve our development experience in the short term, efforts are also in place
to maintain a division between this @angular/docs (shared) code and adev itself, so that it can be extracted
back out in the future when components is ready to leverage it as well.

PR Close #57132
2024-07-30 15:51:27 +00:00
David LJ 9304c45313 docs: fix invalid link formatting in sw config (#57170)
PR Close #57170
2024-07-29 13:52:24 -07:00
Angular Robot f2a97f4f95 build: update dependency @babel/generator to v7.25.0 (#57152)
See associated pull request for more information.

PR Close #57152
2024-07-29 13:50:15 -07:00
Andrew Scott f7ab04018e fix(core): errors during ApplicationRef.tick should be rethrown for zoneless tests (#56993)
The behavior of `ComponentFixture` for zoneless tests was decided somewhat through guesswork, trial, and error. In addition, working on the zoneless fixture revealed oddities in the behavior of the zone-based fixture, or behaviors that we felt were counterintuitive. The most consequential difference is how change detection works: `detectChanges` goes through ApplicationRef.tick in zoneless while it is `changeDetectorRef.detectChanges` in the zone fixture.

We felt that running change detection through `ApplicationRef.tick` was important for several reasons:
* Aligning application behavior more closely with the test behavior (almost all views are attached to application ref in reality)
* Ensuring that afterRender* hooks are executed when calling `fixture.detectChanges`
* Ensuring that the change detection runs again if render hooks update state

This change, however, has some noticeable consequences that will break some tests, mostly around how errors are handled. `ApplicationRef.tick` catches errors that happen during change detection and reports them to the ErrorHandler from DI. The default error handler only logs the error to the console. This will break tests which have `expect(() => fixture.detectChanges()).toThrow()`. In addition, it allows tests to pass when there are real errors encountered during change detection.

This change ensures that errors from `ApplicationRef.tick` are rethrown
and will fail the test. We should also do a follow-up investigation to
determine whether we can/should also do this for the zone-based
`ComponentFixture`.

fixes #56977

PR Close #56993
2024-07-29 13:49:01 -07:00
Aristeidis Bampakos 61367000e4 docs: use new blog in links of new documentation (#56052)
PR Close #56052
2024-07-29 13:48:37 -07:00
Tyler Hendrickson 6f15006648 docs: improve spelling and grammar for error NG0956 (#57164)
PR Close #57164
2024-07-29 13:48:06 -07:00
Matthieu Riegler b9a46bcd64 docs(docs-infra): fix visual glitch, (#57172)
When on a certain width, the tab-bar width glitch back-and-forth and forcing the 2 other buttons to reduce their width. This glitches appeared when we introduced that 2nd button.

fixes #57143

PR Close #57172
2024-07-29 13:47:38 -07:00
Kristiyan Kostadinov 31dea066d6 fix(compiler): reduce chance of conflicts between generated factory and local variables (#57181)
Currently we use some short variable names like `t` and `r` in the generated factory functions. They can conflict with local symbols with the same names, if they're used for DI.

These changes add a `ɵ` to the generated variables to reduce the chance of conflicts.

Fixes #57168.

PR Close #57181
2024-07-29 13:46:48 -07:00
marktechson 481092da4d docs: add open in IDX support (#57099)
This change adds a menu to the in-browser code editor on adev and adds the option for open in IDX.

PR Close #57099
2024-07-26 10:02:57 -07:00
Andrew Scott 8df60d4713 fix(docs-infra): only run matchMedia on client (#57121)
Use afterNextRender to avoid running matchMedia on the server

PR Close #57121
2024-07-26 10:00:55 -07:00
Andrew Scott 58ee039d5e release: cut the v18.1.2 release 18.1.2 2024-07-24 10:53:25 -07:00
Matthieu Riegler 3d0ee73892 docs(docs-infra): Use shiki for code highlighting (#57059)
PR Close #57059
2024-07-24 10:24:52 -07:00
Matthieu Riegler 8bb5937e71 docs(docs-infra): disable experimental decorators (#56257)
Also enable useDefineForClassFields and disable downlevelIteration

PR Close #56257
2024-07-24 10:18:22 -07:00
Andrew Scott c969422da0 Revert "fix(router): Scroller should scroll as soon as change detection completes (#55105)" (#57115)
This reverts commit 66ffeca2de.

It looks like nuxt encountered the same issue with scrolling when
waiting for Vue's `nextTick`, which is a microtask. This would have
similar timing to ZoneJS's rendering in the microtask queue. This
reverts to a `setTimeout` alone, though recreates the problem in #53985.
This was also mentioned in one of the comments in the Nuxt issue and the
solution would be `rAF`.

In order to address #53985, we'd likely want to use the `race(rAF, setTimeout)`
that we use in the zoneless and coalescing schedulers. This would have effectively the same timing as
the `afterNextRender` implementation here with zoneless, but quite
different timing to `afterNextRender` with ZoneJS.

fixes #57109

PR Close #57115
2024-07-24 10:04:38 -07:00
Tom Wilkinson 1a606b0bfc refactor(core): Switch to using concat rather than spread operator for events. (#57103)
Internally, the JSCompiler does not dead code eliminate this code when its using spread.

PR Close #57103
2024-07-23 15:54:23 -07:00
Andrew Scott 288a4fac01 test(docs-infra): fix test with slight adjustment to error handling (#57104)
The test was broken because multiple errors happen and the last error would be the displayed message.
However, in this case, those errors happen because the initial one already terminated the container
so the follow-up errors are a result of the service being in an unexpected state

PR Close #57104
2024-07-23 15:45:55 -07:00
Andrew Scott 889a02b1c3 test(docs-infra): update adev tests to be zoneless (#57100)
Updates adev tests to use zoneless and remove
fakeAsync/waitForAsync/tick

PR Close #57100
2024-07-23 14:50:32 -07:00
Angular Robot 23fa43d044 build: update all non-major dependencies (#57092)
See associated pull request for more information.

PR Close #57092
2024-07-23 12:18:34 -07:00
Angular Robot c979dfd462 build: update github/codeql-action action to v3.25.13 (#57091)
See associated pull request for more information.

PR Close #57091
2024-07-23 10:29:17 -07:00
Andrew Scott 915b0e0b16 Revert "fix(compiler-cli): add warning for unused let declarations (#57033)" (#57088)
This reverts commit c76b440ac0.

PR Close #57088
2024-07-22 15:28:04 -07:00
JoostK 463945003d fix(compiler): limit the number of chained instructions (#57069)
Some Angular template instructions that follow each other may be chained
together in a single expressions statement, containing a deeply nested
AST of call expressions. The number of chained instructions wasn't previously
limited, so this could result in very deep ASTs that cause stack overflow
errors during TypeScript emit.

This commit introduces a limit to the number of chained instructions to
avoid these problems.

Closes #57066

PR Close #57069
2024-07-22 11:50:12 -07:00
Rushikesh Kavar 06ae22680e docs: Update packages/router/src/router.ts (#57053)
Co-authored-by: Andrew Scott <atscott01@gmail.com>
PR Close #57053
2024-07-22 10:52:36 -07:00
Rushikesh Kavar f917b6e4d0 docs: Update packages/router/src/router.ts (#57053)
Co-authored-by: Andrew Scott <atscott01@gmail.com>
PR Close #57053
2024-07-22 10:52:36 -07:00
Rushikesh Kavar 87d042ba8a docs: adding reference to RouterModule.forroot method in Router service for better understanding for beginner (#57053)
PR Close #57053
2024-07-22 10:52:36 -07:00
Rushikesh Kavar 4b561f8f35 docs: Adding Router service hierarchical injection level (#57053)
PR Close #57053
2024-07-22 10:52:36 -07:00
Kristiyan Kostadinov b9fb98c67c fix(core): tree shake dev mode error message (#57035)
Adds an `ngDevMode` check before a runtime error message.

Fixes #57034.

PR Close #57035
2024-07-22 10:49:18 -07:00
xpl0siv 8a005eada5 docs: fix push-notifications.md (#57065)
Added missing comma at actions notifications example.
SyntaxError:
Expected ',' or ']' after array element in JSON at position 255

PR Close #57065
2024-07-22 10:46:56 -07:00
Salanoid ae15dd94ef docs: fixing dead link (#57077)
Fixing guide dead link for issue #57067.

PR Close #57077
2024-07-22 09:58:42 -07:00