Commit graph

36863 commits

Author SHA1 Message Date
arturovt
6adf022f0d fix(service-worker): prevent duplicate fetches during concurrent update checks (#61443)
Previously, multiple simultaneous calls to `checkForUpdate()` could result in redundant
fetches and hashing of the update manifest, leading to unnecessary network and CPU usage.

This change introduces a mechanism to track an in-progress update check using a cached
promise (`ongoingCheckForUpdate`). Subsequent calls to `checkForUpdate()` while a check
is in progress will return the same promise instead of triggering a new request.

Once the check completes (successfully or not), the cached promise is cleared,
allowing future update checks to proceed normally.

This improves efficiency and prevents overlapping update logic in applications that
may invoke `checkForUpdate()` from multiple sources (e.g. polling, manual triggers).

PR Close #61443
2025-06-03 15:57:30 -04:00
arturovt
c67dbda8ff feat(service-worker): support notification closes (#61442)
In this commit, support for `notificationclose` events has been added to the service worker Driver.

When a notification is closed (either by user dismissal or programmatically), the Driver now captures the event, extracts the relevant notification options, and broadcasts a `NOTIFICATION_CLOSE` message to clients. This ensures the application is aware of notification lifecycle events and can react accordingly.

PR Close #61442
2025-06-03 15:02:12 -04:00
Matthieu Riegler
c6f470e5ae docs(docs-infra): fix tutorial tooltip (#61782)
The code editor tooltip exhibits some weird bug when there is a margin applied. The root issue is unknown but at least it improves the current situation.

fixes #60923

PR Close #61782
2025-06-03 13:58:31 -04:00
Angular Robot
5813dbdd2a build: lock file maintenance (#61813)
See associated pull request for more information.

PR Close #61813
2025-06-03 11:13:30 -04:00
Kristiyan Kostadinov
b1f3d2eab8 refactor(compiler): replace output AST write nodes (#61682)
Similarly to the previous change to the expression AST, these changes replace the `WriteVarExpr`, `WriteKeyExpr` and `WritePropExpr` from the output AST with a binary expression. This is closer aligned to TypeScript and makes it easier to translate code between the two.

PR Close #61682
2025-06-03 11:08:50 -04:00
Kristiyan Kostadinov
eb43e9242d refactor(compiler): account for new assignment AST (#61682)
Reworks the places that were depending on `PropertyWrite` and `KeyedWrite` to account for the new AST structure.

PR Close #61682
2025-06-03 11:08:50 -04:00
Kristiyan Kostadinov
08ee693995 refactor(compiler): produce binary expressions instead of dedicated write ones (#61682)
Currently our expression parser produces two different expressions for writes: `PropertyWrite` (e.g. `foo.bar = 123`) or `KeyedWrite` (e.g. `foo[0] = 123`). This is inconsistent with other ASTs, like TypeScript's, where writes are represented as binary expressions with a `=` operator and it makes it difficult to implement more write operators like `??=`, because we'd essentially have to duplicate them.

These changes switch the expression parser over to produce binary expressions instead.

PR Close #61682
2025-06-03 11:08:50 -04:00
zachend
c663277df6 fix(service-worker): update service worker to handle seeking better for videos (#60029)
This update ensures that the service worker can handle range requests, allowing video seeking to work correctly when videos are delivered by the service worker.

PR Close #60029
2025-06-03 10:56:06 -04:00
Milo
4fa1dca72a feat(devtools): add getSignalGraph api to devtools protocol (#61548)
add a new devtools backend api getSignalGraph that emits a
latestSignalGraph to the devtools frontend

PR Close #61548
2025-06-03 10:47:57 -04:00
Angular Robot
e83621b97a build: update rules_angular digest to 8c799e8 (#61841)
See associated pull request for more information.

PR Close #61841
2025-06-03 10:36:46 -04:00
Angular Robot
23ad649908 build: update cross-repo angular dependencies (#61703)
See associated pull request for more information.

PR Close #61703
2025-06-03 10:34:03 -04:00
Shuaib Hasan Akib
b2df1f699e docs(docs-infra): add language service for Zed (#61482)
PR Close #61482
2025-06-03 10:30:25 -04:00
Matthieu Riegler
e555c7f0dd docs(docs-infra): use modern apis (#61706)
PR Close #61706
2025-06-03 10:28:20 -04:00
Angular Robot
eead42196a build: update ossf/scorecard-action action to v2.4.2 (#61842)
See associated pull request for more information.

PR Close #61842
2025-06-03 08:22:50 -04:00
Angular Robot
667a600607 build: update dependency yargs to v18 (#61767)
See associated pull request for more information.

PR Close #61767
2025-06-03 07:34:08 -04:00
Matthieu Riegler
9630d79d1a refactor(migrations): keep the control flow migration as ng generate. (#61773)
this way `ng generate @angular/core:control-flow` which has been fairly documented, remains valid.

PR Close #61773
2025-06-03 07:12:59 -04:00
hawkgs
e5e0c777b7 refactor(devtools): defer tabs (#61241)
Defer tab loading and rendering on app initialization.

PR Close #61241
2025-06-03 07:10:56 -04:00
Pawel Kozlowski
4af4a1aca3 docs: documentation for the Chrome DevTools integration (#61690)
Initial version of the documentation describing integration with the
Chrome DevTools performance panel.

PR Close #61690
2025-06-03 07:04:37 -04:00
Paul Gschwendtner
3af65af6a1 build: remove npm_package rule for packages/bazel (#61826)
The bazel npm package is no longer needed and currently breaks
as we started using a 1P pnpm linked package that would otherwise
end up being pulled into this legacy rule.

PR Close #61826
2025-06-03 11:41:52 +02:00
Paul Gschwendtner
b7c5645f05 build: migrate packages/compiler-cli to ts_project (#61826)
This commit migrates the remaining pieces of `compiler-cli` to
`ts_project`. This involves a few more things during migration:

- the `ng_module` ngc_wrapped rule broke as part of this change, so we
  switched it to `ts_project` too. This logic is soon gone anyway.

- we needed an extra pnpm "package.json" for the linker babel test. This test is
  loading from the real compiler-cli npm package. Babel needs a real
  node module for this, so this solution seems reasonable. It may be
  worth exploring in the future to move this test into an integration
  test though.

- the older integrationtest in compiler-cli is removed as the coverage
  is much better with the compliance test suite and this test.

PR Close #61826
2025-06-03 11:41:52 +02:00
Oussama BADR
42f07ce2f6 docs: Use signal function to read value in CustomDialog example (programmatic-rendering.md) (#61821)
PR Close #61821
2025-06-02 16:05:49 -04:00
Kristiyan Kostadinov
fd5a04927e fix(compiler): recover invalid parenthesized expressions (#61815)
When the expression parser consumes tokens inside a parenthesized expression, it looks for valid tokens until it hits and invalid one or a closing paren. If it finds an invalid token, it reports and error and tries to recover until it finds a closing paren. The problem is that in such cases, it would produce the `ParenthesizedExpression` and continue parsing **from** from the closing paren which would then produce more errors that add noise to the output and result in an incorrect representation of the user's code. E.g. `foo((event.target as HTMLElement).value)` would be recovered to `foo((event.target)).value` instead of `foo((event.target).value)`.

These changes resolve the issue by skipping over the closing paren at the recovery point.

Fixes #61792.

PR Close #61815
2025-06-02 15:50:46 -04:00
Matthieu Riegler
07cb321f00 build: remove ng_update_migration integration test. (#61825)
The CLI already covers this in their E2E tests.

PR Close #61825
2025-06-02 15:45:45 -04:00
Andrew Scott
0e58e1f642 docs(router): Update view transition types to dev preview (#61787)
This updates the documented state of the view transition interfaces. The withViewTransitions feature was already marked dev preview

PR Close #61787
2025-06-02 12:42:19 -04:00
Vincent
155e2842fc docs: Add Angular 20 migration instructions for changes in resources (#61772)
PR Close #61772
2025-06-02 12:38:34 -04:00
AleksanderBodurri
170211cb71 fix(devtools): issue where on initial render DevTools would not load properly (#61812)
Commit 3e70d64 introduced cdk version 20.0.0-rc2 which introduced a change to how the cdk virtual scroll sets some internal state.

Previously in DevTools we were using a computed incorrectly to respond to changes in the directive forest and apply them to the underlying datasource. With the change to the CDK shown above, this incorrect usage caused us to attempt to update underlying signals in the virtual scroll directive while within a computed callback, throwing an error.

This commit corrects our usage by swapping from a computed to an effect, allowing the underlying signals in the scroll directive to be updated without error.

PR Close #61812
2025-06-02 12:36:17 -04:00
Kristiyan Kostadinov
5a76826d26 fix(compiler): only report parser errors on invalid expression (#61793)
Currently we reuse the same binding parser for all expressions in the template. Under the hood, the parser has a single `errors` array that it passes into all ASTs which means that if there's one binding with an error, those errors will be propagated to all other ASTs in the template.

These changes switch to having a unique `errors` array for each AST so we only report errors once.

Relates to #61792.

PR Close #61793
2025-06-02 09:56:00 -04:00
Paul Gschwendtner
bf763d089c build: ensure optimization rule can use compiler-cli from HEAD (#61810)
This ensures that the new optimization rule, and also adev (when we
complete migrating it to `rules_js`) can use the latest compiler-cli
version from HEAD.

PR Close #61810
2025-06-02 09:52:57 -04:00
Vadim
db1fc5713d docs(docs-infra): example causes RuntimeError: NG0950: Input is required but no value is available yet (#61785)
PR Close #61785
2025-06-02 09:49:37 -04:00
Jens Kuehlers
744a1fa075 docs: point v20 banner to blog (#61824)
PR Close #61824
2025-06-02 09:41:34 -04:00
Milo
6f16d92988 feat(devtools): inspect signals (#61540)
add a new global api for the devtools connector to jump to the source of
a computed or effect

PR Close #61540
2025-06-02 09:35:30 -04:00
Matthieu Riegler
f8b4b1209a docs: update llms files (#61791)
PR Close #61791
2025-06-02 09:31:49 -04:00
marktechson
532cd3214b docs: add Using AI development page (#61790)
PR Close #61790
2025-06-02 09:26:37 -04:00
Kristiyan Kostadinov
a70f03a9b4 fix(compiler): move defer trigger assertions out of parser (#61747)
When defer blocks have a reference-based trigger without a parameter, we infer it from the placeholder block. This requires some validations like ensuring that there's only one element in the placeholder. The validations are currently implemented at the parser level which can affect tools like linters that need to pass `preserveWhitespaces: true` in order to get accurate source mappings.

These changes move the validations into the template type checker so that they still get flagged, but much later in the process. Moving them over involves a bit more work, because the template type checker also sets `preserveWhitespaces: true`.

Fixes #61725.

PR Close #61747
2025-05-30 13:44:58 -04:00
Doug Parker
5ccc654810 docs: fix component harness indentation and comments (#61760)
Component harness docs code snippets seem to have been a bit corrupted.

PR Close #61760
2025-05-30 13:37:55 -04:00
Kristiyan Kostadinov
3c5ab643e4 build: add missing symbol (#61783)
Fixes a broken symbol test.

PR Close #61783
2025-05-30 13:34:45 -04:00
Angular Robot
194eb11e62 build: update rules_angular digest to e0f7af7 (#61780)
See associated pull request for more information.

PR Close #61780
2025-05-30 13:27:31 -04:00
Paul Gschwendtner
77d2a7c977 build: migrate all modules/... code to ts_project (#61779)
Migrates all `modules/...`  code to `ts_project`.

PR Close #61779
2025-05-30 11:14:58 -04:00
Andrew Kushnir
5fce27d63f fix(core): produce an error when incremental hydration is expected, but not configured (#61741)
This commit updates runtime logic to produce an error when there are some `@defer` blocks with `hydrate` triggers, but the incremental hydration is not enabled via `withIncrementalHydration()`. Previously the check was only detecting the case when `withIncrementalHydration()` is present on the server, but missing on the client. With the change in this commit, the check would be performed on the server as well.

PR Close #61741
2025-05-30 11:14:22 -04:00
Matthieu Riegler
bddfd2f8c2 docs: fix deprecated docs navigation background color. (#61775)
Backport of #58848 into v19 / main.

PR Close #61775
2025-05-30 11:09:13 -04:00
Kristiyan Kostadinov
bb88b3f22f fix(migrations): avoid trailing whitespaces in unused imports migration (#61698)
Follow-up to #61674 where we were leaving behind some whitespace, e.g. `[One, Two, Three]` would turn into `[One ]`. These changes only preserve the whitespace if the node is preceded by a newline.

This wasn't caught by tests, because they were stripping away whitespaces before asserting. I've also reworked the tests to be sensitive to formatting changes.

PR Close #61698
2025-05-30 11:07:20 -04:00
Matthieu Riegler
221c07c58d docs: restore routing with matcher (#61778)
Let's restore that page until we rewrite that part.

fixes #61771

PR Close #61778
2025-05-30 11:05:02 -04:00
Doug Parker
2f0ecfc8ef refactor: expand DevTools reviewer list (#61709)
Updates the current list of DevTools reviewers to make a few small changes.
1. Adds `hawkgs` and `milomg`.
2. Removes the leading `~` from `JeanMeche` to include him in automatic review requests.
3. Adds `jkrems` for additional Googler coverage in automatic review requests.
4. Removes `mgechev` and `MarkTechson` who haven't been involved in daily DevTools development for a while.
5. Adds the leading `~` to `devversion` and `josephperrott` to remove them from automatic review requests while leaving them with access for "break glass" situations.

Note that the leading `~` means that the individual may approve PRs and satisfy the group's requirement, but PullApprove will not automatically request a review from them. See https://v3-docs.pullapprove.com/config/reviewers/#reviewers-that-dont-want-review-requests.

PR Close #61709
2025-05-30 09:56:09 -04:00
Kristiyan Kostadinov
75b7cd4cac build: update bundle goldens (#61718)
Updates out of date goldens.

PR Close #61718
2025-05-30 09:53:37 -04:00
Kristiyan Kostadinov
29e5e045f9 refactor(core): add DOM-only listener instruction (#61718)
Adds the `domListener` instruction which allows us to listen only to DOM events while skipping the directive output logic.

PR Close #61718
2025-05-30 09:53:37 -04:00
Kristiyan Kostadinov
78fba14f88 refactor(core): split directive logic away from common template code (#61718)
Reworks the `declareTemplate` function, that we use both in the `template` instruction and in other template-based code like control flow and `@defer`, so that it's split up into a function with directive logic and one without. For anything except the `template` instruction we don't need the directive matching and lifecycle hook logic.

Also introduces a DOM-only instruction called `domTemplate`.

PR Close #61718
2025-05-30 09:53:37 -04:00
Kristiyan Kostadinov
7520cd141c refactor(core): add DOM-only element and container instructions (#61718)
Adds the new `domElement` and `domElementContainer` instructions that are the equivalent of the `element` and `elementContainer` instructions, but will allow us to skip the following overhead when we know that there are no directives:
* Directive matching.
* Directive instantiation.
* Lifecycle hook management.
* Content query execution.

PR Close #61718
2025-05-30 09:53:36 -04:00
Kristiyan Kostadinov
cb8ff45c0c refactor(core): move directive logic out of shared element code (#61718)
Moves the logic that deals with matching and instantiating directives out of the shared element instruction code.

PR Close #61718
2025-05-30 09:53:36 -04:00
Kristiyan Kostadinov
4ed6d4ac33 refactor(compiler-cli): export type used by migrations (#61697)
Re-exports the `FileSystem` type since it's used by some tsurge migrations and because internally the barrel export from `ngtsc/file_system` is removed.

PR Close #61697
2025-05-30 09:50:58 -04:00
Sumit Arora
582fedd726 refactor(devtools): fixing PR comments and adding unit tests (#59999)
- Update code to fix PR comments and cleanup code
- Add unit tests for the new code

PR Close #59999
2025-05-30 09:48:12 -04:00