refactor(types)!: rename the 15 symbols that only collided with a spec name (#4115 A 组) - #3068
Merged
Merged
Conversation
…ith a spec name (objectstack#4115 group A) These are the triage's COINCIDENCE verdicts: local concepts that share a `@objectstack/spec` export's NAME while modelling something different. The name itself is the defect — #4115's own framing is that an agent reads the familiar name, assumes the spec's semantics, and builds on it (that is how #2901 was filed with a backwards premise). Renamed outright, with no back-compat aliases: FilterCondition -> FilterBuilderCondition (spec: recursive ObjectQL filter AST) FilterOperator -> FilterBuilderOperator (spec: WebSocket subscription operators) FilterConditionSchema -> FilterBuilderConditionSchema EventHandler -> UIEventHandler (spec: kernel event-bus subscription) CacheStrategy -> FetchCacheStrategy (spec: cache EVICTION policy, not fetch order) MutationEvent -> DataSourceMutationEvent (spec: a string enum, not an object) ExpressionSchema -> ExpressionNodeSchema (spec: the L1 CEL expression envelope) GroupByNode -> GroupByClauseNode (spec: a single grouping target) SpanSchema -> TextSpanSchema (spec: an OpenTelemetry tracing span) BatchOperationResult -> BatchOperationSummary (spec: ONE record's result; this is the rollup) ReportSchedule -> ReportScheduleConfig (spec: a persisted server-side row) ReportSchema -> ReportComponentSchema (spec: the report metadata document) ThemeSchema -> ThemeComponentSchema (spec: a theme DEFINITION; this is the switcher) ValidationRule (field-types) -> FieldConstraints (spec: a named server-side rule) ValidationRule (form) -> FieldValidationRules Two follow-on decisions the renames forced: - objectui had TWO conflicting local `ValidationRule`s — a flat constraint bag in field-types.ts and an RHF-style wrapped one in form.ts, sharing every key name with incompatible value shapes. The barrel exported only the second (the first was omitted specifically to dodge the collision), so a consumer deep-importing field-types silently got a different type. They now have distinct names. - `zod/reports.zod.ts` already used `ReportComponentSchema` for the discriminated UNION, so it becomes `ReportUnionSchema` — matching the convention `zod/theme.zod.ts` already follows (node = *ComponentSchema, union = *UnionSchema). The deprecated `ThemeSchema` alias is deleted rather than kept, per the same no-alias directive. Ledger 144 -> 129, regenerated with `--ledger` and diffed entry by entry: the removals are exactly these 15 names, no other package's debt dropped. Mutation-tested: re-declaring `FilterCondition` under the spec's name fails the guard by name and file. 78/78 type-check; full suite 8696 assertions green. BREAKING CHANGE: 15 type/schema exports of `@object-ui/types` are renamed with no aliases. Consumers importing the old names must update; every in-repo consumer is updated in this commit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
按维护者指示:A 组直接改名,不做别名过渡。
这 15 个是分诊里的 COINCIDENCE 判决 —— 本地概念与
@objectstack/spec的某个导出同名但建模的是别的东西。名字本身就是缺陷:#4115 的核心论点正是「agent 读到熟悉的名字,默认它是 spec 的语义,然后在此之上继续写」(#2901 就是这样被填成反向前提的)。改名清单
FilterConditionFilterBuilderConditionFilterOperatorFilterBuilderOperatorFilterConditionSchemaFilterBuilderConditionSchemaEventHandlerUIEventHandlerCacheStrategyFetchCacheStrategyMutationEventDataSourceMutationEventExpressionSchemaExpressionNodeSchemaGroupByNodeGroupByClauseNodeSpanSchemaTextSpanSchema<span>)BatchOperationResultBatchOperationSummaryReportScheduleReportScheduleConfigReportSchemaReportComponentSchemaThemeSchemaThemeComponentSchemaValidationRule(field-types)FieldConstraintsValidationRule(form)FieldValidationRules改名过程中暴露的两个问题
1. objectui 自己有两个互相冲突的
ValidationRule。field-types.ts是扁平约束包(minLength?: number),form.ts是 RHF 风格的包装形(minLength?: {value, message})—— 键名全同、值形状不兼容。barrel 只导出了后者(前者被刻意从导出块里省掉,正是为了躲开这个碰撞),所以深引field-types的消费者会静默拿到另一个类型。现在两者有了各自的名字。2.
zod/reports.zod.ts里ReportComponentSchema已被判别联合占用。 而zod/theme.zod.ts早已在用「节点 =*ComponentSchema、联合 =*UnionSchema」的约定 —— 所以把那个联合改成ReportUnionSchema,顺带让两个文件的约定一致(一个三选一的判别联合叫 "ComponentSchema" 本来也不准确)。同样按无别名指示,zod/theme.zod.ts里那个@deprecated的ThemeSchema别名直接删除而非保留。安全性:用 tsc 当裁判,不做盲目全局替换
FilterCondition/ValidationRule/ThemeSchema/ReportSchema/SpanSchema这些名字两边都有,盲替会把消费 spec 的引用也改错。做法是:先改声明与 barrel,再让编译器把所有断裂点列出来逐个判定。人工排除的真危险点包括app-shell/…/clientValidation.ts(从@objectstack/spec/ui导入ReportSchema/ThemeSchema)、app-shell/…/report-schema.ts、以及spec-report.ts:51(ReportSchema as SpecReportSchema_的导入别名)—— 这些一处未动。tsc 确实抓到了 3 处漏改(
data-protocol.ts的FilterOperator导入、registry.ts的SpanSchema导入、以及上面那个联合重名),都已修正。验证
--ledger重生成并逐条 diff:removed 恰为这 15 个、added 为空,没有误抹其他包的债务;FilterBuilderCondition改回FilterCondition→ 守卫按名+按文件报红;type-check78/78;BREAKING CHANGE
@object-ui/types的 15 个导出改名且无别名。仓内所有消费者已在本 PR 内更新(components / core / data-objectstack / mobile / plugin-report)。仓外消费者需要跟着改。🤖 Generated with Claude Code