Repository navigation
fix(data-objectstack,app-shell): Publish all publishes each bundle member of a package-less draft by its own ?member= (objectui#12402) - #12410
Conversation
…mber of a package-less draft by its own ?member= (objectui#12402) MetadataClient.publishDraft takes an optional member, sent as ?member= only when given; usePublishAllDrafts keeps each _drafts row's member and passes it on the package-less path. Claude-Session: https://claude.ai/code/session_01XVp19E1MYUTFM3dnkwz8gB Co-authored-by: Claude <noreply@anthropic.com>
… Publish all's package-less path (objectui#12402) Claude-Session: https://claude.ai/code/session_01XVp19E1MYUTFM3dnkwz8gB Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XVp19E1MYUTFM3dnkwz8gB Co-authored-by: Claude <noreply@anthropic.com>
✅ 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 read: card #12402 (body; triage ① Derived judgments
② Semver level
③ Boundary flags
Check-runs on Implemented-by: VERDICT: PASS Generated by Claude Code |
Fixes #12402
Clause-②: yes (widening)
What this does
"Publish all" (Home's banner and the draft-preview bar, both
usePublishAllDrafts) now publishes each language of a package-lessemail_templateby its own bundle member.MetadataClient.publishDraft(type, name, options?)in@object-ui/data-objectstacktakes an optional{ member }. When it is set, the request isPOST /meta/TYPE/NAME/publish?member=VALUE. When it is not set or is empty, no parameter is sent. The param-building shape is the onereset()uses (PR fix(data-objectstack,app-shell,plugin-designer): a console reset or discard names the package whose row it removes (objectui#12335) #12396). The wire spellingmember=and itsencodeURIComponentencoding match the by-name reads inDraftChangesPanel/fetchItemBody(PR fix(app-shell): Studio's draft panel and build history address a bundle member (?member=) #12400).usePublishAllDraftskeeps eachlistDrafts()row'smemberwhen it is a non-empty string. On the package-less path it callsclient.publishDraft(type, name, { member })for a member row andpublishDraft(type, name, {})otherwise.publishPackageDrafts(packageId). That path is unchanged.Public-surface change, for the contract review
MetadataClient.publishDraft. It gains an optional third parameteroptions: { member?: string } = {}. The return type is unchanged. Every existing call has two arguments and sends exactly the URL it sent before: pinned as "keeps the two-argument call byte for byte".MetadataClientmethod,MetadataDraftHeader, the advisory event shape (emitAdvisoriesstill namestypeandnameonly), and the batch door.038d4c958(ruling 6116165299 on objectstack#22877).POST /meta/:type/:name/publishhas the closed query setpackage,member. An absent selector means the canonical member. A blank selector, or any selector on a type with no discriminator (every type butemail_template), is a located 400VALIDATION_ERROR. So the client sends the parameter only when the caller has a member. It never sends an empty one, and the hook never makes one up for a member-less row.member: the installed@objectstack/spec18.0.0-next.1declaresListDraftsResponseSchema.drafts[].memberasz.ZodOptionalofz.ZodString, read from itsdist.d.ts.Premise measurements (dispatch assumptions)
{ type, name, packageId }and droppedmember. The package-less loop calledclient.publishDraft(d.type, d.name).publishDrafttook no member and sent no query string.type+name. The one per-item string (NAME: sample data failed to load) is forseeddrafts, which carry no member.lintDraftCapabilityReferencesreceives the rows but lints onlyobject,appandaction, which never carry a member.Tests
Tree
062328bf6.packages/data-objectstack/src/metadata-client.publishDraftMember-12402.test.ts(5 cases):?member=;{}, an empty string andundefinedsend no parameter;packages/app-shell/src/preview/__tests__/usePublishAllDrafts.bundleMember-12402.test.tsx(3 cases). This is the card's pins, through the real hook,useMetadataClientandMetadataClient, withfetchstubbed:email_templatepublish with?member=en-USand?member=zh-CN;flow, and a row with an emptymember, send no selector;publish-draftscall and get no by-name publish, while a package-less member beside them gets its own?member=.vitest run packages/data-objectstack/ packages/app-shell/src/preview/:Test Files 115 passed (115),Tests 1316 passed (1316).Test Files 2 passed (2),Tests 8 passed (8).packages/app-shell/src/console/home/__tests__/anduseMetadataClient.advisorySink.test.tsx):Test Files 22 passed (22),Tests 134 passed (134). This ran outside the lock with--maxWorkers=1, a declared narrowing: two 9-minute lock waits timed out (exit 99) behind a fullpackages/app-shell/run.Ablation (one-off, through
ablation-replace.mjs)node ablation-replace.mjsfrom the objectstack checkout.usePublishAllDrafts.ts, the argumentd.member ? { member: d.member } : {}was replaced with an empty object carrying a marker comment. Anchor count went 1 to 0, the marker 0 to 1, and the blobfec8eed29b27to308438498f04.Tests 2 failed | 1 passed (3). The two-members pin and the package-bound-plus-package-less pin went red. The member-less pin stayed green. That is the predicted direction.fec8eed29b27andgit diff HEADis empty.distrebuild was involved.Gates (recorded exit codes, tree
062328bf6)type-checkfor@object-ui/data-objectstackand@object-ui/app-shell. This ran after the closure buildturbo run build --filter=@object-ui/app-shell^...(28 tasks, exit 0), which rebuiltdata-objectstack'sdistwith the new parameter. The app-shell type-check includestsconfig.test.json. The data-objectstacktsconfig.jsonincludessrc/**/*, tests included.check:phantom-deps,check:self-import,check:unreferenced-sources,check:doc-example-readers,check:handler-key-reads,check:side-effects-array,check:element-data-source-declaration,check:spec-symbols,check:action-forward-parity,check:designer-field-key-parity,check:icon-record-names,check:i18n-keys,check:i18n-drift,check:i18n-designer-parity,check:control-bytes.vi.mockfile, a new changeset, ametadata-client.tsedit):check:vi-mock-specifiers,check:vi-mock-inherit,check:vi-mock-override-shape,check:test-path-roots,check:new-line-citations,check:changeset-claims,check:pending-changeset-literals,check:metadata-write-doors,scripts/check-changeset-fixed.mjs,scripts/check-changeset-presence.mjs,scripts/check-changeset-no-major.mjs.check:spec-floors, the known failure on main (objectui#12334). Its output is "The scan collapsed: 0 package(s) declare @objectstack/spec in a consumer-facing field". It was recorded and not touched.eslint --no-inline-confignarrowed to the 4 changed files:no-explicit-any.eslint --stdin.files: ['**/*.{ts,tsx}']ineslint.config.js. The file count of 4 comes from the--format jsonoutput.Changeset
.changeset/12402-publish-all-member.md:@object-ui/data-objectstackisminor, an additive widening of a published method. objectui never declaresmajor.@object-ui/app-shellispatch.Acceptance notes
MetadataDraftHeader, the declared return element oflistDrafts(), still has nomember, although the spec row declares it. The hook reads rows throughas any[], so nothing here needed the type. Widening it is a second public-type change outside this card's file surface (publishDraftonly). Carrier: none.The advisory event that
publishDraftemits namestypeandnamebut not the member. So an advisory on azh-CNpublish reads as the template's, not the language's. This is presentation only. It stays out of scope by the dispatch's "no other client method changes". Carrier: none.Adds no product-specific widget, dialog, hook or string (see AGENTS.md › Product-neutral renderer)
Session:
https://claude.ai/code/session_01XVp19E1MYUTFM3dnkwz8gBGenerated by Claude Code