Skip to content

Feat/v1.10.0 robots meta#24

Merged
umsungjun merged 7 commits into
mainfrom
feat/v1.10.0-robots-meta
Jun 23, 2026
Merged

Feat/v1.10.0 robots meta#24
umsungjun merged 7 commits into
mainfrom
feat/v1.10.0-robots-meta

Conversation

@umsungjun

@umsungjun umsungjun commented Jun 23, 2026

Copy link
Copy Markdown
Owner
  • feat: add robots prop for controlling crawler indexing
  • docs: document robots prop and its noindex limitation in CSR
  • chore: bump version to 1.10.0

Summary by CodeRabbit

  • New Features

    • Added support for the robots meta tag to control search engine crawler directives.
  • Documentation

    • Updated API reference with robots prop details and guidance on reliable search engine exclusion methods, clarifying behavior differences across crawler types.

Copilot AI review requested due to automatic review settings June 23, 2026 00:15
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-head-safe Ready Ready Preview, Comment Jun 23, 2026 12:15am

@umsungjun umsungjun self-assigned this Jun 23, 2026
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 272d11d9-2bff-4520-a654-712fa7523064

📥 Commits

Reviewing files that changed from the base of the PR and between c4df3b6 and 09e4dc6.

📒 Files selected for processing (6)
  • README.ko.md
  • README.md
  • package.json
  • src/ReactHeadSafe.tsx
  • src/test/ReactHeadSafe.test.tsx
  • src/types.ts

📝 Walkthrough

Walkthrough

Adds a robots prop to ReactHeadSafe: the type interface gains an optional robots?: string field, the component's useLayoutEffect conditionally injects a meta[name="robots"] tag, five new tests cover the full lifecycle, the package version is bumped to 1.10.0, and both English and Korean READMEs are updated.

Changes

robots prop feature

Layer / File(s) Summary
Type definition and component implementation
src/types.ts, src/ReactHeadSafe.tsx
ReactHeadSafeProps gains an optional robots?: string field with JSDoc on crawler behavior. The component destructures robots, conditionally inserts/updates meta[name="robots"] inside useLayoutEffect, and adds robots to the dependency array.
robots meta tag tests
src/test/ReactHeadSafe.test.tsx
Five test cases verify creation, content update, duplicate prevention, unmount cleanup, and removal when the robots prop becomes undefined.
Docs and version bump
README.md, README.ko.md, package.json
Both READMEs add the robots row to the ReactHeadSafeProps table and a warning about JS-injected noindex limitations with a recommendation to use X-Robots-Tag. Package version bumped from 1.9.0 to 1.10.0.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • umsungjun/react-head-safe#7: Established the ReactHeadSafeProps type in src/types.ts and the useLayoutEffect meta-tag update pattern in src/ReactHeadSafe.tsx that this PR extends with the robots field.
  • umsungjun/react-head-safe#22: Added OG/Twitter props using the same ReactHeadSafeProps extension, useLayoutEffect injection/cleanup pattern, and parallel test structure that this PR replicates for robots.
  • umsungjun/react-head-safe#21: Introduced the stale-tag cleanup logic on unmount and when props become undefined, which the new robots tests directly exercise.

Poem

🐇 A robot once wandered the web far and wide,
Seeking pages that told it to come or to hide.
Now a prop sets the rule with a word or a name,
noindex, nofollow — the crawlers all came!
But heed the small warning: use headers with care,
For JS-delayed tags leave some bots unaware. 🌐

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/v1.10.0-robots-meta

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.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@umsungjun umsungjun merged commit 48e413b into main Jun 23, 2026
5 of 6 checks passed

Copilot AI 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.

Pull request overview

Adds support for managing a robots meta tag via ReactHeadSafe, extending the library’s CSR head management capabilities and documenting the important limitation that JS-injected noindex is not reliably honored by non-JS crawlers.

Changes:

  • Added robots?: string to ReactHeadSafeProps and implemented insertion/update/removal of meta[name="robots"].
  • Added comprehensive unit tests covering create/update/no-duplicates/removal behaviors for the robots tag.
  • Updated English/Korean READMEs to document the new prop and its CSR limitations; bumped package version to 1.10.0.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/types.ts Adds the robots prop to the public TypeScript interface with guidance about CSR limitations.
src/ReactHeadSafe.tsx Writes meta[name="robots"] via existing meta-tag update logic and includes it in effect deps/cleanup.
src/test/ReactHeadSafe.test.tsx Adds test coverage for robots tag lifecycle and deduplication.
README.md Documents the new prop and warns about JS-only noindex behavior.
README.ko.md Mirrors the robots prop documentation and warning in Korean.
package.json Bumps version to 1.10.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants