Skip to content

Conversation

@weareoutman
Copy link
Member

@weareoutman weareoutman commented Nov 10, 2025

依赖检查

组件之间的依赖声明,是微服务组件架构下的重要信息,请确保其正确性。

请勾选以下两组选项其中之一:

  • 本次 MR 没有使用上游组件(例如框架、后台组件等)的较新版本提供的特性。

或者:

  • 本次 MR 使用了上游组件(例如框架、后台组件等)的较新版本提供的特性。
  • 在对应的文件中更新了该上游组件的依赖版本(或确认了当前声明的依赖版本已包含本次 MR 使用的新特性)。

提交信息检查

Git 提交信息将决定包的版本发布及自动生成的 CHANGELOG,请检查工作内容与提交信息是否相符,并在以下每组选项中都依次确认。

破坏性变更是针对于下游使用者而言,可以通过本次改动对下游使用者的影响来识别变更类型:

  • 下游使用者不做任何改动,仍可以正常工作时,那么它属于普通变更。
  • 反之,下游使用者不做改动就无法正常工作时,那么它属于破坏性变更。

例如,构件修改了一个属性名,小产品 Storyboard 中需要使用新属性名才能工作,那么它就是破坏性变更。
又例如,构件还没有任何下游使用者,那么它的任何变更都是普通变更。

破坏性变更:

  • ⚠️ 本次 MR 包含破坏性变更的提交,请继续确认以下所有选项:
  • 没有更好的兼容方案,必须做破坏性变更。
  • 使用了 feat 作为提交类型。
  • 标注了 BREAKING CHANGE: 你的变更说明
  • 同时更新了本仓库中所有下游使用者的调用。
  • 同时更新了本仓库中所有下游使用者对该子包的依赖为即将发布的 major 版本。
  • 同时为其它仓库的 Migrating 做好了准备,例如文档或批量改动的方法。
  • 手动验证过破坏性变更在 Migrate 后可以正常工作。
  • 破坏性变更所在的提交没有意外携带其它子包的改动。

新特性:

  • 本次 MR 包含新特性的提交,且该提交不带有破坏性变更,并使用了 feat 作为提交类型。
  • 给新特性添加了单元测试。
  • 手动验证过新特性可以正常工作。

问题修复:

  • 本次 MR 包含问题修复的提交,且该提交不带有新特性或破坏性变更,并使用了 fix 作为提交类型。
  • 给问题修复添加了单元测试。
  • 手动验证过问题修复得到解决。

杂项工作:

即所有对下游使用者无任何影响、且没有必要显示在 CHANGELOG 中的改动,例如修改注释、测试用例、开发文档等:

  • 本次 MR 包含杂项工作的提交,且该提交不带有问题修复、新特性或破坏性变更,并使用了 chore, docs, test 等作为提交类型。

Summary by CodeRabbit

发布说明

  • Bug Fixes
    • 优化了类型定义生成中标签名称的处理方式,提高了命名规范的一致性。

@coderabbitai
Copy link

coderabbitai bot commented Nov 10, 2025

Walkthrough

yoplopfile.js文件中,jsx.d.ts生成逻辑的标签定义键生成方式发生改变。标签键从使用原始tagName改为使用tagName.replaceAll(".", "--"),将点号替换为双破折号。

Changes

队列 / 文件 变化摘要
标签键生成逻辑更新
packages/yo/src/plopfile.js
修改jsx.d.ts更新路径中的标签定义键生成方式,点号(.)现改为替换为双破折号(--),例如tagName.replaceAll(".", "--")

Estimated code review effort

🎯 1 (简单) | ⏱️ ~5 分钟

  • 单个文件的局部修改,字符串替换逻辑变更清晰
  • 需要验证标签键生成的新格式是否与后续处理逻辑兼容
  • 建议检查是否存在相关的单元测试用例需要更新

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive 描述包含了完整的依赖检查和提交信息检查模板,但所有检查项均未勾选确认,无法判断提交类型及变更分类是否正确。 请至少勾选'问题修复'部分中的三个确认项,以验证提交使用了'fix'类型且符合修复要求。
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed 标题清晰描述了主要改动:在jsx.d.ts中用'--'替换'.'用于标签名。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch steve/v3-fix-jsx

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.

@cypress
Copy link

cypress bot commented Nov 10, 2025

next-core    Run #11796

Run Properties:  status check passed Passed #11796  •  git commit 2de9ba27c3 ℹ️: Merge 8edf609a0c0d554c6f43ad3f81fe53e902081f14 into 69a1f401518c74aa11b0d0bc7b03...
Project next-core
Branch Review steve/v3-fix-jsx
Run status status check passed Passed #11796
Run duration 00m 26s
Commit git commit 2de9ba27c3 ℹ️: Merge 8edf609a0c0d554c6f43ad3f81fe53e902081f14 into 69a1f401518c74aa11b0d0bc7b03...
Committer Shenwei Wang
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 17
View all changes introduced in this branch ↗︎

@weareoutman weareoutman merged commit 923ef54 into v3 Nov 10, 2025
8 of 9 checks passed
@weareoutman weareoutman deleted the steve/v3-fix-jsx branch November 10, 2025 08:56
Copy link

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 69a1f40 and 8edf609.

📒 Files selected for processing (1)
  • packages/yo/src/plopfile.js (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build (20.x)
  • GitHub Check: Analyze (javascript-typescript)

const propName = `${className}Props`;
const importStatement = `import type { ${className}, ${propName} } from "./${answers.brickName}";`;
const definitionProp = ` "${tagName}": DetailedHTMLProps<HTMLAttributes<${className}>, ${className}> & ${propName};`;
const definitionProp = ` "${tagName.replaceAll(".", "--")}": DetailedHTMLProps<HTMLAttributes<${className}>, ${className}> & ${propName};`;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

批准此修复,但需验证运行时一致性

此更改将标签名中的点号替换为双破折号,这对于 JSX/TypeScript 类型定义是正确的做法,因为对象属性键中的点号在 TypeScript 接口中会导致语法问题。

但请验证以下关键点:

  1. 运行时一致性:确认实际的自定义元素注册也使用 -- 而非 .。类型定义必须与运行时的实际标签名匹配。
  2. 现有文件迁移:检查是否存在使用旧格式(包含点号)的 jsx.d.ts 文件,以及是否需要迁移计划。

请运行以下脚本验证:


🏁 Script executed:

#!/bin/bash
# 描述:验证 jsx.d.ts 文件中是否存在使用点号格式的旧标签定义

# 搜索 jsx.d.ts 文件中可能包含点号的标签定义
echo "=== 检查现有 jsx.d.ts 文件中的标签定义格式 ==="
fd -e ts -g "jsx.d.ts" --exec rg -n -C2 '"\w+\.\w+":\s*DetailedHTMLProps'

echo ""
echo "=== 搜索自定义元素注册代码以验证实际标签名格式 ==="
# 查找 customElements.define 调用以验证运行时使用的标签名格式
rg -n -C3 'customElements\.define\(' --type=ts --type=js -g '!node_modules'

echo ""
echo "=== 检查是否有使用点号格式标签的 JSX/TSX 代码 ==="
# 搜索可能使用点号格式的 JSX 标签
rg -n '<\w+\.\w+' --type=tsx --type=jsx -g '!node_modules' || echo "未找到使用点号格式的 JSX 标签"

Length of output: 20679


Need to examine the plopfile context more carefully:

#!/bin/bash
# Extract context around line 345 in plopfile.js to understand the full logic

head -360 packages/yo/src/plopfile.js | tail -50

Now I need to examine the plopfile context more carefully to understand whether this is intentional or a breaking bug:

修复 JSX 类型定义中的关键运行时不匹配问题

该修改存在严重的类型/运行时不一致问题,必须立即修复。

根据代码验证,运行时自定义元素使用点号格式注册(如 illustrations.error-messagev2-adapter.load-brickse2e.return-by-timeout),但此修改将生成的 jsx.d.ts 类型定义中的点号转换为双破折号。JSX.IntrinsicElements 中的元素名称属性键必须与实际 JSX 使用的标签名称相匹配,这意味着:

  • 生成的类型"illustrations--error-message": DetailedHTMLProps...
  • 运行时标签名customElements.define("illustrations.error-message", ...)
  • JSX 使用<illustrations.error-message /> 无法匹配到类型定义 → TypeScript 类型检查失败

必需操作

移除 replaceAll(".", "--") 逻辑,保持标签名原样。或确认这仅适用于特定的砖块,而非所有包含点号的标签。

🤖 Prompt for AI Agents
packages/yo/src/plopfile.js around line 345: the current generation replaces
dots in custom element names with double-hyphens (`replaceAll(".", "--")`),
causing a mismatch between runtime-registered tag names (e.g.
"illustrations.error-message") and the keys emitted into JSX.IntrinsicElements,
which breaks TypeScript JSX type resolution; fix by removing the replaceAll call
and emit the tagName verbatim as the JSX.IntrinsicElements key so it exactly
matches the runtime customElements.define name (or, if there is a documented
exception, constrain the replacement only to those specific cases and add a
comment), then run the type checks/tests to verify JSX usage like
<illustrations.error-message /> resolves correctly.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants