Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: angular/angular
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v21.2.16
Choose a base ref
...
head repository: trs-dev-1/angular
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: prototype/class-merge-hook
Choose a head ref
  • 2 commits
  • 29 files changed
  • 2 contributors

Commits on Nov 18, 2026

  1. feat(core): prototype provideClassMerge hook for class conflict resol…

    …ution
    
    Snapshot of the prototype used for the spartan benchmarks. Classes from all
    sources (host directives, component host, directives, template, Renderer2) are
    collected in Angular precedence order and passed to a user merge function
    before a single write to the class attribute. Includes SSR/hydration support,
    Renderer2 addClass/removeClass integration and acceptance/hydration tests.
    
    Not for upstream as is: cleanup and review pending.
    
    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01Tuq7xj1gBPxqp16r47nvbf
    trs-dev-1 and claude committed Nov 18, 2026
    Configuration menu
    Copy the full SHA
    cf67441 View commit details
    Browse the repository at this point in the history
  2. refactor(core): address review of the provideClassMerge prototype

    - Fix NgClass toggling a static class, stale `[class]` values after hydration
      (kept until the app is stable, so RouterLinkActive classes do not flicker),
      retained destroyed views, Renderer2 calls on elements of other environments
      or non-DOM nodes, and a stale `destroyNode` with async animations.
    - Validate the merge result in dev mode (NG0960) and dedupe static classes.
    - Move the strategy into a `ClassMerger` class, make the environment field
      required, inject the error handler once and use a plain token.
    - Cache host binding roots per TView, skip the KeyValueArray for merged
      `[class]` bindings and avoid DOM reads for freshly created elements.
    - Document the API (@experimental, usage notes) and add a guide section.
    - Add tests for NgClass, destroyed views, other environments, createComponent
      directives, i18n, animate.enter, forms status classes and hydration cases.
    
    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01Tuq7xj1gBPxqp16r47nvbf
    trs-dev-1 and claude committed Nov 18, 2026
    Configuration menu
    Copy the full SHA
    e5ae2a5 View commit details
    Browse the repository at this point in the history
Loading