Skip to content

Conversation

@pweyrich
Copy link
Contributor

@pweyrich pweyrich commented Sep 11, 2025

Summary by CodeRabbit

  • Documentation
    • Updated Angular guide example to use the modern required input syntax, simplifying the component’s input declaration.
    • Removed outdated signal-based input pattern and related comments to reflect current best practices.
    • Clarified how input binding works in the example, improving readability and reducing boilerplate.
    • Ensured the example remains consistent with the rest of the guide and easier for readers to follow.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 11, 2025

Walkthrough

Updates a documentation code sample in an Angular guide, replacing a signal-based @input pattern with the new input.required() API and removing the previous setter and initialization. Associated comments about signal-based inputs are removed. No other files or logic are changed.

Changes

Cohort / File(s) Summary
Angular guide example update
docs/framework/angular/guides/placeholder-query-data.md
Replaces @Input + setter + signal(0) with postId = input.required<number>(); retains this.postId() usage; removes comment about lack of signal-based inputs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title accurately summarizes the primary change: the Angular docs example in placeholder-query-data.md was updated to use the signal-style input API (postId = input.required()) instead of the previous @Input/setter + signal setup, and it is concise and relevant to the changeset. It contains no extraneous emojis or vague language and will be clear to teammates scanning commit history. Including the filename is slightly verbose but acceptable for a documentation change.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

A nibble of docs, a hop in the code,
I swapped the input on my sunny road.
No setter to fret, no signal to raise—
required it is, in concise new ways.
Thump-thump! I stamp: “Guide updated!” 🐇✨

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Sep 11, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/framework/angular/guides/placeholder-query-data.md (1)

48-51: Fix: reference the injected client via this.

queryClient is a class field; using it unqualified will not compile in TS. Use this.queryClient.

Apply this diff:

-      return queryClient
-        .getQueryData(['blogPosts'])
+      return this.queryClient
+        .getQueryData(['blogPosts'])
         ?.find((d) => d.id === this.postId())
🧹 Nitpick comments (1)
docs/framework/angular/guides/placeholder-query-data.md (1)

39-39: Coerce to number with a transform to avoid string inputs.

If postId can come from an attribute (e.g., ), it will be a string. Add Angular’s built-in numberAttribute transform to keep query keys and URLs numeric.

Apply within the snippet:

-  postId = input.required<number>()
+  postId = input.required<number>({ transform: numberAttribute })

If imports are shown in this doc section, also include:

import { input, numberAttribute } from '@angular/core'
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 230435d and 89b79f5.

📒 Files selected for processing (1)
  • docs/framework/angular/guides/placeholder-query-data.md (1 hunks)
🔇 Additional comments (1)
docs/framework/angular/guides/placeholder-query-data.md (1)

39-39: Good move to the signal-based input.required API.

This modernizes the example and removes the boilerplate setter. Looks correct with this.postId() reads in the snippet.

@arnoud-dv arnoud-dv merged commit 7f0e716 into TanStack:main Sep 11, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants