René's URL Explorer Experiment


Title: [Feature request]: Resource based suspense with @await blocks in @boundary · Issue #72140 · angular/angular · GitHub

Open Graph Title: [Feature request]: Resource based suspense with @await blocks in @boundary · Issue #72140 · angular/angular

X Title: [Feature request]: Resource based suspense with @await blocks in @boundary · Issue #72140 · angular/angular

Description: Which @angular/* package(s) are relevant/related to the feature request? core, compiler, compiler-cli, router, common, platform-server Description Builds on: @boundary / @error (developer preview, 22.2) resource() Router resources (devel...

Open Graph Description: Which @angular/* package(s) are relevant/related to the feature request? core, compiler, compiler-cli, router, common, platform-server Description Builds on: @boundary / @error (developer preview, ...

X Description: Which @angular/* package(s) are relevant/related to the feature request? core, compiler, compiler-cli, router, common, platform-server Description Builds on: @boundary / @error (developer preview, ...

Opengraph URL: https://github.com/angular/angular/issues/72140

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Feature request]: Resource based suspense with @await blocks in @boundary","articleBody":"### Which @angular/* package(s) are relevant/related to the feature request?\n\ncore, compiler, compiler-cli, router, common, platform-server\n\n### Description\n\n**Builds on:**\n- `@boundary` / `@error` (developer preview, 22.2)\n- `resource()`\n- Router resources (developer preview, 22.2)\n- Router error boundaries (developer preview, 22.3)\n\n**Scope:** compiler, template syntax, runtime (render3), resource and input types, router integration, DevTools\n\n> Implementation notes and prior art (React Suspense, Solid 2.0, the router precedents) are in the first comment, to keep this body within GitHub's size limit.\n\n#### 1. Summary\n\nThis proposal adds **coordinated loading states** to Angular templates. It extends the existing `@boundary` error boundary, so the same block that catches errors also manages pending data. It has three parts:\n\n1. **The `@await` block.** A template block that unwraps one or more resources into plain values. Inside the block, the values have their loaded type, not `T | undefined`. The block registers its resources with the nearest boundary. Its content renders, and later updates, only when the resources are ready.\n2. **A `@pending` block on `@boundary`.** The `@pending` block is the fallback. A boundary that has a `@pending` block coordinates every `@await` registered below it. It reveals them together, keeps stale content on screen while they refresh, and resets when the content's identity changes (`track`). It also exposes a `$pending` context variable.\n3. **Configuration.** `provideBoundaries()` sets app-wide defaults for timing in core. In the router, `withBoundaries()` combines today's error options with pending coordination at each `\u003crouter-outlet>`.\n\n```html\n@boundary (track userId(); let refreshing = $pending) {\n  @if (refreshing) { \u003capp-progress-bar /> }\n\n  @await (user = userResource; posts = feedResource) {\n    \u003ch1>{{ user.name }}\u003c/h1>\n    \u003capp-feed [posts]=\"posts\" />\n  }\n} @pending (after 150ms; minimum 400ms) {\n  \u003capp-skeleton />\n} @error (let e; reset = $reset) {\n  \u003capp-error [error]=\"e\" (retry)=\"reset()\" />\n}\n```\n\nSuspension is **explicit**. A resource only takes part when it is read through `@await`. Reading `resource.value()` directly behaves as it does today. Angular's signal graph does not change: pending and error stay properties of the resource object, not hidden state in the graph.\n\n#### 2. Motivation\n\n##### 2.1 The problem today\n\nResources made async data first-class in Angular. Each resource exposes `value()`, `status()`, `error()`, `isLoading()`, `hasValue()` and `snapshot()`. Every template that reads a resource handles those states itself, which leads to the following problems.\n\n- **Loading-state sprawl.** Each component writes its own `@if (res.isLoading())` and `@if (res.error())` branches. A page with five resources shows five spinners that appear and disappear independently.\n- **Inconsistent states on screen (tearing).** When a resource reloads, parts of the UI that depend on it update at different times. A header can show the new user while a sibling list still shows the previous user's data.\n- **Flashing.** Reloads that resolve quickly make spinners flash. A new request clears a resource's value, so content that depends on it disappears and the layout jumps.\n- **No coordination across components.** Resources are often created or injected several components deep. Showing one fallback for a section means passing loading signals up through inputs and outputs. For resources injected through DI, that wiring doesn't exist at all.\n- **`T | undefined` everywhere.** Without a `defaultValue`, `value()` is `T | undefined`. Templates fill up with `?.` and `@if (res.hasValue())` guards, even in areas that only make sense once the data is ready. A `defaultValue` removes `undefined` from the type, but templates then show the default (for example an empty list) as if it were data while loading.\n- **Errors are handled separately from loading.** `@boundary` already catches resource errors, because `value()` throws in the error state. It knows nothing about pending state, so loading and error handling are written in two different ways.\n- **Non-blocking route data flashes.** When a `nonBlocking()` route resource's params change on navigation, the new request clears its value, and the page flashes ([#70809](https://github.com/angular/angular/issues/70809)).\n  - The maintainers' answers were to use a blocking resource, or to keep the previous value with a snapshot in userland. They noted that the router has no opinion on how the transition should look, and that keeping old values would be \"very incorrect for many situations\", for example \"showing data for /user/1 after navigation to /user/2 is complete\". Suspense and transitions were mentioned in passing; the suggested mitigation was a `waitFor` option ([PR #70539](https://github.com/angular/angular/pull/70539)).\n  - The choice between keeping old content and showing a placeholder belongs to a specific area of UI, which neither the router nor the resource knows about. Whatever that area chooses, it must never show data for a different route (§5.6).\n\n##### 2.2 What Angular already coordinates, and where it stops\n\nAngular already provides coordination, freezing and fallback UI, but only at the router level:\n\n- **Route-level coordination.** Router resources (`withRouterResources()`, `Route.resources`) load in parallel across the matched route hierarchy. By default they are *blocking*: the router waits for them before activating the route, and the component receives a plain `T`.\n- **Freezing during navigation.** While a navigation is pending, resources on `ActivatedRoute` show the state they had when the navigation started. The previous screen stays stable until the navigation commits or is rolled back.\n- **Error fallbacks at the outlet.** Router error boundaries (`withErrorBoundaries()`, `Route.errorComponent`) replace a failed routed component with a fallback component.\n\nNone of these reach below the outlet. Once a route is active, component-owned resources, non-blocking route resources and refreshes that happen without a navigation have no coordination, no freezing and no shared fallback. This proposal brings the same guarantees to any part of a template:\n\n| Router level (exists) | Template level (proposed) |\n|---|---|\n| Router coordinates route data across the route hierarchy | `@boundary` coordinates resources across nested components |\n| Blocking resources delay route activation | `@await` delays rendering of data-dependent content |\n| `nonBlocking()` hands loading state to the component | `@pending` gives a coordinated fallback for that state |\n| Route resources frozen during navigation | Revealed content kept on screen during any refresh |\n| `errorComponent` handles failures of the routed component | `@error` handles failures local to a boundary |\n\nThe two levels complement each other. The router stays responsible for navigation-time data, and boundaries take over once the route is active (§5.6).\n\n##### 2.3 Why this needs the framework\n\nUserland can't build this correctly, for these reasons.\n\n- **Block syntax can't be extended.** `@boundary` is compiler syntax and accepts no parameters today. Userland can't add `@pending` or new parameters to it.\n- **Freezing needs view ownership.** Freezing content means skipping the update pass of views you don't own. With `\u003cng-content>`, the content's views belong to the parent, so a wrapper component can't freeze them.\n- **No commit phase.** Angular's template instructions write to the DOM as they run. Avoiding half-updated views needs a compiler guarantee that every operand of a block is evaluated before any binding in that block.\n- **Correct types need the compiler.** The type checker has to know that the block's content only runs when the value has loaded.\n- **Parallel loading needs runtime control.** A component's `resource()` starts its request from an effect tied to the view that declares the component. Starting nested components' requests before the parent's data has resolved (\"create early, bind late\", §5.5) means running those effects while skipping the view's bindings. Only change detection can do that.\n\n#### 3. Goals and non-goals\n\n##### Goals\n\n- **Explicit opt-in.** Suspension happens only where `@await` is written.\n- **Coordination across components.** Resources read anywhere below a boundary, at any depth and however they were obtained (input, DI, local field), take part in the same pending state.\n- **One place for policy.** Fallback, timing, stale-content limits and identity resets live on `@boundary` and `@pending`.\n- **All-or-nothing updates.** No `@await` block is ever half-updated, and blocks under the same boundary are revealed and released together.\n- **Parallel data loading.** Nesting components inside `@await` must not turn independent requests into a waterfall.\n- **Typed values.** Values unwrapped by `@await` have the resource's loaded type.\n- **Easy to inspect.** DevTools and diagnostics show which resources hold which boundary, and why.\n\n##### Non-goals\n\n- Implicit pending propagation through the signal graph (§10.1).\n- Changing how the router handles navigation-time data. Blocking route resources, navigation freezing and `NavigationError` keep their current behaviour.\n- Suspending on raw Promises or Observables. Resources are the supported protocol, and `rxResource`, `httpResource` and similar adapters cover other sources.\n- Suspending code in the component class (computeds, effects, methods). Class code keeps reading resources as it does today.\n- A programmatic API for boundaries (§11).\n- Replacing `@defer`. `@defer` controls *when code loads and when views are created*. Suspense controls *when data-dependent content is revealed or updated*.\n\n### Proposed solution\n\n#### 4. Design overview\n\n| Concern | Construct | Placed |\n|---|---|---|\n| Unwrapping data, all-or-nothing updates | `@await (x = res; …) { }` | Deep, where data is read |\n| Fallback, timing, stale-content limit, identity, grouping | `@boundary (…) { } @pending (…) { } @error { }` | High, at layout or section level |\n| App-wide defaults | `provideBoundaries()`, router `withBoundaries()` | Application config |\n\nThe split is deliberate. `@await` blocks are **local**: each one unwraps values and freezes its own small area. A `@boundary` with `@pending` **coordinates**: it groups every `@await` registered beneath it, decides what users see while they are pending, and releases them together. Two pieces of data are \"part of the same suspense\" when they are registered with the same boundary, not when they appear in the same block.\n\nComponent authors and library authors follow one rule: **put `@await` where you read the data.** The block joins whatever boundary the consumer placed around the component. Nothing else is needed.\n\n#### 5. Detailed design\n\n##### 5.1 The `@await` block\n\n###### Syntax\n\n```html\n@await (alias = expression; alias2 = expression2) {\n  …content using alias and alias2…\n}\n```\n\n- One or more `alias = expression` pairs, separated by semicolons.\n- Aliases are scoped to the block's content, like `@if (…; as x)`.\n- **Operands are independent.** An operand can't refer to another alias in the same header, and the compiler reports an error if it does, so no operand waits on another alias. Data that depends on another alias goes in a nested block, which makes the dependency visible in the template:\n\n  ```html\n  @await (user = userResource) {\n    @await (posts = user.feedResource) { … }\n  }\n  ```\n- `@await` has no `@pending` or `@error` blocks of its own. Fallbacks and errors belong to the boundary.\n\n###### Accepted operands\n\nAn operand must be **resource-shaped**, which is checked structurally:\n\n```ts\ninterface ResourceLike\u003cT, L = T> {\n  readonly snapshot: Signal\u003cResourceSnapshot\u003cT>>;\n  readonly [ɵRESOURCE_LOADED]?: readonly [L];   // type-only marker, see \"Typing\"\n  reload?(): boolean;\n}\n```\n\n- **`snapshot`** reads the status and the value together and never throws. `Resource\u003cT>` already exposes it, so `resource`, `rxResource`, `httpResource`, `resourceFromSnapshots`, router resources and userland wrappers all qualify without a framework brand.\n- **`reload()` is optional**, because the read-only types (`Resource\u003cT>`, and the type `asReadonly()` returns) don't declare it, and userland wrappers may not have one. It is only used by `$reset` (§5.2.7).\n- **Compile time.** The generated type-check code passes each operand through an intrinsic, `ɵawait()`. Anything that isn't resource-shaped is a template type error.\n- **Runtime (dev mode).** A shape check produces a clear error for operands that get past type checking, for example through `any`.\n- **Plain signals, Promises and Observables are rejected.** None of them has a `snapshot`.\n  - A `Signal\u003cT>` is never pending, so awaiting one would quietly do nothing.\n  - A Promise has no synchronous status, and its identity is not stable across checks.\n\n###### Typing\n\nInside the content, each alias has the resource's **loaded type**: the type its loader produces, without the `undefined` that the resource adds while nothing has loaded.\n\nToday that distinction is lost. A resource without `defaultValue` is typed `ResourceRef\u003cT | undefined>`, which is the same for a loader returning `Promise\u003cUser>` and one returning `Promise\u003cUser | undefined>`. This proposal keeps it with a second, defaulted type parameter on the resource types:\n\n```ts\ninterface Resource\u003cT, L = T> {\n  readonly [ɵRESOURCE_LOADED]?: readonly [L];\n  // value, status, error, isLoading, snapshot and hasValue are unchanged\n}\n\n// overload without defaultValue\nfunction resource\u003cT, R>(options: ResourceOptions\u003cT, R>): ResourceRef\u003cT | undefined, T>;\n```\n\n```ts\nuserResource = resource({loader: () => fetchUser()});         // ResourceRef\u003cUser | undefined, User>\nmaybeUser = resource({loader: () => findUser()});             // ResourceRef\u003cUser | undefined, User | undefined>\nhits = resource({loader: () => search(), defaultValue: []});  // ResourceRef\u003cHit[], Hit[]>\n```\n\n```html\n@await (u = userResource) { … }   \u003c!-- u: User -->\n@await (m = maybeUser) { … }      \u003c!-- m: User | undefined -->\n@await (h = hits) { … }           \u003c!-- h: Hit[] -->\n```\n\n- **When the marker is missing**, the alias has the resource's `T`, which is always sound. This covers userland wrappers without the marker, and user annotations such as `input\u003cResource\u003cUser | undefined>>()`. A child component's input keeps the loaded type when it is declared as `Resource\u003cUser | undefined, User>`.\n- **Known gap:** calling `set(undefined)` on a writable resource whose loaded type excludes `undefined` produces a `local` resource holding `undefined`. The block still renders it, and dev mode warns (§5.8).\n\n###### When a block is ready\n\nReadiness depends only on the resource's **status**, never on `hasValue()`. A `defaultValue` makes `hasValue()` true while loading, but it is not loaded data.\n\n| Status | Before the block's first reveal | After the block has been revealed |\n|---|---|---|\n| `resolved`, `local` | **Ready** | **Ready**: the content updates |\n| `loading`, `reloading` | **Waiting** | **Refreshing**: the boundary's stale policy applies (§5.2.4) |\n| `idle` | **Hidden**: doesn't hold the boundary | **Hidden**: content kept alive off-screen; doesn't hold the boundary |\n| `error` | **Error** (§5.2.7) | **Error** (§5.2.7) |\n\n- **`reloading` waits before the first reveal.** A resource can be `reloading` after an error, when it has no value. A block created while a shared resource reloads waits for the fresh value instead of showing an old one.\n- **`idle` means \"no data requested\",** for example a search with an empty query, so the block shows nothing and doesn't hold its boundary. \"Not available yet\" is expressed by `params` throwing `ResourceParamsStatus.LOADING` (§5.5), which makes the resource `loading`. Authors who want an empty state write it outside the block:\n\n  ```html\n  @if (results.status() === 'idle') { \u003cp>Type to search\u003c/p> }\n  @await (r = results) { \u003capp-hits [hits]=\"r\" /> }\n  ```\n- **A hidden block that starts loading** follows its boundary's phase (§5.2.2). It holds the reveal while the boundary is pending, and it is a late block, hidden until ready, while the boundary shows content.\n\n###### Semantics\n\n1. **Unit of freezing.** Each control-flow block has its own embedded view, and the `@await` content view is the unit that renders or freezes. While the block is waiting or refreshing, its content's bindings are not updated, apart from early inputs (§5.5). Content outside the block, including siblings in the same template, is unaffected.\n2. **All-or-nothing.** All operands are read before any binding in the content, so the content is never half-updated against a mix of old and new values.\n3. **Registration.** When it is created, the block registers its operands with the nearest coordinating boundary (§5.2.8). It re-registers when an operand's identity changes, and unregisters when it is destroyed.\n4. **Typing guarantee.** The content's bindings only run in the *ready* state, so an alias always holds loaded data.\n5. **Per-row suspension.** Inside `@for`, each row's `@await` registers separately (§5.2.2):\n\n   ```html\n   @for (item of items(); track item.id) {\n     @await (details = item.detailsResource) { \u003capp-row [details]=\"details\" /> }\n   }\n   ```\n\n###### What `@await` does *not* do\n\n- It doesn't affect class code. A `computed` that reads `userResource.value()` still sees `undefined` (or the `defaultValue`) while loading, and rethrows in the error state.\n- It doesn't catch errors from non-resource sources. Existing `@boundary` error handling covers those.\n- It doesn't start or cancel requests. Resource lifecycles are unchanged.\n\n##### 5.2 Pending states on `@boundary`\n\n###### 5.2.1 Full syntax\n\n```html\n@boundary (track \u003cexpr>; let \u003cname> = $pending) {\n  …content…\n} @pending (after \u003cduration>; minimum \u003cduration>; stale none | \u003cduration> | unlimited) {\n  …fallback…\n} @error (let e; reset = $reset; when \u003cpredicate>) {\n  …\n} @error {\n  …\n}\n```\n\n- Every parameter is optional, and parameters can appear in any order.\n- **A boundary coordinates pending state only if it has a `@pending` block.** A `@boundary` without one behaves exactly as it does today, and passes `@await` registrations up to the next coordinating boundary.\n- **A boundary without `@error` blocks doesn't catch errors.** Errors pass through it to the next boundary out, so a pending-only section boundary never destroys its content because of an error. This changes today's behaviour (§5.9).\n- **To coordinate without a fallback,** use an empty `@pending { }`. Blocks are still revealed together and stale content is still kept, but nothing is shown while the boundary is pending.\n\n###### 5.2.2 Boundary and block states\n\nEach `@await` block and each coordinating boundary has a small set of phases.\n\n| Block phase | Meaning |\n|---|---|\n| `waiting` | Not ready and never shown. Bindings aren't applied. |\n| `ready` | Showing current data. |\n| `frozen` | Showing its last data while its resources refresh. |\n| `hidden` | Content kept alive but not shown: the resource is `idle`, or the block is a *late block* that isn't ready yet. |\n\n| Boundary phase | Meaning |\n|---|---|\n| `pending` | No registered block is showing content, and at least one is waiting. The fallback rules of §5.2.3 apply. |\n| `revealed` | The content is shown, and every showing block is ready. |\n| `refreshing` | The content is shown, and at least one showing block is frozen. `$pending` is `true`. |\n| `stale-fallback` | A refresh outlasted `stale`. The content is kept alive off the DOM, and the fallback is shown. |\n| `error` | An `@error` block is shown. |\n\n**\"First load\" is the `pending` phase**: the boundary has no block showing content. A boundary whose blocks were all hidden (for example because their resources are `idle`) is pending again when one of them starts loading. Whether \"first load\" should instead happen once per boundary, or be tracked per block, is open question 1 (§11).\n\n| Event | When the boundary is… | Result |\n|---|---|---|\n| A block registers, or a hidden block starts loading | `pending` | It holds the reveal. |\n| | `revealed` or `refreshing` | It is a **late block**: hidden until ready, sets `$pending`, doesn't hold other blocks' release, doesn't start the `stale` timer. |\n| A showing block's resource starts loading or reloading | `revealed` | The block freezes. The boundary moves to `refreshing`, and the `stale` timer starts. |\n| Every frozen block is ready | `refreshing` | All frozen blocks update **in one pass**, and the boundary moves to `revealed`. Blocks discovered during that pass are late blocks. |\n| `stale` elapses | `refreshing` | `stale-fallback`. |\n| Every non-hidden block is ready | `pending` or `stale-fallback` | The content is attached (after `minimum`), and the boundary moves to `revealed`. |\n| A showing block's resource becomes `idle` | any shown phase | The block is hidden and stops counting. |\n| The `track` value changes | any | The content is recreated, and the boundary moves to `pending`. |\n| A resource errors | any | The error is raised from the block's view (§5.2.7). |\n\n- **`@for` rows.** Each row's block registers separately and follows the same rules. Rows are revealed together on first load, and rows added later are late blocks.\n- **Hidden content** is frozen (§5.5) and kept until the block is destroyed.\n\n###### 5.2.3 First load: `after` and `minimum`\n\nWhile the boundary is `pending`, it shows `@pending` instead of its content. The content is still **created** in the background (§5.5), so requests start and nested blocks are discovered. It is attached to the DOM only when every block that isn't hidden is ready, so nothing half-loaded is ever visible.\n\n- **`after \u003cduration>`:** wait this long before showing the fallback. If everything is ready sooner, the content appears directly, with no flash.\n- **`minimum \u003cduration>`:** once shown, keep the fallback on screen for at least this long, to avoid a flicker.\n\nThese have the same meaning as the options on `@defer`'s `@loading` block. How the timers interact:\n\n- **An error during `minimum`** waits until `minimum` ends, as in `@defer`, so the fallback never flickers straight into an error.\n- **A `track` change during `after`:** the old content is already destroyed, so nothing is shown until `after` elapses, then the fallback.\n- **Reveal batching** (§5.4) is measured from the last reveal. The first reveal is never delayed.\n\n###### 5.2.4 Refreshes: `stale`\n\nA **refresh** happens when a block that is showing content needs new data, for example because a registered resource's params changed or `reload()` was called. By default, the boundary **keeps the content on screen**:\n\n- Refreshing `@await` blocks are frozen and keep showing their last values.\n- The rest of the boundary's content keeps updating, which is what makes a \"refreshing\" indicator possible (§5.2.5).\n- `$pending` is `true`.\n- When every frozen block is ready again, they all update **together, in one pass**.\n\n`stale` limits how long stale content may stay on screen:\n\n```html\n} @pending (after 150ms; minimum 400ms) { … }                  \u003c!-- default: stale unlimited -->\n} @pending (after 150ms; minimum 400ms; stale 1s) { … }        \u003c!-- stale for up to 1s, then the fallback -->\n} @pending (after 150ms; minimum 400ms; stale none) { … }      \u003c!-- a refresh shows the fallback right away -->\n} @pending (stale unlimited) { … }                             \u003c!-- overrides an app-wide default -->\n```\n\n- **When the fallback replaces stale content,** the content views stay alive but are detached from the DOM. **Component state survives; DOM state may not**: focus, selection, scroll positions, `\u003ciframe>` documents and media playback can be lost. Hiding and showing don't run `animate.enter` or `animate.leave`, because nothing is destroyed. Hiding content in place instead of detaching it is open question 3 (§11).\n- **`minimum`** applies to the fallback on refresh as well.\n- **`stale none`** suits data where a stale value would mislead, such as prices or availability.\n- **The policy belongs to the boundary as a whole.** It can't be set on individual `@await` blocks or on resources, because the boundary releases its blocks as a group, and one block with a different policy would break that.\n\n###### 5.2.5 `$pending`\n\n`$pending` is a context variable exposed in the boundary's parameters, the way `@for` exposes `$index`. It is `true` while the boundary is `refreshing`, and while a late block is loading.\n\n```html\n@boundary (let refreshing = $pending) {\n  \u003capp-toolbar [busy]=\"refreshing\" />\n  @await (report = reportResource) { \u003capp-report [data]=\"report\" /> }\n} @pending { \u003capp-skeleton /> }\n```\n\n- **Scope.** The alias is scoped to the boundary's main content. It isn't available inside `@pending` or `@error`.\n- **Read it outside the blocks it describes.** Inside a frozen block it keeps its last value until the block is released.\n- **To use it deeper in the tree,** pass it down as an input.\n\n###### 5.2.6 `track`: content identity\n\n```html\n@boundary (track userId()) { … } @pending { … }\n```\n\n`track` gives the boundary's content an identity, the way `@for`'s `track` gives rows an identity. When the tracked value changes:\n\n1. **The content is recreated.** Content views are destroyed and created again, so components get fresh state.\n2. **The fallback is shown instead of stale content,** whatever the `stale` setting. The old content would be *wrong*, not just stale.\n\nLater refreshes with the same identity follow the `stale` policy as usual.\n\n**Where the tracked value comes from.** The `track` expression is evaluated in the template that contains the boundary. It should refer to **what drives the request**, usually the same signal used in the resource's params, **not the result**:\n\n```ts\nuserId = input.required\u003cstring>();\nuserResource = resource({\n  params: () => ({id: this.userId()}),\n  loader: ({params}) => fetchUser(params.id),\n});\n```\n\n`track user.id` would not work. `user` only exists inside an `@await` block, so the boundary can't see it, and the compiler reports an unknown name. Even if the boundary could see it, it would change only *after* the new user loaded, by which point the old profile would already have been kept on screen.\n\n**Why the template decides.** Whether new params mean \"the same content, refreshed\" or \"different content\" depends on the UI, not the data. A filter change on a report is usually a refresh, and stale rows are fine for a moment. Switching to another user's profile is new content, and showing the old profile would be wrong. `stale` and `track` let each boundary give its own answer.\n\n###### 5.2.7 Errors\n\n**Where a resource error is raised.** An error found through `@await` is raised as a view error from the `@await` block's own view. From there it travels like any other view error, so the nearest boundary with `@error` blocks handles it. That can be a different boundary from the one coordinating the block's pending state (§5.2.8).\n\n**Where errors go.** Errors travel from the view where they were thrown to where it is inserted:\n\n1. The nearest `@boundary` with `@error` blocks. It calls `ErrorHandler.onViewError`. If none of its `@error` blocks matches, it rethrows the error wrapped in a `BoundaryError` (with the original as `cause`) to the next boundary out. Whether outer boundaries should see the original error is open question 4 (§11).\n2. The `\u003crouter-outlet>`'s error component (`Route.errorComponent` or the configured default), when router boundaries are enabled. If the outlet has no error component, it rethrows. If the error component itself fails, the error goes on up.\n3. An enclosing `@boundary` around the outlet, then the global `ErrorHandler`.\n\nErrors from non-resource sources (constructors, bindings, lifecycle hooks) take the same path, as with today's `@boundary`.\n\nNavigation-time failures of **blocking** route resources never reach a boundary. They happen before activation, cancel the navigation with `NavigationError`, and remain the job of the router's navigation error handling.\n\n**`$reset`** recreates the boundary's content, as it does today. Resources owned by the recreated content start new requests on their own. Resources that **outlive** the content, for example ones owned by a service or by a component above the boundary, would immediately produce the same error again. The proposed rule:\n\n1. Remember the registered resources that are in the `error` state.\n2. Destroy the content. Resources owned by it are destroyed with it.\n3. Call `reload()` on each remembered resource that is still in `error`, has a `reload()` method, and doesn't carry a core-level opt-out marker. The router sets that marker on its resources, because it already reloads errored route resources when a navigation reuses the route, and their `reload()` returns `false` during a navigation.\n\nStep 3 relies on a fix to `reload()`: today, reloading a resource whose error came from `params` sends it to `idle` instead of re-running `params`. Whether `$reset` should reload anything at all, or leave that to the author's retry handler, is open question 2 (§11).\n\n###### 5.2.8 Which boundary a block registers with\n\nA block registers with the nearest coordinating boundary along **the same path errors take**: from the view up to where it is inserted. Registration and errors walk the same path, but they can stop at different boundaries. Pending state stops at the nearest boundary with `@pending`; errors stop at the nearest boundary with `@error`.\n\n- **Coordinating boundaries are where things get revealed together.** Each one reveals and releases independently of the others, so placing boundaries shapes the loading sequence users see:\n\n  ```html\n  @boundary {                                   \u003c!-- page: shell appears first -->\n    \u003capp-header />\n    @boundary {                                 \u003c!-- profile section -->\n      \u003capp-profile />\n    } @pending { \u003capp-profile-skeleton /> }\n\n    @boundary {                                 \u003c!-- feed section, independent -->\n      \u003capp-feed />\n    } @pending { \u003capp-feed-skeleton /> }\n  } @pending { \u003capp-page-skeleton /> } @error (let e) { \u003capp-page-error [error]=\"e\" /> }\n  ```\n\n  The section boundaries have no `@error`, so errors in them pass through to the page boundary's `@error`.\n- **Content projection** follows today's `@boundary` rule. Projected content belongs to the template that **declares** it, so a `@boundary` around `\u003cng-content />` in a layout component doesn't coordinate the projected content.\n- **Templates rendered elsewhere** (`ngTemplateOutlet`, a `TemplateRef` passed to another component, views created with `ViewContainerRef`) register with the boundary where they are inserted, the same path their errors take.\n- **If there is no coordinating boundary,** the nearest router outlet acts as one when `withBoundaries()` is enabled (§5.6). Otherwise the block acts as its own boundary: hidden until ready, frozen on refresh. In that case dev mode warns, suggesting adding a `@boundary … @pending` or enabling `withBoundaries()`.\n\n##### 5.3 Configuration\n\n###### Core: `provideBoundaries()`\n\nSets app-wide defaults for every coordinating `@boundary`. The option names match the template keywords one to one, and durations are numbers in milliseconds:\n\n```ts\nbootstrapApplication(App, {\n  providers: [\n    provideBoundaries({\n      pending: {after: 150, minimum: 400, stale: 1000}, // stale: number | 'none' | 'unlimited' (default)\n      revealBatchWindow: 100,\n    }),\n  ],\n});\n```\n\nParameters written on a `@pending` block override these defaults. The default values themselves are open question 6 (§11).\n\n###### Router: `withBoundaries()`\n\nOne router feature for all outlet-level boundary behaviour:\n\n```ts\nprovideRouter(routes, withBoundaries({defaultErrorComponent: ErrorPage, onError: logError}));\n```\n\n- **Error options** are the same as `withErrorBoundaries()` has today: `defaultErrorComponent` and `onError`, plus `Route.errorComponent`.\n- **Every `\u003crouter-outlet>` also becomes a coordinating boundary** for its routed component (§5.6).\n- **`withErrorBoundaries()` stays, error-only.** It doesn't turn on pending coordination, so existing apps don't change behaviour, and apps that want outlet error handling without outlet coordination keep using it.\n- **Reserved names:** `defaultPendingComponent` and per-route `pendingComponent` are reserved for a follow-up (§12).\n\n##### 5.4 Runtime behaviour\n\n###### Discovery until stable\n\nA nested `@await` registers only once its parent view's update pass has run.\n\n- **On first load,** when every currently known block is ready, the boundary updates the content while it is still detached. If new waiting blocks appear, it stays `pending` and repeats. When a pass finds nothing new, it attaches the content.\n- **On refresh,** the boundary releases every currently frozen block in one pass. Blocks discovered during that pass are late blocks (§5.2.2): they stay hidden until ready and never hold a release, so content that is already visible never updates piecemeal.\n\n###### Batched reveals\n\nBoundaries that become ready within a short window are revealed in the same frame, to avoid a cascade of separate reveals. The window is measured from the last reveal, so the first reveal is never delayed. Set it with `provideBoundaries({revealBatchWindow})`.\n\n###### Hydration\n\nServer-rendered content counts as **already revealed**. On the client, a resource without transfer state starts `loading`. That becomes a refresh that keeps the server's DOM frozen until the data is ready, then updates in one pass. The `stale` timer doesn't apply to this first client refresh, so `stale none` never replaces server-rendered HTML with the fallback. Event listeners attach during hydration, in the creation pass, so the page stays interactive. Streaming and incremental hydration are follow-ups (§12).\n\n###### Registration and signal writes\n\nRegistrations are discovered while templates execute. The runtime records them **outside the template's reactive context** and processes them after the current view's update, so that registering never becomes a signal write during template execution. `@boundary`'s error handling already works this way.\n\n##### 5.5 Create early, bind late\n\nAngular separates a view's **creation pass** (instantiate nodes, components and directives) from its **update pass** (evaluate bindings). `@await` builds on that split to avoid fetch waterfalls:\n\n1. When an `@await` block is created, its content's **creation pass runs immediately**. Child components declared in the content are constructed, and so are the components in their templates.\n2. **Early inputs.** Before the block's first reveal, property bindings that **don't reference a pending alias** and that set an **input of a component or directive** are applied right away. DOM properties, text, attributes and bindings that use an alias wait. During a refresh nothing is applied early: frozen means frozen.\n3. The content is **frozen**. Change detection runs the **effects** of the whole frozen subtree, and with them the `resource()` loaders created in those components' fields and constructors, but it doesn't run templates or lifecycle hooks.\n4. The content's update pass runs once the block's own operands are ready.\n\nSo independent data loads in parallel, even when a component sits inside another component's `@await` block, and requests start with their real params, not with input defaults.\n\n**What freezing overrides.** While content is frozen, nothing inside it renders:\n\n- New views created inside it run effects only, although new views normally start marked for refresh.\n- A dirty template consumer and the exhaustive `checkNoChanges` pass skip frozen views.\n- `afterNextRender` and `afterEveryRender` callbacks registered inside are held until the content is attached and released.\n- A direct `ChangeDetectorRef.detectChanges()` from inside frozen content is deferred to the release, with a dev-mode warning.\n\n**What still loads in sequence:**\n- **True data dependencies.** A resource keyed by an input bound from an awaited alias waits for that alias. That is correct.\n- **Resources created inside a child's own control flow** (for example inside its `@if` or `@for`). Those views only exist after the child's update pass runs. Combining dependent requests into one resource, or loading them at the route level, is still the remedy.\n\n**Required inputs while frozen.** Inputs bound from awaited aliases are not set during the frozen window. Today, reading an unset required input throws NG0950, and inside a resource's `params` that error puts the resource into the `error` state. This proposal changes that one context: **while a resource's `params` runs, reading an unset `input.required()` or `model.required()` throws `ResourceParamsStatus.LOADING`**, including reads made through a `computed` that `params` evaluates. The resource stays `loading` until the input is set, and then recomputes. This is the same pattern the router uses for route resources that read `ctx.resources()` before the route's resources are ready. Reading an unset required input anywhere else keeps throwing NG0950. Decorator `@Input()` fields don't throw, so they need no rule.\n\n##### 5.6 Router integration\n\nThe core feature doesn't depend on the router. This section describes how the two fit together.\n\n**Route resources and `@await`**\n\n- **Blocking route resources** bound as inputs arrive as the plain value `T`, so awaiting them is a template type error. The `Resource` object read from `ActivatedRoute.resources` can be awaited, but nothing is gained: it is resolved before activation.\n- **Non-blocking route resources** are the main use case. With `withComponentInputBinding()`, the component receives the `Resource\u003cT>` itself as an input, with the type the component declares. Without input binding, the component reads it from `ActivatedRoute.resources`, which is typed `Resource\u003cunknown>`, so the alias is `unknown`. `@await` coordinates either with component-owned resources under the same boundary.\n- **During navigation,** non-blocking resources already load with the new params, behind the router's freeze. `@await` sees the state each resource had when the navigation started: a resolved resource still looks resolved, and one that was loading stays `loading`. The router handles rollback as it does today.\n- **After the navigation commits,** each resource shows its live state: `loading`, `reloading`, `resolved`, `local` or `error`. From then on the boundary's rules apply.\n\n```html\n\u003c!-- profile.html: `user` is a nonBlocking route resource bound as an input -->\n@boundary (track id()) {\n  @await (u = user()) { \u003capp-profile-card [user]=\"u\" /> }\n} @pending { \u003capp-profile-skeleton /> }\n```\n\n**Router outlets as boundaries**\n\nWith `withBoundaries()`, every `\u003crouter-outlet>` acts as a coordinating boundary for its routed component. It catches any `@await` block in the routed tree that has no closer coordinating boundary. It has no fallback yet, so its behaviour is described on its own terms:\n\n- **First load:** the routed component's shell renders immediately. Its `@await` blocks stay hidden until ready and are revealed together.\n- **Refreshes** (a `reload()`, a query-param change) keep stale content, as in any boundary.\n- **Path-param changes on a reused component:** when the committed path params change and the router reuses the routed component, the outlet hides its blocks until they are ready, instead of keeping stale content. The component isn't recreated, so `RouteReuseStrategy` is respected.\n- **Errors** go to the route's error component.\n\nThis answers the objection raised in [#70809](https://github.com/angular/angular/issues/70809) to keeping old values: \"showing data for /user/1 after navigation to /user/2 is complete\" would be \"very incorrect for many situations\". At the outlet, data for a different path is never shown. Inside a routed component, `@boundary (track …)` gives the same guarantee with a fallback.\n\n##### 5.7 Template syntax and parsing\n\n- **New block names.** `@await` and `@pending` are new block names. The lexer recognises blocks by prefix, so existing template text that begins with these names (for example `@pending…` or `@awaiting`) would start to parse as a block. This is the same kind of change that `@let` and `@boundary` made. A migration escapes the affected text (`@`).\n- **Header parsing.** The `@await` header needs an expression-aware parser for `alias = expression`. The existing `let` parameter parser splits on `,` and `=`, which breaks expressions that contain `==` or `=>`.\n- **`@boundary` parameters.** `@boundary` accepts no parameters today. `track` and `let … = $pending` are new, and so is `@pending` as a connected block.\n\n##### 5.8 Tooling and diagnostics\n\n**Type checking and the language service**\n\n- `@await` operands must be resource-shaped. Aliases have the loaded type.\n- Completions, hover and outlining for `@await`, `@pending` and the new parameters.\n\n**Compiler diagnostics**\n\n- An `@await` operand refers to another alias in the same header.\n- An `@await` operand is a `Signal`, a `Promise` or an `Observable`. This is an extended diagnostic with a specific message, on top of the type error from `ɵawait`.\n\n**Dev-mode runtime warnings**\n\n- An `@await` block has no coordinating boundary above it.\n- An awaited resource is `local` with an `undefined` value although its loaded type excludes `undefined`.\n- A boundary never becomes stable (discovery repeats without end).\n- `ChangeDetectorRef.detectChanges()` is called inside frozen content. The call is deferred to the release.\n\n**DevTools**\n\n- For each boundary: status, registered resources, which template or `@await` registered each one, and which resources are holding reveal or release.\n- A timeline of pending, revealed, refreshing and error transitions.\n\n##### 5.9 Changes to current behaviour\n\nMost of this proposal is new syntax and opt-in configuration. These changes affect code that exists today:\n\n| Area | Today | With this proposal |\n|---|---|---|\n| `@boundary` without `@error` blocks | Catches the error, calls `ErrorHandler.onViewError`, destroys its content, and rethrows a `BoundaryError` wrapper | Doesn't catch: the original error passes through to the next boundary out, and its content isn't destroyed by this boundary. `onViewError` fires once, at the boundary that handles the error. Allowed because `@boundary` is in developer preview. `onViewError` arrived with `@boundary` in 22.2, and its `ErrorDetails` argument is in developer preview, so little code depends on the extra call. |\n| Reading an unset `input.required()` / `model.required()` while a resource's `params` runs | NG0950; the resource goes to `error` | `ResourceParamsStatus.LOADING`; the resource stays `loading` until the input is set (§5.5) |\n| `reload()` on a resource whose error came from `params` | Goes to `idle` | Re-runs `params` (needed by the proposed `$reset` rule, §5.2.7) |\n| Resource types | `Resource\u003cT>`, `ResourceRef\u003cT \\| undefined>` without `defaultValue` | A second, defaulted type parameter: `Resource\u003cT, L = T>`, `ResourceRef\u003cT \\| undefined, T>`. One type-level break: reassigning a variable between resources whose loaders differ in `undefined` (TS2322). |\n| Template text starting with `@await` or `@pending` | Plain text | Parsed as a block; a migration escapes it (§5.7) |\n| `withErrorBoundaries()` | Error boundaries at the outlet | Unchanged. Pending coordination at the outlet needs `withBoundaries()`. |\n\n#### 6. Examples\n\n##### 6.1 A page with nested data in a child component\n\n```html\n\u003c!-- user-page.html -->\n@boundary (track userId()) {\n  @await (user = userResource) {\n    \u003ch1>{{ user.name }}\u003c/h1>\n    \u003capp-feed [userId]=\"user.id\" />\n  }\n} @pending (after 150ms) {\n  \u003capp-page-skeleton />\n} @error (let e; reset = $reset) {\n  \u003capp-error [error]=\"e\" (retry)=\"reset()\" />\n}\n```\n\n```html\n\u003c!-- feed.html: knows nothing about its parent's boundary -->\n@await (posts = feedResource) {\n  @for (p of posts; track p.id) { \u003capp-post [post]=\"p\" /> }\n}\n```\n\n```ts\n// feed.ts\nexport class Feed {\n  userId = input.required\u003cstring>();\n  private api = inject(FeedApi);\n  feedResource = resource({\n    params: () => ({userId: this.userId()}), // loading until the input is set\n    loader: ({params}) => this.api.list(params.userId),\n  });\n}\n```\n\nWhat happens:\n\n- **First load.** `userResource` starts. `\u003capp-feed>` is created right away and its `feedResource` effect runs, but `userId` isn't set yet, so `feedResource` stays `loading`. When `user` resolves, the page block's update pass sets the input and the feed request starts. The boundary keeps `@pending` up until both are ready, then everything appears in one frame.\n- **Reload for the same user.** Both blocks stay visible and frozen, then update together. No spinner, no tearing.\n- **Navigating to another user.** `track userId()` changes, so the content is recreated and `@pending` is shown.\n\n##### 6.2 A refresh indicator alongside stale content\n\n```html\n@boundary (let refreshing = $pending) {\n  \u003capp-toolbar [busy]=\"refreshing\" />\n  @await (report = reportResource; totals = totalsResource) {\n    \u003capp-report [data]=\"report\" [totals]=\"totals\" />\n  }\n} @pending {\n  \u003capp-report-skeleton />\n}\n```\n\n##### 6.3 Independent sections with their own fallbacks and policies\n\n```html\n\u003capp-header />\n@boundary {\n  @await (stats = statsResource) { \u003capp-stats [stats]=\"stats\" /> }\n} @pending (stale 1s) { \u003capp-stats-skeleton /> }\n\n@boundary {\n  @await (prices = pricesResource) { \u003capp-prices [items]=\"prices\" /> }\n} @pending (stale none) { \u003capp-prices-skeleton /> }\n```\n\n##### 6.4 Search with an empty state\n\n```ts\nresults = resource({\n  params: () => this.query() || undefined, // idle while the query is empty\n  loader: ({params}) => search(params),\n});\n```\n\n```html\n@boundary {\n  @if (results.status() === 'idle') { \u003cp>Type to search\u003c/p> }\n  @await (hits = results) { \u003capp-hits [hits]=\"hits\" /> }\n} @pending (after 150ms) {\n  \u003capp-hits-skeleton />\n}\n```\n\n- **Empty query:** `results` is `idle`, so the block is hidden and the boundary isn't held.\n- **The user types:** no block is showing content, so the boundary is pending, and the skeleton appears after 150 ms.\n- **The user refines the query:** the previous hits stay on screen until the new ones arrive.\n- **The user clears the query:** the block is hidden again, and no stale results remain.\n\n#### 7. Capabilities this provides\n\n- **One loading experience per section**, declared once, instead of a spinner per component.\n- **No tearing inside `@await`.** Data under a boundary is revealed and refreshed as a consistent snapshot.\n- **No flashing.** `after` and `minimum` on first load, stale content by default during refreshes, and batched reveals.\n- **Coordination across components without plumbing.** A child component's resources take part in the parent section's loading state with no inputs, outputs or shared services.\n- **Encapsulation.** Components declare their own data dependencies with `@await`. Parents decide only where boundaries go and what policy they use.\n- **Parallel loading by default** for resources created when components are constructed.\n- **Loaded types inside `@await`,** without a `defaultValue` and without `?.` guards.\n- **Loading and errors in one construct,** with retry covering both.\n- **Identity-aware resets** through `track`.\n- **Explicit and easy to inspect.** Every suspension point is visible in a template, and DevTools shows the full picture.\n\n#### 8. Limitations\n\n- **No commit phase.** Angular writes to the DOM as it renders, so updates can only be all-or-nothing at the level of an `@await` block, not the whole boundary.\n  - **Live content next to frozen content.** Content outside `@await` blocks updates live while blocks are frozen. A sibling that reads `res.value()` directly shows the resource's live value (for example the `defaultValue` while a new request loads) next to a frozen block that still shows the previous data.\n  - **Blocks created during a refresh** have no stale content to keep, so they stay hidden until they are ready. If that matters, wrap such areas in their own boundary with `@pending`.\n  - Removing these limits needs a \"render offscreen, then commit\" model that buffers DOM operations for suspended views. That is out of scope.\n- **Class code isn't covered.** Computeds, effects and methods see raw resource state. This is deliberate, but it means suspense covers rendering only.\n- **Resources only.** Promises and Observables need a resource adapter (`rxResource`, or a resource wrapping a promise).\n- **Discovery costs some work.** Content is created before it is visible, so components may be constructed for content that ends up replaced by `@error`. Each nesting level whose data depends on its parent's adds a discovery pass, but no extra requests.\n- **Some loads remain sequential** (§5.5): true data dependencies, and resources created inside a child component's own control flow.\n- **Content projection** follows the declaring template. A layout component can't coordinate content projected into it.\n- **Hidden content loses DOM state.** When the fallback replaces content, focus, selection, scroll positions, `\u003ciframe>` documents and media playback can be lost (§5.2.4).\n- **Navigation-time failures are outside boundaries.** A blocking route resource that fails during navigation cancels it with `NavigationError` before any boundary exists for the new route.\n- **Retries wait for navigation.** Route resources can't be reloaded while a navigation is pending.\n- **One type-level break** from the loaded-type parameter (§5.1).\n- **Builds on developer-preview features.** `@boundary` and router boundaries are in developer preview, so this proposal would ship as developer preview too.\n\n#### 9. Detailed interactions\n\n\u003cdetails>\n\u003csummary>How \u003ccode>defaultValue\u003c/code> interacts with \u003ccode>@await\u003c/code>\u003c/summary>\n\nInside `@await`, `defaultValue` is never shown and doesn't change the alias type. The loaded-type parameter already removes `undefined`, so `defaultValue` is no longer needed for template typing. It keeps its role for class code and for direct `value()` reads.\n\n| Step | `status()` | `results.value()` (with `defaultValue: []`) | `@await (r = results)` |\n|---|---|---|---|\n| empty query | `idle` | `[]` | hidden, doesn't hold the boundary |\n| query `'ng'` | `loading` | `[]` | waiting, `@pending` shown |\n| resolves | `resolved` | `[h1, h2]` | revealed with `[h1, h2]` |\n| query `'ng-c'` | `loading` | `[]` | frozen on `[h1, h2]` (or the fallback, per `stale`) |\n| loader fails | `error` | throws | `@error` |\n| `$reset` | `reloading` | `[]` | recreated block waits |\n\n\u003c/details>\n\n\u003cdetails>\n\u003csummary>Status changes after reveal\u003c/summary>\n\n| From → to | Block | Boundary |\n|---|---|---|\n| `resolved` → `reloading` (`reload()`) | frozen | `refreshing`, `stale` applies |\n| `resolved` → `loading` (params change) | frozen | `refreshing`, `stale` applies |\n| `resolved` → `idle` | hidden, kept alive | not held by this block |\n| `idle` → `loading` | stays hidden until ready | holds the reveal if no block is showing (`pending`); otherwise a late block, `$pending` is `true` |\n| any → `error` | — | raised from the block's view (§5.2.7) |\n| `local` (via `set()`) | updates immediately | — |\n\n\u003c/details>\n\n### Alternatives considered\n\n#### 10. Alternatives considered\n\n##### 10.1 Implicit pending in the signal graph\n\nSolid 2.0 puts async values and their pending state inside the reactive graph. Reads of a value that isn't ready suspend to the nearest `\u003cLoading>` boundary, and `isPending()` / `latest()` serve stale-while-revalidate UI. Adopting that in Angular would change the semantics of signals and of every computed, effect and template, which is a breaking change. Angular's model is that **a resource is a value carrying its own state**. Because a resource is \"just a value\", it can be wrapped or rewritten in userland, so the only reliable place for the framework to step in is an **explicit unwrap point**.\n\n##### 10.2 Showing the fallback on refresh by default\n\nReact shows the fallback again when an update suspends, unless the update runs inside `startTransition` or `useDeferredValue`. The equivalent here would be a boundary flag that opts *into* keeping stale content. This proposal makes keeping stale content the default instead, with `stale` limiting it:\n\n- Angular has no per-update priority, so the policy has to live on the boundary.\n- Once `track`, and path-param changes at the outlet, handle identity changes, a skeleton on every same-identity refresh is rarely what users want.\n- Solid's `\u003cLoading>` also keeps the UI stable after the first load, unless its `on` dependencies change. That is the same split as stale content plus `track`.\n\n##### 10.3 A conditional refresh policy\n\n`@pending (refresh when \u003cexpr>)` would choose per refresh between stale content and the fallback, for example by layout. It is left out:\n\n- Layout differences belong in CSS or `@if`.\n- The real per-update case (\"a user-initiated reload shows the skeleton, background polling doesn't\") is not a property of the boundary.\n- A free expression needs rules for when it is read, and it is hard to test.\n\nA small, fixed set of options (`stale \u003cduration>`, `stale none`) covers the tested patterns.\n\n##### 10.4 A separate `withPendingBoundaries()` router feature\n\nPending behaviour at the outlet could be its own feature next to `withErrorBoundaries()`. This proposal keeps `withErrorBoundaries()` for error-only outlets and adds `withBoundaries()` for both, instead of a pending-only feature, because:\n\n- The outlet's pending behaviour builds on the same component swap and per-outlet state as its error handling.\n- Two outlet modes, error-only and both, are simpler to document and test than every combination of two independent features.\n\n##### 10.5 `Exclude\u003cT, undefined>` for aliases without the type marker\n\nWhen an operand doesn't carry the loaded-type marker, the alias could be `Exclude\u003cT, undefined>`, matching `hasValue()` narrowing. That is more convenient for inputs typed `Resource\u003cUser | undefined>`, but it is wrong whenever the data really can be `undefined`. This proposal uses `T`, which is always sound, and documents `Resource\u003cT | undefined, T>` for inputs.\n\n##### 10.6 Naming\n\n| Proposed | Alternatives | Notes |\n|---|---|---|\n| `@await` | `@use` | `@await` explains itself. `@use` matches React's `use()`, which agents and React developers know, but suggests React's throw-based semantics. |\n| `@pending` | `@fallback`, `@suspense … @fallback` | `@pending` follows `@placeholder` and `@loading`. A React-style `@suspense { } @fallback { }` would be familiar, but it would duplicate `@boundary`, which already owns error handling. |\n| `stale` | `hold` | `stale` names what users see. `hold` reads well in `hold 1s` but is vaguer about what is held. |\n| `$pending` | `$refreshing` | `$pending` matches `@pending`. |\n\n#### 11. Open questions\n\n1. **What \"first load\" means.** This proposal defines it per boundary: the boundary is `pending` whenever no registered block is showing content (§5.2.2). The alternatives:\n   - **Once per boundary.** After the first reveal, every later wait is a refresh or a late block. The search example (§6.4) would never show its skeleton again after the first search.\n   - **Per block.** Each block has its own first load, and the boundary shows the fallback whenever a block that has never been shown is waiting. Late blocks would then replace visible content with the fallback.\n2. **What `$reset` reloads.** The proposed rule (§5.2.7) reloads registered resources that are still in error after the content is destroyed, skipping resources marked by the router. The alternative: `$reset` only recreates the content, and authors reload service-owned resources in their retry handler. If the rule stays, should the opt-out marker be public, so userland wrappers can use it?\n3. **Hiding content in place.** Detaching content loses DOM state (§5.2.4). Hiding it in place with `hidden` or `inert` on its top-level elements would keep that state, but Angular templates have no single root element, and bare text nodes can't be hidden.\n4. **Errors seen by outer `@error` blocks.** When no `when` predicate matches, a boundary rethrows `BoundaryError(…, {cause})`. An outer `@error (let e; when isNetworkError(e))` then tests the wrapper, never the original error. Suspense makes nested boundaries common, so this matters more than it does today. Options:\n   - **(a)** Outer `when` predicates and `let e` receive the original error (unwrap `cause`).\n   - **(b)** Keep the wrapper and add a `$cause` context variable.\n   - **(c)** Document the current behaviour.\n5. **Snapshot signals as operands.** Should `@await` also accept a `Signal\u003cResourceSnapshot\u003cT>>`, for example a `computed` that picks between two resources' snapshots? It would compose well with `resourceFromSnapshots`, but it has no `reload()` for `$reset`.\n6. **Default timings.** Defaults for `after`, `minimum`, `stale` and `revealBatchWindow`. Reference points: React reveals at most once every 300 ms, measured from the last reveal; `@defer`'s `@loading` has no default delay.\n7. **Programmatic access to boundaries.** A boundary has no node or element injector today, so `inject(Boundary)` would need a dedicated lookup that follows the same path as registration and errors. It is also unclear whether a programmatic API helps more than it surprises. Library components can take part by following the obvious rule (use `@await`), while manual registration from class code would suspend based on where code runs, not where data is shown. This proposal has no programmatic API.\n8. **Outlets with a pending component.** When `pendingComponent` arrives (§12), should a path-param change on a reused component show it, instead of hiding the blocks? Should some query params count as identity too?\n\n#### 12. Follow-ups\n\n- **`settle` error policy.** Wait until every registered resource has settled, then show `@error` if any failed. This requires holding back `ErrorHandler.onViewError`, which today fires before any `@error` matching.\n- **Pending components at the outlet.** `withBoundaries({defaultPendingComponent})` and `Route.pendingComponent`, together with param handling (§11, question 8). This also covers what [PR #70539](https://github.com/angular/angular/pull/70539) explored, a `nonBlocking({waitFor})` option that would have held navigation until the resource resolved or a given Promise settled, at the section level and without delaying navigation.\n- **SSR streaming and incremental hydration.** The hydration rule is part of the core design (§5.4). Coordinating boundaries are natural flush points for streamed HTML: send the shell with `@pending` content first, then stream each boundary's content as it resolves. How this interacts with incremental hydration triggers needs its own design.\n","author":{"url":"https://github.com/Flarette","@type":"Person","name":"Flarette"},"datePublished":"2026-11-20T10:46:06Z","url":"https://github.com/angular/angular/issues/72140"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:282eea69-230c-06ac-7ad5-7d3e890ac438
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE5DC:317608:341E563:4203E1F:6B01D668
html-safe-nonce033b20b498e7a5be4497962a4e0c9025bd49eaac13d9d573127e5b9d2597af64
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNURDOjMxNzYwODozNDFFNTYzOjQyMDNFMUY6NkIwMUQ2NjgiLCJ2aXNpdG9yX2lkIjoiNDA4NjQ4NjExMDYxODkwMDA3MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac1865e1d6319ef751155ab53caff9838f98c5d16f8c33f248a3c65e5e2bd618da
hovercard-subject-tagissue:6509851678
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/72140/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ee05a7dcbcd304dcfc9e837f37a4bafa4c1548420552d015f0fe29215c8e5928/angular/angular/issues/72140
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ee05a7dcbcd304dcfc9e837f37a4bafa4c1548420552d015f0fe29215c8e5928/angular/angular/issues/72140
og:image:altWhich @angular/* package(s) are relevant/related to the feature request? core, compiler, compiler-cli, router, common, platform-server Description Builds on: @boundary / @error (developer preview, ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameFlarette
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/72140#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F72140
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F72140
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/72140
Reloadhttps://github.com/angular/angular/issues/72140
Reloadhttps://github.com/angular/angular/issues/72140
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues835 (835)https://github.com/angular/angular/issues
Pull requests142 (142)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/72140
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/72140
[Feature request]: Resource based suspense with @await blocks in @boundaryhttps://github.com/angular/angular/issues/72140#top
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
needsTriagehttps://github.com/angular/angular/milestone/83
https://github.com/Flarette
Flarettehttps://github.com/Flarette
on Nov 20, 2026https://github.com/angular/angular/issues/72140#issue-6509851678
#70809https://github.com/angular/angular/issues/70809
PR #70539https://github.com/angular/angular/pull/70539
#70809https://github.com/angular/angular/issues/70809
PR #70539https://github.com/angular/angular/pull/70539
https://github.com/Flarette
Flarettehttps://github.com/Flarette
on Nov 20, 2026https://github.com/angular/angular/issues/72140#issuecomment-7037555728
Data fetching with resourceshttps://angular.dev/guide/routing/data-fetching-with-resources
Router error boundarieshttps://angular.dev/guide/routing/error-boundaries
#70809https://github.com/angular/angular/issues/70809
React: Suspensehttps://react.dev/reference/react/Suspense
React: Suspensehttps://react.dev/reference/react/Suspense
React: Suspensehttps://react.dev/reference/react/Suspense
React: Suspensehttps://react.dev/reference/react/Suspense
React: Suspensehttps://react.dev/reference/react/Suspense
React: usehttps://react.dev/reference/react/use
React: usehttps://react.dev/reference/react/use
React: Suspensehttps://react.dev/reference/react/Suspense
TkDodo: React 19 and Suspense — A Drama in 3 Actshttps://tkdodo.eu/blog/react-19-and-suspense-a-drama-in-3-acts
React 19 upgrade guidehttps://react.dev/blog/2024/04/25/react-19-upgrade-guide
Solid docshttps://docs.solidjs.com
Solid 2.0 async data design recordhttps://github.com/solidjs/solid/blob/main/documentation/solid-2.0/05-async-data.md
Error boundaries with @boundaryhttps://angular.dev/guide/templates/error-boundaries
@boundary APIhttps://angular.dev/api/core/@boundary
PR #70463: @boundary and programmatic error handlinghttps://github.com/angular/angular/pull/70463
Data fetching with resourceshttps://angular.dev/guide/routing/data-fetching-with-resources
Router error boundarieshttps://angular.dev/guide/routing/error-boundaries
Issue #70809: non-blocking resource flashhttps://github.com/angular/angular/issues/70809
PR #70539: nonBlocking({waitFor})https://github.com/angular/angular/pull/70539
https://react.dev/reference/react/Suspense
usehttps://react.dev/reference/react/use
React 19 upgrade guide: improvements to Suspensehttps://react.dev/blog/2024/04/25/react-19-upgrade-guide
TkDodo: React 19 and Suspense — A Drama in 3 Actshttps://tkdodo.eu/blog/react-19-and-suspense-a-drama-in-3-acts
Solid docshttps://docs.solidjs.com
Solid 2.0 async data design recordhttps://github.com/solidjs/solid/blob/main/documentation/solid-2.0/05-async-data.md
angular-robothttps://github.com/apps/angular-robot
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
on Nov 20, 2026https://github.com/angular/angular/issues/72140#event-36759431275
angular-robothttps://github.com/apps/angular-robot
needsTriagehttps://github.com/angular/angular/milestone/83
on Nov 20, 2026https://github.com/angular/angular/issues/72140#event-36759434377
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Nov 20, 2026https://github.com/angular/angular/issues/72140#event-36759435188
https://github.com/Flarette
Flarettehttps://github.com/Flarette
on Nov 20, 2026https://github.com/angular/angular/issues/72140#issuecomment-7038641319
Flarettehttps://github.com/Flarette
on Nov 20, 2026https://github.com/angular/angular/issues/72140#event-36766853826
https://github.com/JeanMeche
JeanMechehttps://github.com/JeanMeche
on Nov 20, 2026https://github.com/angular/angular/issues/72140#issuecomment-7039690181
#53601https://github.com/angular/angular/issues/53601
https://github.com/Flarette
Flarettehttps://github.com/Flarette
on Nov 20, 2026https://github.com/angular/angular/issues/72140#issuecomment-7040192117
#53601https://github.com/angular/angular/issues/53601
https://github.com/Flarette
Flarettehttps://github.com/Flarette
on Nov 20, 2026https://github.com/angular/angular/issues/72140#issuecomment-7040411793
#53601https://github.com/angular/angular/issues/53601
https://github.com/JeanMeche
JeanMechehttps://github.com/JeanMeche
on Nov 20, 2026https://github.com/angular/angular/issues/72140#issuecomment-7040494187
https://github.com/Flarette
Flarettehttps://github.com/Flarette
on Nov 20, 2026https://github.com/angular/angular/issues/72140#issuecomment-7040780778
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/72140
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/72140
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
needsTriageNo due datehttps://github.com/angular/angular/milestone/83
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.