Skip to content

fix(cnwebsite): 修复 Docusaurus 3.10 编译 + 调整 getting-started 顺序#1022

Merged
sunnylqm merged 1 commit into
productionfrom
fix/cnwebsite-build-20260512
May 12, 2026
Merged

fix(cnwebsite): 修复 Docusaurus 3.10 编译 + 调整 getting-started 顺序#1022
sunnylqm merged 1 commit into
productionfrom
fix/cnwebsite-build-20260512

Conversation

@sunnylqm
Copy link
Copy Markdown

@sunnylqm sunnylqm commented May 12, 2026

变更内容

编译修复

  • markdown.format: detect: Docusaurus 3.10 默认用 MDX 解析器处理所有 .md 文件,导致 HTML 注释和自定义 heading ID 等语法报错。设置 detect 后 .md 按标准 markdown 解析,.mdx 按 MDX 解析
  • 删除 versioned_docs 中的 HTML 注释: alex ignore、TODO 等注释在 MDX v3 中不合法,已批量清除
  • 删除自定义 heading ID: cndocs/legacy/native-components-android.md 中的自定义 ID 在 MDX 中被当作无效 JSX 表达式
  • 清理侧边栏: 移除对已删除文档的引用(metro、what-is-codegen、using-codegen、create-module-library)

getting-started 调整

  • Tab 顺序: 将 React Native CLI Quickstart 移到 Expo Go Quickstart 之前(符合 CN 文档不 promote Expo 的原则)
  • 默认 Tab: defaultGuide 从 quickstart(Expo) 改为 native(CLI)

验证

  • yarn --cwd cnwebsite build 编译成功
  • 79 个文件变更,主要是 versioned_docs 的 HTML 注释清理

Summary by CodeRabbit

Release Notes

  • Documentation

    • Reorganized Getting Started guide with improved tab-based navigation for platform and OS selection
    • Updated default guide selection to emphasize native development workflow
    • Cleaned up documentation formatting across guide versions
  • Configuration

    • Reordered development guide options and adjusted default preferences for better discovery

Review Change Stack

