Skip to content

Angular chat & Angular 20#1228

Open
benjavicente wants to merge 2 commits into
TanStack:mainfrom
benjavicente:angular-chat
Open

Angular chat & Angular 20#1228
benjavicente wants to merge 2 commits into
TanStack:mainfrom
benjavicente:angular-chat

Conversation

@benjavicente

@benjavicente benjavicente commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

🎯 Changes

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • New Features

    • Added an Angular chat example demonstrating end-anchored virtualization, history loading, message appending, and streamed replies.
    • Added the example to the documentation’s Angular examples catalog.
  • Compatibility

    • Angular virtual scrolling now requires Angular 20 or later.
    • Updated Angular examples to Angular 20 and refreshed their setup documentation.
  • Chores

    • Updated TypeScript tooling across packages and examples to version 5.9.3.
    • Simplified TypeScript project file inclusion for more consistent builds.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds an Angular 20 chat virtualization example with end anchoring and streaming replies, updates Angular compatibility and example projects, and upgrades TypeScript plus package TypeScript scopes.

Changes

Angular 20 chat example

Layer / File(s) Summary
Angular compatibility and release metadata
.changeset/*, packages/angular-virtual/*, examples/angular/{dynamic,fixed,infinite-scroll,padding,smooth-scroll,sticky,table,variable,window}/*
Raises Angular requirements and example projects to Angular 20.
Chat application and integration
docs/config.json, examples/angular/chat/*
Adds the Angular chat example, CLI setup, documentation, virtualized message behavior, streaming replies, styling, and responsive layout.
TypeScript toolchain scope
package.json, benchmarks/package.json, examples/{lit,marko,react,svelte,vue}/*/package.json, packages/*/tsconfig.json
Updates TypeScript to 5.9.3 and removes ESLint configuration files from package TypeScript inputs.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant AppComponent
  participant Virtualizer
  User->>AppComponent: Scroll or select a chat action
  AppComponent->>Virtualizer: Update messages and item count
  Virtualizer->>AppComponent: Render measured virtual items
  AppComponent->>User: Show anchored or streaming messages
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title concisely captures the main changes: Angular 20 support and the new Angular chat example.
Description check ✅ Passed The description follows the required template and includes the changes, checklist, and release-impact sections.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@socket-security

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm @angular-devkit/build-angular is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: examples/angular/chat/package.jsonnpm/@angular-devkit/build-angular@20.3.32

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@angular-devkit/build-angular@20.3.32. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm @angular-devkit/build-angular is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: examples/angular/chat/package.jsonnpm/@angular-devkit/build-angular@20.3.32

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@angular-devkit/build-angular@20.3.32. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm lmdb is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: pnpm-lock.yamlnpm/@angular-devkit/build-angular@20.3.32npm/lmdb@3.4.2

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/lmdb@3.4.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@benjavicente benjavicente changed the title Angular chat Angular chat & Angular 20 Jul 14, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
examples/angular/chat/src/app/app.component.ts (1)

5-6: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Prefer afterRenderEffect for DOM measurements.

Please consider using afterRenderEffect instead of effect for DOM reads. Angular's effect runs during change detection and can occasionally read before layout has fully settled. The afterRenderEffect API ensures that measureElement runs securely after the DOM updates are painted.

This change also aligns with the timing used inside the @tanstack/angular-virtual internal library measurements and tests.

♻️ Proposed refactor

Update the import statement:

   Component,
   DestroyRef,
   afterNextRender,
-  effect,
+  afterRenderEffect,
   inject,
   signal,

And update the measurement effect initialization (around line 126):

-  private readonly measureItems = effect(
-    () =>
+  private readonly measureItems = afterRenderEffect({
+    read: () => {
       this.virtualItems().forEach((element) => {
         this.virtualizer.measureElement(element.nativeElement)
-      }),
-    { allowSignalWrites: true },
-  )
+      })
+    }
+  })
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/angular/chat/src/app/app.component.ts` around lines 5 - 6, Replace
the Angular effect used for DOM measurement with afterRenderEffect in the app
component: update the import and the measurement effect initialization so
measureElement runs after rendering. Leave unrelated effects and the existing
measurement behavior unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@examples/angular/chat/src/app/app.component.ts`:
- Around line 5-6: Replace the Angular effect used for DOM measurement with
afterRenderEffect in the app component: update the import and the measurement
effect initialization so measureElement runs after rendering. Leave unrelated
effects and the existing measurement behavior unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4f87bc04-b832-4750-8e5d-fa8758c90321

📥 Commits

Reviewing files that changed from the base of the PR and between e2cb096 and 6e0c52e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (69)
  • .changeset/hot-points-crash.md
  • benchmarks/package.json
  • docs/config.json
  • examples/angular/chat/README.md
  • examples/angular/chat/angular.json
  • examples/angular/chat/package.json
  • examples/angular/chat/src/app/app.component.ts
  • examples/angular/chat/src/index.html
  • examples/angular/chat/src/main.ts
  • examples/angular/chat/src/styles.css
  • examples/angular/chat/tsconfig.app.json
  • examples/angular/chat/tsconfig.json
  • examples/angular/dynamic/README.md
  • examples/angular/dynamic/package.json
  • examples/angular/fixed/README.md
  • examples/angular/fixed/package.json
  • examples/angular/infinite-scroll/README.md
  • examples/angular/infinite-scroll/package.json
  • examples/angular/padding/README.md
  • examples/angular/padding/package.json
  • examples/angular/smooth-scroll/README.md
  • examples/angular/smooth-scroll/package.json
  • examples/angular/sticky/README.md
  • examples/angular/sticky/package.json
  • examples/angular/table/README.md
  • examples/angular/table/package.json
  • examples/angular/variable/README.md
  • examples/angular/variable/package.json
  • examples/angular/window/README.md
  • examples/angular/window/package.json
  • examples/lit/dynamic/package.json
  • examples/lit/fixed/package.json
  • examples/marko/dynamic/package.json
  • examples/marko/fixed/package.json
  • examples/marko/grid/package.json
  • examples/marko/infinite-scroll/package.json
  • examples/marko/smooth-scroll/package.json
  • examples/marko/variable/package.json
  • examples/marko/window/package.json
  • examples/react/chat/package.json
  • examples/react/dynamic/package.json
  • examples/react/fixed/package.json
  • examples/react/pretext/package.json
  • examples/react/window/package.json
  • examples/svelte/dynamic/package.json
  • examples/svelte/fixed/package.json
  • examples/svelte/infinite-scroll/package.json
  • examples/svelte/smooth-scroll/package.json
  • examples/svelte/sticky/package.json
  • examples/svelte/table/package.json
  • examples/vue/dynamic/package.json
  • examples/vue/fixed/package.json
  • examples/vue/infinite-scroll/package.json
  • examples/vue/padding/package.json
  • examples/vue/scroll-padding/package.json
  • examples/vue/smooth-scroll/package.json
  • examples/vue/sticky/package.json
  • examples/vue/table/package.json
  • examples/vue/variable/package.json
  • package.json
  • packages/angular-virtual/package.json
  • packages/angular-virtual/tsconfig.json
  • packages/lit-virtual/tsconfig.json
  • packages/marko-virtual/tsconfig.json
  • packages/react-virtual/tsconfig.json
  • packages/solid-virtual/tsconfig.json
  • packages/svelte-virtual/tsconfig.json
  • packages/virtual-core/tsconfig.json
  • packages/vue-virtual/tsconfig.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant