feat(types): ObjectChartSchema.chartType declares the @objectstack/spec chart families plugin-charts draws (objectui#11513) - #11518
Conversation
…milies plugin-charts draws (objectui#11513) Both faces declared eight families. The zod mirror now picks the thirteen families plugin-charts draws as a chart out of @objectstack/spec's ChartTypeSchema (.extract); the TS twin Extracts the same set from the spec's ChartType. The single-value and tabular spec families stay undeclared, refused with the set named. The 11276 and 7946 fixtures that used `radar` as the family outside the vocabulary move to `gauge`, which is still outside it. Claude-Session: https://claude.ai/code/session_01XvhGmGAP79ZB8swnkapxPC Co-authored-by: Claude <noreply@anthropic.com>
…es its chartType declares (objectui#11513) Every installed-spec ChartTypeSchema family is authored as an object-chart bag document on the inline object path and rendered through the real SchemaRenderer: a declared family parses on both faces and draws its own marks, an undeclared one is refused and draws a number or a notice. bar is the lit control, the off-spec sunburst the dark one. Claude-Session: https://claude.ai/code/session_01XvhGmGAP79ZB8swnkapxPC Co-authored-by: Claude <noreply@anthropic.com>
…ectui#11513 changeset plugin-charts.mdx gains an Object Charts section naming the families chartType takes, what the spec families it refuses render instead, and a JSON and a typed example. Claude-Session: https://claude.ai/code/session_01XvhGmGAP79ZB8swnkapxPC Co-authored-by: Claude <noreply@anthropic.com>
|
changeset-claim-re-read
|
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contract reviewServed-tier: Inputs: card #11513 (body and both comments: claim ① Derived judgmentsGround: the lockfile resolves
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
Fixes #11513
Clause-②: yes (widening)
Why
yes (widening): both faces now accept five spec families they refused. Nothing narrows. The changeset isminor.Dispatched by the
domain:spec @ objectuiseat (objectui#10217) under the seat's ruling A in the card body, claim comment5962492298, sessionhttps://claude.ai/code/session_01XvhGmGAP79ZB8swnkapxPC. This card prepares objectui#11466's V1 (draft PR #11512). objectui#11514, the dashboard producers, is blocked on it.The accept-set change
059bf1b5)ae16cff8)ObjectChartSchema.chartType(@object-ui/types/zod)z.enumof 8: bar, column, horizontal-bar, line, area, pie, donut, scatter. Zod's default refusal.stripImportedDefaults(SpecChartTypeSchema).extract(OBJECT_CHART_FAMILIES, { error }): the spec's 13 families plugin-charts draws. The refusal names the set.ObjectChartBlockSchema,properties.chartTypeObjectChartSchema['chartType']Extractof the spec'sChartTypeover the 13ObjectChartBlockNode(derived from the zod arm)sankeycompiles andgaugeis refused.specType(the react tier's key)ChartTypeSchema, by reference (20)funnel,treemap,sankey,combo,radar.gauge,solid-gauge,metric,kpi,bullet,table,pivot, and every off-spec spelling..extractis the by-reference spelling. It throws when the module loads if the spec drops a member. A spec bump that adds a family declares nothing new here.The refusal, read at head: code
invalid_value, at pathproperties.chartTypein the bag andchartTypeon the flat mirror. Itsvaluesare the 13. Message:Render time does not change. plugin-charts is read and probed only, and no renderer file is edited.
Measurements (dispatch zone 2)
H1, the installed spec. The lockfile pins
@objectstack/spec17.5.0, andpackages/typesresolves 17.5.0 (17.6.0 is not installed). ItsChartTypeSchema.options, read at runtime, are 20: bar, horizontal-bar, column, line, area, pie, donut, funnel, scatter, treemap, sankey, combo, gauge, solid-gauge, metric, kpi, bullet, radar, table, pivot.H2, what plugin-charts draws. A throwaway probe (never committed) rendered an
object-chartfor each of the 20 families plus off-specsunburst. It went through the realSchemaRenderer,SchemaRendererProviderand this package's registrations, with recharts' container fixed at 480x320. Each family was rendered in five spellings:propertiesbag;objectName+aggregate+xAxisKey+series[{dataKey}], rows served by the data source'saggregate);specType;datasetnode.Controls:
useIdin the chart's style tag.bardraws bar marks.sunburstdraws the unknown-type note.chartType(flat, bag and producer arms)normalizeChartSchemarow.advanced-chart-single-value: one number from row 0's first series. On the producer's grouped aggregate it is the first bucket's value (1of buckets 1/2/3).advanced-chart-tabular-notice("render it with the data-table / pivot components")The declared set is the 13 drawn families, a strict subset of the spec's 20.
H3, by reference. A strict subset, so
.extractoffstripImportedDefaults(SpecChartTypeSchema). The wrap keeps objectui#8317's import-boundary census green, and the strip is reference-equal here because the enum carries no default. The subset is pinned against the spec, with the complement named, inobject-chart-families-11513.test.ts.specTypestays the spec's enum by identity, and that is pinned too.H4, readers of
ObjectChartSchema['chartType']. Each was measured with a type-check after the change (a type-checker census).ChartRendererProps.schema.chartType(plugin-charts):ObjectCharthandsChartRenderera spread of the node. Its declared domain is exactly the 13, so it needs nothing.@object-ui/plugin-chartstype-check is green. A reverse leg in that program, with throwaway@ts-expect-errors, left thefunneldirective unused and thegaugeone used, which proves it read the rebuilt.d.ts.chartTypeIgnoresCompareTo(@object-ui/core): it takes astring, so it needs nothing.FilterableComponentSchemainDashboardRenderer: it readsfilter, so it needs nothing.@object-ui/plugin-dashboardtype-check is green.ObjectChartBlockNode/ObjectChartBlockSchema: they widen with the member by reference, so no edit.DashboardRendererandDashboardGridLayoutemitwidgetDispatch.SERIES_CHART_TYPES(12 families, all inside the 13). Today they build the node untyped; objectui#11514 types them.app-shellObjectView,plugin-listListViewandplugin-viewObjectViewwritechartCfg.chartType || 'bar'fromany. The spec's list-view chart config extracts bar, line, pie, area and scatter, all declared. They need nothing, and plugin-list, plugin-view and app-shell type-checks are green.CHART_TYPE_MAPinDatasetWidgetfeeds a barechartnode (ChartRenderer), notObjectChartSchema.WidgetConfigPanel'sCHART_TYPESis the dashboard widget picker.V1 compile probe (objectui#11466, PR #11512, never committed from)
I added a throwaway detached worktree at the V1 tip
ff7f748e, applied this branch's diff, and added a throwaway types test.NonNullableofObjectChartSchema['chartType'].ObjectChartSchemanode withchartType: 'sankey'.treemapnode, to V1'sDeclaredNodewith no cast.gaugenode behind@ts-expect-error.Results:
@object-ui/typestype-check is green.objectql.tsandobjectql.zod.ts(the 8-family face) is red on exactly the producer list, thesankeynode and thetreemapnode (TS2322). It is also red on this PR's twoEqualassertions.pnpm installin that probe tree ran with--config.engine-strict=false. Only in the probe; the probe tree is removed.Pins
packages/types/src/__tests__/object-chart-families-11513.test.ts(new):tsc -p tsconfig.test.json: TS = zod = the 13. Every declared family is a specChartType, and the declared and undeclared lists cover the spec. Two non-vacuity rows check thatEqualcan fail.specTypekeeps its identity.safeValidateSchemaand onStrictAnyComponentSchema, and on the flat mirror.sunburst,Barandbar-chart, is refused atproperties.chartTypewithvaluesequal to the 13 and a message naming each of them. The flat mirror refuses atchartType, with a lit control.packages/plugin-charts/src/__tests__/object-chart-declared-families-11513.test.tsx(new):SchemaRenderer.bar, dark controlsunburst.object-chart-properties-bag-11276.test.ts: the "outside the vocabulary" row and the flat-mirror refusal move fromradar(now declared) togauge. The TS twin equality pin now reads TS = zod; the members are held by the new file.ObjectChart.schemaAnchor-7946.test.ts: its@ts-expect-errorfamily moves fromradartogauge, with the reason in the directive.Reverse verification and ablation
0703053b(the mirror's blob is the same at headae16cff8), through objectstack'sscripts/ablation-replace.mjs(wrap mode, anchor hit 1 to 0, blob04c4bbc2to9c207bd2):.extract(OBJECT_CHART_FAMILIES, { error: OBJECT_CHART_FAMILY_REFUSAL })with.extract([... the old 8 ...]).valuesbecame the 8). The 8 old families stayed green.HEAD04c4bbc2, andgit diff HEADis empty.Equalrows when the face reverts.content/docs/plugins/plugin-charts.mdx's new typed snippet withchartType: 'gauge'failspnpm check:doc-snippets(TS2322 at that block, 777 judged and 1 failed). Restore was proven the same way. So the block is on the gate's surface.Corpus re-judged
object-chartdocument names a family outside the old 8.git grepoverexamples/,apps/,content/,skills/andpackages/*/examples/found one hit,chart-examples.ts'sradar, and that is a barechartnode.examples/**): itsobject-chartnodes usebar,donutandarea. The react-tier ObjectChart block withtype="bar"goes throughspecType, which is unchanged.examples/schema-catalogis green (40 files, 2259 tests). So are the 19 downstream test files that nameobject-chart(597 tests), across app-shell, core, plugin-dashboard, plugin-list, plugin-view, react and sdui-parser.Pending changesets read
I read every
.changeset/*.mdthat nameschartType,object-chart,ObjectChartSchemaor a chart family (58 entries besides this PR's), and none is made false. The ones that state something about this key, left alone:5927-zod-mirror-group-a-widenings.mdlists what that change added (column,horizontal-bar,donut). It is still the reading of that change.objectchart-schema-anchor-7946.md: "chartTypemust be the declared union" still holds.10770-object-chart-react-tier-node.md:specTypeis unchanged, and so ischartType's optionality.11276-object-chart-properties-bag.md: "unchanged in shape" is about the key set, which does not move.11468-bag-carrier-node-types.md:ObjectChartBlockNodeis "derived by reference", and it widened by that derivation.10584-object-chart-series-describe.md: it is about the per-serieschartTypeoverride (bar / line / area), not this member.pnpm check:changeset-claimsnamed 30 entries by file name (objectql.ts,objectql.zod.ts). Each is about another key (forms, kanban, grid, drill-down, tree, gallery, the barechartnode's data model), so all were left alone.Gates
The source gates ran at
0703053band were re-run at headae16cff8, which adds only.md/.mdx. The doc gates and suites ran at headae16cff8.pnpm --filter @object-ui/types run type-check: exit 0.@object-ui/plugin-chartsand@object-ui/plugin-dashboard: exit 0 at head.plugin-list,plugin-viewandapp-shell: exit 0. The dependency closures were built first.pnpm exec vitest run packages/types/: 343 files, 9158 passed.pnpm exec vitest run packages/plugin-charts/: 87 files, 1043 passed and 9 skipped. The skips are the existingdescribe.runIf(DRIVEN)inAdvancedChartImpl.dateOnlyZone-10866.test.tsx.pnpm exec vitest run examples/schema-catalog/: 40 files, 2259 passed.pnpm check:doc-snippets(777 of 777 judged, 0 failed) andpnpm check:doc-examples(every covered example compiles or fails as its ledger row says);pnpm check:doc-types,node scripts/check-changeset-no-major.mjsandnode scripts/check-changeset-presence.mjs;pnpm check:new-line-citations(0 new) andpnpm check:control-bytes;pnpm check:spec-symbols,check:vi-mock-specifiers,check:vi-mock-inheritandcheck:vi-mock-override-shape;check:test-path-roots,check:self-import,check:doc-fencesandcheck:pending-changeset-literals;check:phantom-deps,check:installed-pin-claims,check:doc-example-idsandcheck:unreferenced-sources.check:component-surface-parityandcheck:sdui-registration-pins. No registration's inputs move, becauseobject-chart's registration declares nochartTypeinput.eslint --no-inline-config --format jsonran over the 6 changed TS files, read as 6 entries in the JSON. It found 0 errors and 39 warnings, allno-explicit-any. Two are in the new plugin-charts pin'svi.mock('recharts')block, the sibling pattern.eslint.config.jssets noparserOptions.project/projectService, so linting is not type-aware and this diff cannot move a verdict on an untouched file. The repo-widepnpm lintbelongs to CI.Acceptance notes
specTypesilently draws a BAR chart. ThroughchartType, the same family draws a number or a notice.specTypearm:gauge,solid-gauge,metric,kpi,bullet,tableandpivoteach drew bar marks on one value axis, with no note.{ "type": "object-chart", "properties": { "specType": "gauge", … } }(measured on the builtdist).normalizeChartSchemareadsspecTypebut gates it to unset when it is notRENDERABLE.ChartRenderer'sschema.chartType ?? spec.chartTypeis then unset, andAdvancedChartImpldefaults tobar.spec:ChartConfigSchema.type (ChartTypeSchema) → runtime:normalizeChartSchema RENDERABLE gate, ChartRenderer chartType fallback | renderer:AdvancedChartImpl default bar.chartnode, another schema).content/docs/api/schema-reference.md's ChartSchema table listschartTypevalues ending in"heatmap".safeValidateSchema({ type: 'chart', chartType: 'heatmap', … })refuses it atchartType(invalid_value, measured).funnel,treemap,sankey,combo,column,horizontal-bar).chartType(H2) have no reach after this PR:chartType;widgetDispatch);Noted, not filed.
Generated by Claude Code