- Add markdown.format: 'detect' to avoid MDX parsing of .md files
- Remove HTML comments in versioned docs (invalid in MDX v3)
- Remove custom heading ID {#imageview-example} (invalid MDX expression)
- Remove orphaned sidebar entries (metro, codegen, create-module-library)
- Reorder getting-started tabs: React Native CLI before Expo
- Update default guide to 'native' in TabsConstants
@netlify
Copy link
Copy Markdown

netlify Bot commented May 12, 2026

Deploy Preview for reactnativecn failed. Why did it fail? →

Name Link
🔨 Latest commit 46b8577
🔍 Latest deploy log https://app.netlify.com/projects/reactnativecn/deploys/6a031c20cca0660008f1d2b0

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

📝 Walkthrough

Walkthrough

This PR restructures the React Native Chinese documentation site by updating navigation defaults, reorganizing tab layouts, adding Mermaid configuration, and systematically removing HTML comment artifacts across 15+ versioned docs while fixing a broken anchor reference.

Changes

Documentation and Navigation Restructuring

Layer / File(s) Summary
Tab defaults and sidebar navigation
cnwebsite/core/TabsConstants.tsx, cnwebsite/sidebars.ts
Reorder guides array to prioritize "React Native CLI Quickstart" ('native') as default instead of 'quickstart'; update sidebar to remove metro from workflow list, narrow Codegen section to single entry, and remove create-module-library from appendix.
Mermaid diagram configuration
cnwebsite/docusaurus.config.ts
Add format: 'detect' to Mermaid settings under markdown.mermaid to enable automatic diagram format detection.
Native guide tab layout restructuring
cndocs/getting-started.md
Reorganize nested Tabs/TabItem structure to support OS selection (macOS, Windows, Linux) with embedded platform-specific sub-guides and adjust closing tags to match new hierarchy.
Fix broken anchor reference
cndocs/legacy/native-components-android.md
Remove explicit Markdown anchor ID {#imageview-example} from "ImageView 示例" heading, creating mismatch with existing link reference #imageview-example in same file.
TypeScript code sample formatting
cnwebsite/versioned_docs/version-0.70/new-architecture-library-intro.md
Tighten import syntax/spacing in TurboModule and Fabric specs, reflow export default and requireNativeComponent across lines, remove <!-- alex ignore primitive --> and <!-- alex ignore master --> comments while preserving code structure.
HTML comments cleanup across versions
cnwebsite/versioned_docs/version-0.7*-0.85/*
Remove alex-ignore directives (<!-- alex ignore black white -->, <!-- alex ignore host -->, <!-- alex ignore primitive/master -->) and TODO placeholders (<!-- TODO: add links -->, <!-- TODO: Add links to TM and FC -->) from colors.md, new-architecture-library-intro.md, running-on-device.md, and Codegen-related docs (create-module-library, using-codegen, what-is-codegen) across 15+ versions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 Tabs now nested with grace,
Guides reordered, comments erased,
A thousand versions cleaned with care,
Navigation smooth everywhere!
From CLI to docs pristine,
The finest restructure we've seen!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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 two main changes: fixing Docusaurus 3.10 compilation issues and adjusting the getting-started guide order.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix/cnwebsite-build-20260512

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

Copy link
Copy Markdown

@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: 3

🧹 Nitpick comments (3)
cndocs/getting-started.md (3)

20-20: 💤 Low value

Heading level skips from H1 to H4.

The "开发平台" heading at line 20 is marked as H4 (####), but it should increment by only one level at a time according to markdown best practices. Consider using H2 (##) instead to maintain proper heading hierarchy.

📝 Suggested fix for heading level
-#### 开发平台
+## 开发平台
🤖 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 `@cndocs/getting-started.md` at line 20, The "开发平台" heading is currently a H4
(#### 开发平台) which skips levels after the H1; change that line to H2 (## 开发平台) so
the heading increments properly (H1 -> H2), and review surrounding headings in
getting-started.md to ensure the overall document hierarchy is consistent.

61-61: 💤 Low value

Duplicate "暂不支持" headings across tab contexts.

The heading "暂不支持" appears at lines 61 and 85. Since these occur in different OS tab contexts (Windows/iOS and Linux/iOS), the duplication may be acceptable, but consider whether the headings could be made more specific (e.g., "iOS 暂不支持" or adding context about which platform).

Also applies to: 85-85

🤖 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 `@cndocs/getting-started.md` at line 61, The duplicate markdown heading "##
暂不支持" appears in multiple OS tab contexts; update each heading to include the
platform context so they are unique and clear (for example change the heading in
the Windows/iOS tab to "## Windows/iOS 暂不支持" and the one in the Linux/iOS tab to
"## Linux/iOS 暂不支持" or otherwise add platform-specific text), ensuring you
update the headings that contain the exact text "## 暂不支持" so readers can tell
which platform each section refers to.

47-47: 💤 Low value

Duplicate "目标平台" headings across tab contexts.

The heading "目标平台" appears at lines 47 and 71 (and implicitly at line 25). While these occur in different tab contexts, duplicate headings can affect document navigation and accessibility. Consider adding distinguishing text or using different heading structures.

Also applies to: 71-71

🤖 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 `@cndocs/getting-started.md` at line 47, The document contains repeated
headings "目标平台" in the same file (use the literal heading text "目标平台" to find
them); update each duplicate heading to be unique and context-specific (for
example "目标平台 — 桌面", "目标平台 — 移动" or "目标平台(安装向导)"), or change some duplicates to
a lower-level heading to preserve navigation hierarchy; ensure the modified
headings remain clear in their tab contexts and retain consistent formatting so
anchor links and accessibility tools can distinguish them.
🤖 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.

Inline comments:
In `@cndocs/legacy/native-components-android.md`:
- Line 19: The internal link at line 866 points to the removed custom anchor
`#imageview-example`; update that link to the auto-generated Docusaurus anchor
for the heading "ImageView 示例" by replacing `#imageview-example` with
`#imageview-示例` (or update to use the exact heading text anchor format generated
from the "ImageView 示例" heading) so the link matches the auto-generated anchor
for the heading.

In `@cnwebsite/sidebars.ts`:
- Line 86: The sidebar entry Codegen: ['the-new-architecture/codegen-cli'] was
added but many docs still reference removed pages (what-is-codegen.md,
using-codegen.md, create-module-library.md); open the affected files
(cndocs/turbo-native-modules.md, cndocs/turbo-native-modules-android.md,
cndocs/the-new-architecture/pure-cxx-modules.md,
cndocs/the-new-architecture/advanced-topics-components.md,
cndocs/the-new-architecture/advanced-topics-modules.md,
cndocs/new-architecture-turbo-module.md, cndocs/fabric-native-components.md) and
either update links to point to the new /the-new-architecture/codegen-cli
location or remove/replace the links with appropriate existing docs, ensuring
any references to what-is-codegen, using-codegen, or create-module-library are
replaced consistently with the new codegen-cli page or deleted if the content no
longer exists.

In `@cnwebsite/versioned_docs/version-0.70/new-architecture-library-intro.md`:
- Around line 105-106: The import for the TypeScript type ViewProps is using the
wrong module; update the import so that ViewProps is imported from
'react-native' (not 'ViewPropTypes') — replace the existing import line that
reads import type {ViewProps} from 'ViewPropTypes' with an import from
'react-native' alongside HostComponent (ensure the symbol ViewProps is
referenced from 'react-native' so TypeScript resolution works for consumers).

---

Nitpick comments:
In `@cndocs/getting-started.md`:
- Line 20: The "开发平台" heading is currently a H4 (#### 开发平台) which skips levels
after the H1; change that line to H2 (## 开发平台) so the heading increments
properly (H1 -> H2), and review surrounding headings in getting-started.md to
ensure the overall document hierarchy is consistent.
- Line 61: The duplicate markdown heading "## 暂不支持" appears in multiple OS tab
contexts; update each heading to include the platform context so they are unique
and clear (for example change the heading in the Windows/iOS tab to "##
Windows/iOS 暂不支持" and the one in the Linux/iOS tab to "## Linux/iOS 暂不支持" or
otherwise add platform-specific text), ensuring you update the headings that
contain the exact text "## 暂不支持" so readers can tell which platform each section
refers to.
- Line 47: The document contains repeated headings "目标平台" in the same file (use
the literal heading text "目标平台" to find them); update each duplicate heading to
be unique and context-specific (for example "目标平台 — 桌面", "目标平台 — 移动" or
"目标平台(安装向导)"), or change some duplicates to a lower-level heading to preserve
navigation hierarchy; ensure the modified headings remain clear in their tab
contexts and retain consistent formatting so anchor links and accessibility
tools can distinguish them.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 41ed51ac-4df7-4170-a468-d09ddbac3444

📥 Commits

Reviewing files that changed from the base of the PR and between d79a052 and 46b8577.

📒 Files selected for processing (79)
  • cndocs/getting-started.md
  • cndocs/legacy/native-components-android.md
  • cnwebsite/core/TabsConstants.tsx
  • cnwebsite/docusaurus.config.ts
  • cnwebsite/sidebars.ts
  • cnwebsite/versioned_docs/version-0.70/colors.md
  • cnwebsite/versioned_docs/version-0.70/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.70/running-on-device.md
  • cnwebsite/versioned_docs/version-0.71/colors.md
  • cnwebsite/versioned_docs/version-0.71/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.71/running-on-device.md
  • cnwebsite/versioned_docs/version-0.72/colors.md
  • cnwebsite/versioned_docs/version-0.72/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.72/running-on-device.md
  • cnwebsite/versioned_docs/version-0.73/colors.md
  • cnwebsite/versioned_docs/version-0.73/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.73/running-on-device.md
  • cnwebsite/versioned_docs/version-0.74/colors.md
  • cnwebsite/versioned_docs/version-0.74/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.74/running-on-device.md
  • cnwebsite/versioned_docs/version-0.75/colors.md
  • cnwebsite/versioned_docs/version-0.75/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.75/running-on-device.md
  • cnwebsite/versioned_docs/version-0.76/colors.md
  • cnwebsite/versioned_docs/version-0.76/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.76/running-on-device.md
  • cnwebsite/versioned_docs/version-0.76/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.76/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.76/the-new-architecture/what-is-codegen.md
  • cnwebsite/versioned_docs/version-0.77/colors.md
  • cnwebsite/versioned_docs/version-0.77/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.77/running-on-device.md
  • cnwebsite/versioned_docs/version-0.77/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.77/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.77/the-new-architecture/what-is-codegen.md
  • cnwebsite/versioned_docs/version-0.78/colors.md
  • cnwebsite/versioned_docs/version-0.78/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.78/running-on-device.md
  • cnwebsite/versioned_docs/version-0.78/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.78/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.78/the-new-architecture/what-is-codegen.md
  • cnwebsite/versioned_docs/version-0.79/colors.md
  • cnwebsite/versioned_docs/version-0.79/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.79/running-on-device.md
  • cnwebsite/versioned_docs/version-0.79/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.79/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.79/the-new-architecture/what-is-codegen.md
  • cnwebsite/versioned_docs/version-0.80/colors.md
  • cnwebsite/versioned_docs/version-0.80/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.80/running-on-device.md
  • cnwebsite/versioned_docs/version-0.80/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.80/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.80/the-new-architecture/what-is-codegen.md
  • cnwebsite/versioned_docs/version-0.81/colors.md
  • cnwebsite/versioned_docs/version-0.81/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.81/running-on-device.md
  • cnwebsite/versioned_docs/version-0.81/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.81/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.81/the-new-architecture/what-is-codegen.md
  • cnwebsite/versioned_docs/version-0.82/colors.md
  • cnwebsite/versioned_docs/version-0.82/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.82/running-on-device.md
  • cnwebsite/versioned_docs/version-0.82/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.82/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.82/the-new-architecture/what-is-codegen.md
  • cnwebsite/versioned_docs/version-0.83/colors.md
  • cnwebsite/versioned_docs/version-0.83/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.83/running-on-device.md
  • cnwebsite/versioned_docs/version-0.83/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.83/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.83/the-new-architecture/what-is-codegen.md
  • cnwebsite/versioned_docs/version-0.84/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.84/running-on-device.md
  • cnwebsite/versioned_docs/version-0.84/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.84/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.84/the-new-architecture/what-is-codegen.md
  • cnwebsite/versioned_docs/version-0.85/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.85/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.85/the-new-architecture/what-is-codegen.md
💤 Files with no reviewable changes (73)
  • cnwebsite/versioned_docs/version-0.85/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.81/colors.md
  • cnwebsite/versioned_docs/version-0.83/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.80/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.82/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.82/colors.md
  • cnwebsite/versioned_docs/version-0.84/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.77/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.70/running-on-device.md
  • cnwebsite/versioned_docs/version-0.77/the-new-architecture/what-is-codegen.md
  • cnwebsite/versioned_docs/version-0.82/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.83/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.71/running-on-device.md
  • cnwebsite/versioned_docs/version-0.80/the-new-architecture/what-is-codegen.md
  • cnwebsite/versioned_docs/version-0.84/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.84/running-on-device.md
  • cnwebsite/versioned_docs/version-0.78/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.80/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.78/colors.md
  • cnwebsite/versioned_docs/version-0.75/colors.md
  • cnwebsite/versioned_docs/version-0.71/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.82/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.79/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.81/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.81/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.76/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.81/the-new-architecture/what-is-codegen.md
  • cnwebsite/versioned_docs/version-0.76/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.78/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.78/the-new-architecture/what-is-codegen.md
  • cnwebsite/versioned_docs/version-0.72/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.76/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.82/running-on-device.md
  • cnwebsite/versioned_docs/version-0.83/the-new-architecture/what-is-codegen.md
  • cnwebsite/versioned_docs/version-0.83/running-on-device.md
  • cnwebsite/versioned_docs/version-0.78/running-on-device.md
  • cnwebsite/versioned_docs/version-0.83/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.77/running-on-device.md
  • cnwebsite/versioned_docs/version-0.73/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.74/running-on-device.md
  • cnwebsite/versioned_docs/version-0.76/running-on-device.md
  • cnwebsite/versioned_docs/version-0.78/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.73/colors.md
  • cnwebsite/versioned_docs/version-0.84/the-new-architecture/what-is-codegen.md
  • cnwebsite/versioned_docs/version-0.82/the-new-architecture/what-is-codegen.md
  • cnwebsite/versioned_docs/version-0.73/running-on-device.md
  • cnwebsite/versioned_docs/version-0.81/running-on-device.md
  • cnwebsite/versioned_docs/version-0.77/colors.md
  • cnwebsite/versioned_docs/version-0.76/the-new-architecture/what-is-codegen.md
  • cnwebsite/versioned_docs/version-0.77/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.71/colors.md
  • cnwebsite/versioned_docs/version-0.85/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.81/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.72/colors.md
  • cnwebsite/versioned_docs/version-0.79/running-on-device.md
  • cnwebsite/versioned_docs/version-0.79/the-new-architecture/using-codegen.md
  • cnwebsite/versioned_docs/version-0.74/colors.md
  • cnwebsite/versioned_docs/version-0.79/colors.md
  • cnwebsite/versioned_docs/version-0.85/the-new-architecture/what-is-codegen.md
  • cnwebsite/versioned_docs/version-0.70/colors.md
  • cnwebsite/versioned_docs/version-0.80/colors.md
  • cnwebsite/versioned_docs/version-0.83/colors.md
  • cnwebsite/versioned_docs/version-0.75/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.80/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.79/the-new-architecture/what-is-codegen.md
  • cnwebsite/versioned_docs/version-0.74/new-architecture-library-intro.md
  • cnwebsite/versioned_docs/version-0.72/running-on-device.md
  • cnwebsite/versioned_docs/version-0.79/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.76/colors.md
  • cnwebsite/versioned_docs/version-0.75/running-on-device.md
  • cnwebsite/versioned_docs/version-0.80/running-on-device.md
  • cnwebsite/versioned_docs/version-0.77/the-new-architecture/create-module-library.md
  • cnwebsite/versioned_docs/version-0.84/new-architecture-library-intro.md

:::

## ImageView 示例 {#imageview-example}
## ImageView 示例
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify the auto-generated anchor format for Chinese headings in Docusaurus

# Check Docusaurus configuration for slug generation settings
cat cnwebsite/docusaurus.config.js | grep -A 5 "slug"

# Search for similar Chinese heading anchor references in the codebase to understand the pattern
rg -n "#[a-z-]+示例" --glob "*.md" --glob "*.mdx" -C 2

Repository: reactnativecn/react-native-website

Length of output: 141


🏁 Script executed:

# First, confirm the file exists and read the relevant lines
head -20 cndocs/legacy/native-components-android.md | tail -5

# Also read around line 866
sed -n '860,870p' cndocs/legacy/native-components-android.md

# Find Docusaurus config file
find . -name "docusaurus.config.js" -type f 2>/dev/null

Repository: reactnativecn/react-native-website

Length of output: 301


🏁 Script executed:

# Search for Docusaurus configuration more broadly
find . -type f -name "*.config.js" 2>/dev/null | head -20

# Also check the directory structure
ls -la | grep -E "^d"

# Look for other markdown headings in the same file to understand the auto-generation pattern
rg "^## " cndocs/legacy/native-components-android.md -n | head -20

# Search for similar link patterns with Chinese anchors in other markdown files
rg "\]\(#[^)]*[^\x00-\x7F]" cndocs/ --glob "*.md" -c | head -20

Repository: reactnativecn/react-native-website

Length of output: 1121


🏁 Script executed:

# Check cnwebsite directory structure
ls -la cnwebsite/ | head -20

# Look for docusaurus config
find cnwebsite/ -name "*.config.js" -o -name "*.config.json" -o -name "docusaurus.config.ts" 2>/dev/null

# Search for actual anchor link patterns in cndocs to understand the convention
rg "\[.*\]\(#" cndocs/ -A 1 -B 1 --glob "*.md" | head -40

# Check if there are any build artifacts or references that show auto-generated anchors
rg "imageview" cndocs/ --glob "*.md" -i

Repository: reactnativecn/react-native-website

Length of output: 6040


🏁 Script executed:

# Check the Docusaurus configuration for slug generation rules
grep -A 10 -B 10 "slug\|markdownLinkExtensions\|remark" cnwebsite/docusaurus.config.ts | head -50

# Also check .remarkrc.mjs for markdown processing rules
cat cnwebsite/.remarkrc.mjs

# Look for how similar Chinese headings are referenced in other files
rg "\]\(#" cndocs/ --glob "*.md" | grep -v "virtualview" | head -20

Repository: reactnativecn/react-native-website

Length of output: 4274


🏁 Script executed:

# Search for other mixed English-Chinese headings in cndocs
rg "^##[^#]*([\u4e00-\u9fff])" cndocs/ --glob "*.md" -o | head -20

# Check if there are examples in the same file with similar patterns
grep "^##" cndocs/legacy/native-components-android.md | head -10

# Verify the exact line 866 content one more time
sed -n '866p' cndocs/legacy/native-components-android.md

Repository: reactnativecn/react-native-website

Length of output: 1047


Update the broken anchor link at line 866.

Line 866 references #imageview-example, but the custom anchor ID {#imageview-example} was removed from the heading at line 19 to fix MDX v3 compilation. Docusaurus now auto-generates the anchor from the heading text "ImageView 示例" as #imageview-示例.

Update line 866 to fix the broken internal link:

📝 Suggested fix
-如果您想使用公开属性设置器 `@ReactProp` (or `@ReactPropGroup`) 详见上面的 [ImageView 示例](`#imageview-example`)。
+如果您想使用公开属性设置器 `@ReactProp` (or `@ReactPropGroup`) 详见上面的 [ImageView 示例](`#imageview-示例`)。
🤖 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 `@cndocs/legacy/native-components-android.md` at line 19, The internal link at
line 866 points to the removed custom anchor `#imageview-example`; update that
link to the auto-generated Docusaurus anchor for the heading "ImageView 示例" by
replacing `#imageview-example` with `#imageview-示例` (or update to use the exact
heading text anchor format generated from the "ImageView 示例" heading) so the
link matches the auto-generated anchor for the heading.

Comment thread cnwebsite/sidebars.ts
'the-new-architecture/using-codegen',
'the-new-architecture/codegen-cli',
],
Codegen: ['the-new-architecture/codegen-cli'],
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if the allegedly removed doc files still exist

echo "=== Checking for removed documentation files ==="

# Check for the files that should have been removed
fd -t f "metro\.md" cndocs cnwebsite/versioned_docs
fd -t f "what-is-codegen\.md" cndocs cnwebsite/versioned_docs  
fd -t f "using-codegen\.md" cndocs cnwebsite/versioned_docs
fd -t f "create-module-library\.md" cndocs cnwebsite/versioned_docs

echo ""
echo "=== Checking for references to removed docs ==="

# Search for any remaining references to these docs
rg -n "metro\.md|metro['\"]" cnwebsite/sidebars.ts cnwebsite/docusaurus.config.ts -C2
rg -n "what-is-codegen|using-codegen|create-module-library" cnwebsite/sidebars.ts -C2

echo ""
echo "=== Checking markdown links to removed docs ==="

# Check for markdown links to these removed docs
rg -n "\[.*\]\(.*(?:metro|what-is-codegen|using-codegen|create-module-library).*\)" cndocs -g "*.md" -g "*.mdx"

Repository: reactnativecn/react-native-website

Length of output: 7870


Fix broken links to removed documentation pages.

The files what-is-codegen.md, using-codegen.md, and create-module-library.md were correctly removed from the sidebar, but multiple documentation files still contain broken links to these deleted pages:

  • cndocs/turbo-native-modules.md:37/the-new-architecture/what-is-codegen.md
  • cndocs/turbo-native-modules-android.md:209the-new-architecture/create-module-library.md
  • cndocs/the-new-architecture/pure-cxx-modules.md:75what-is-codegen.md
  • cndocs/the-new-architecture/advanced-topics-components.md:3what-is-codegen
  • cndocs/the-new-architecture/advanced-topics-modules.md:3what-is-codegen
  • cndocs/new-architecture-turbo-module.md (3 references) → using-codegen
  • cndocs/fabric-native-components.md:53what-is-codegen

These links must be updated to point to the correct location or removed if the referenced content no longer exists.

🤖 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 `@cnwebsite/sidebars.ts` at line 86, The sidebar entry Codegen:
['the-new-architecture/codegen-cli'] was added but many docs still reference
removed pages (what-is-codegen.md, using-codegen.md, create-module-library.md);
open the affected files (cndocs/turbo-native-modules.md,
cndocs/turbo-native-modules-android.md,
cndocs/the-new-architecture/pure-cxx-modules.md,
cndocs/the-new-architecture/advanced-topics-components.md,
cndocs/the-new-architecture/advanced-topics-modules.md,
cndocs/new-architecture-turbo-module.md, cndocs/fabric-native-components.md) and
either update links to point to the new /the-new-architecture/codegen-cli
location or remove/replace the links with appropriate existing docs, ensuring
any references to what-is-codegen, using-codegen, or create-module-library are
replaced consistently with the new codegen-cli page or deleted if the content no
longer exists.

Comment on lines +105 to +106
import type {ViewProps} from 'ViewPropTypes';
import type {HostComponent} from 'react-native';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

For React Native 0.70 TypeScript docs/examples, what is the correct import path for ViewPropsin Fabric component specs:react-nativeorViewPropTypes?

💡 Result:

The correct import path for ViewProps in React Native 0.70 TypeScript Fabric component specs is import type { ViewProps } from 'react-native'; [1][2][3][4]. ViewPropTypes refers to the deprecated runtime PropTypes (e.g., ViewPropTypes object for prop validation), not the TypeScript type ViewProps. ViewPropTypes was deprecated around 0.66-0.71 and migrated to deprecated-react-native-prop-types for JS/PropTypes usage, but is irrelevant for TypeScript Fabric specs which use ViewProps from react-native [5][6][7][8]. Official and example code consistently shows: import type { ViewProps } from 'react-native'; export interface NativeProps extends ViewProps { ... } This pattern holds from 0.70 (Fabric enabled) through later versions [1][2][4][9]. No sources indicate ViewPropTypes as a module for TypeScript imports in this context [10].

Citations:


Fix TypeScript import path for ViewProps to be resolvable in consumer projects.

Line 105 imports ViewProps from an invalid module path. In React Native 0.70, ViewProps must be imported from react-native, not ViewPropTypes (which is the deprecated runtime PropTypes object).

Suggested fix
-import type {ViewProps} from 'ViewPropTypes';
+import type {ViewProps} from 'react-native';
 import type {HostComponent} from 'react-native';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import type {ViewProps} from 'ViewPropTypes';
import type {HostComponent} from 'react-native';
import type {ViewProps} from 'react-native';
import type {HostComponent} from 'react-native';
🤖 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 `@cnwebsite/versioned_docs/version-0.70/new-architecture-library-intro.md`
around lines 105 - 106, The import for the TypeScript type ViewProps is using
the wrong module; update the import so that ViewProps is imported from
'react-native' (not 'ViewPropTypes') — replace the existing import line that
reads import type {ViewProps} from 'ViewPropTypes' with an import from
'react-native' alongside HostComponent (ensure the symbol ViewProps is
referenced from 'react-native' so TypeScript resolution works for consumers).

@sunnylqm sunnylqm merged commit bd3c374 into production May 12, 2026
1 of 5 checks passed
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