Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/angular/angular.git. Pull mirroring updated .
  1. Jan 23, 2025
  2. Jan 22, 2025
  3. Jan 21, 2025
  4. Jan 20, 2025
  5. Jan 18, 2025
  6. Jan 17, 2025
    • Andrew Kushnir's avatar
      test(platform-server): fix flaky incremental hydration test (#59584) · 2e72ec7e
      Andrew Kushnir authored
      This commit updates a test setup to define a global `ngServerMode` correctly for a test that was emulating client-only behavior. The flag could've been set by prior tests and depending on its state, the test was acting differently.
      
      PR Close #59584
      2e72ec7e
    • Andrew Kushnir's avatar
      test(platform-server): fix flaky hydration test (#59579) · 55837de2
      Andrew Kushnir authored
      This commit updates testing setup logic to apply correct `document` reference, which should be used by the runtime. Previously, the timing of that operation was less predictable and in some cases led to reusing document state from previous tests.
      
      PR Close #59579
      55837de2
    • arturovt's avatar
      fix(core): cleanup `_ejsa` when app is destroyed (#59492) · 4eb54183
      arturovt authored
      In this commit, we delete `_ejsa` when the app is destroyed, ensuring that no elements are still captured in the global list and are not prevented from being garbage collected.
      
      PR Close #59492
      4eb54183
    • arturovt's avatar
      refactor(router): drop forRoot guard in production (#59458) · 4507109a
      arturovt authored
      In this commit, we switch from decorators (which also produce redundant metadata, such as in the `declareFactory`
      instruction) to the `inject` function to drop the `ROUTER_FORROOT_GUARD` token in production. This token factory function is only in development mode but is still referenced in the constructor due to the `@Inject(ROUTER_FORROOT_GUARD)` decorator.
      
      PR Close #59458
      4507109a
    • Kristiyan Kostadinov's avatar
      fix(core): animation sometimes renderer not being destroyed during HMR (#59574) · a4eb74c7
      Kristiyan Kostadinov authored
      These changes aim to resolve the issue that prompted #59514. The animations module is a bit tricky for HMR, because it schedules the destruction of its renderer after the currently-running animations are done. If there are no running animations, the renderer gets destroyed next time around. This is a problem, because it means that the styles can stay around for a long time.
      
      These changes resolve the issue by:
      1. Moving the cleanup of the renderer to after the destruction of the old view. This ensures that the usual clean up flow has been kicked off.
      2. Flushing the animations when a component is replaced to ensure that the renderer is cleaned up in a timely manner.
      
      PR Close #59574
      a4eb74c7
    • Angular Robot's avatar
      build: update cross-repo angular dependencies to v19.2.0-next.0 (#59571) · 612f1161
      Angular Robot authored
      See associated pull request for more information.
      
      PR Close #59571
      612f1161
    • Pawel Kozlowski's avatar
      refactor(core): move DOM manipulation logic to its own file (#59462) · 8b08a25f
      Pawel Kozlowski authored
      This refactoring takes a step toward breaking down the
      node_manipulation file into smaller, more focused files.
      
      PR Close #59462
      8b08a25f
    • Alex Rickabaugh's avatar
      refactor(core): port resource() to linkedSignal() (#59024) · 81f8fe63
      Alex Rickabaugh authored
      When the reactive `request` of a resource() notifies, it transitions to the
      Loading state, fires the loader, and eventually transitions to Resolved.
      With the prior implementation, a change of the `request` will queue the
      effect, but the state remains unchanged until the effect actually runs. For
      a brief period, the resource is in a state where the request has changed,
      but the state has yet to update.
      
      This is problematic if we want to use resources in certain contexts where we
      care about the state of the resource in a synchronous way. For example, an
      async validator backed by a resource might be checked after an update:
      
      ```
      value.set(123);
      
      if (validator.value()) {
        // value is still valid, even though the resource is dirty and will soon
        // flip to loading state (returning value(): undefined) while revalidating
      }
      ```
      
      To address this timing concern, `linkedSignal()` is used within the
      `resource()` to synchronously transition the state in response to the
      request changing. This ensures any followup reads see a consistent view of
      the resource regardless of whether the effect has run.
      
      This also addresses a race condition where `.set()` behaves differently on a
      `resource()` depending on whether or not the effect has run.
      
      PR Close #59024
      81f8fe63
    • Alex Rickabaugh's avatar
      fix(core): change `Resource` to use explicit `undefined` in its typings (#59024) · 906413ab
      Alex Rickabaugh authored
      Originally the `T` in `Resource<T>` represented the resolved type of the
      resource, and `undefined` was explicitly added to this type in the `.value`
      signal. This turned out to be problematic, as it wasn't possible to write a
      type for a resource which didn't return `undefined` values. Such a type is
      useful for 2 reasons:
      
      1. to support narrowing of the resource type when `Resource.hasValue()`
         returns `true`.
      
      2. for resources which use a different value instead of `undefined` to
         represent not having a value (for example, array resources which want to
         use `[]` as their default).
      
      Instead, this commit changes `resource()` and `rxResource()` to return an
      explicit `ResourceRef<T|undefined>`, and removes the union with `undefined`
      from all types related to the resource's value. This way, it's trivially
      possible to write `Resource<T>` to represent resources where `.value` only
      returns `T`.
      
      `hasValue()` then actually works to perform narrowing, by narrowing the
      resource type to `Exclude<T, undefined>`.
      
      PR Close #59024
      906413ab
    • Leon Senft's avatar
      fix(core): treat exceptions in `equal` as part of computation (#55818) · d12a186d
      Leon Senft authored
      Prevent leaking signal reads and exceptions from a custom `equal`
      function of a producer `computed()` to a consumer.
      
      Upstream https://github.com/tc39/proposal-signals/pull/90 with a notable
      change: Angular does **not** track reactive reads in custom `equal`
      implementations.
      
      PR Close #55818
      d12a186d
    • Pawel Kozlowski's avatar
      docs: update linkedSignal documentation (#59532) · 797800ce
      Pawel Kozlowski authored
      This commit updates the linkedSignal documentation around
      the quality function option.
      
      Fixes #59094
      
      PR Close #59532
      797800ce
    • Matthieu Riegler's avatar
      docs: update examples to the application builder (#59539) · 126c80c3
      Matthieu Riegler authored
      fixes #59538
      
      PR Close #59539
      126c80c3
  7. Jan 16, 2025