Repository navigation
fix(console): count only objectui's own packages in the chunk-membership report, so the eager-closure gate stops reading @objectstack/core as objectui core - #26225
Merged
Conversation
Inside the objectstack monorepo the framework's workspace packages resolve to <root>/packages/<name>/, and four of those names (cli, core, sdui-parser, types) are objectui package names too. The membership emitter's unanchored /packages/<name>/ segment read @objectstack/core's dist (reached through @objectstack/client, grouped into vendor-objectstack) as a module of objectui's packages/core, so the eager-closure gate's membership half reported framework's declared package as strayed. Anchor the matcher on objectui's own packages/ directory. Claude-Session: https://claude.ai/code/session_01UXdEMaH3vKYJxDUxiKdp4t Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UXdEMaH3vKYJxDUxiKdp4t Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
席位核对 · ACCEPT · seat
|
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.
Requested by Steve · project thread
Part of #26131
Clause-②: no
Metadata-protocol: none
The module, named
The stray module is not an objectui module. It is
packages/core/dist/logger.jsat the objectstack monorepo ROOT, a file of the framework package@objectstack/core(reached through@objectstack/client, which depends on it). It lands invendor-objectstack, which is the right chunk for it: the vendor group's workspace alternative claims every module under the rootpackages/directory.The gate counted it as objectui's
ui/packages/corebecause of howemitChunkMembershipReportinui/apps/console/vite.config.tsattributes a module id. It matched any/packages/NAME/segment anywhere in the id. Inside the monorepo the framework's workspace packages resolve to a secondpackages/directory, and four of its package names are objectui package names too:cli,core,sdui-parserandtypes. So@objectstack/core's logger became "1 of objectui core's 90 modules", invendor-objectstack.How it was named: a throwaway Vite plugin, added through a wrapper config and deleted afterwards, listed every emitted module id under a root
packages/directory whose name collides with an objectui package. Onmainthat is exactly two ids:packages/core/dist/logger.jsinvendor-objectstack, andpackages/sdui-parser/dist/index.mjsin a lazy chunk nameddist. Inchunk-membership.jsononmain, the onlycoredirectory counted invendor-objectstackisdist. objectui'spackages/coreis aliased tosrcand has nodistmodule in the bundle.Why neither suggested route
frameworkreally does hold all 89 of objectui core's modules. Droppingcorefrom the list would leave the package unwatched.The defect is in what the report counts, so this PR fixes the producer, the membership emitter in the same
vite.config.tsfile the claim names. Grouping rules, ceilings, baselines and the declaration are untouched.Change
ui/scripts/vite-objectstack-workspace.ts:objectuiPackagesDir(consoleDir)andworkspaceModuleMatcher(packagesDir). The matcher is anchored on objectui's ownpackages/directory and escapes the path. It lives next toworkspaceChunkTestsbecause it fixes the same monorepo-layout effect, and because a config file's constants cannot be imported by a test.ui/apps/console/vite.config.ts:emitChunkMembershipReporttakes itsWORKSPACE_MODULEfrom that matcher, and the docblock says what the population is.ui/scripts/__tests__/vite-objectstack-workspace.test.ts: five cases. They cover attribution of an objectui module (package and rest of the id), refusal of each of the four colliding framework names, anchoring, escaping, and that the config uses the matcher..changeset/26131-console-chunk-membership-attribution.md:patchon@object-ui/console, becausedist/chunk-membership.jsonships in the package'sfiles.Readings, before and after
All on this container: the
@object-ui/console^...closure built with turbo (70/70), thenCI=true pnpm exec vite buildinui/apps/console, thennode scripts/check-eager-closure-budget.mjsinui/. "Before" is base7111e14a'svite.config.ts, built from the same tree through a temporary--config. "After" is this branch at8831aac4.mainconfig)packages/core89 inframework, 1 invendor-objectstackpackages/core89 inframework; react 51; types 16 +src/zod10 intypes-zod; components 217; fields 90 + date-picker 2*.jsfiles (sha256 of all 2395)eager-closure.jsonchunk-membership.json, compared by package: 32 of the 38 package keys are unchanged. The ones that changed are exactly the framework modules that drop out:spec(73 modules across 6 chunks),client,formula,lint, the logger counted undercore, and the rootsdui-parsercounted under objectui'ssdui-parser. Every objectui package count is unchanged.After merging
mainate6dfeb08, the head isf1393a3c. On that head the closure and Console were rebuilt and the gate re-run: exit 0, membership green with the same counts, eager closure 1938.7 KB gz across 88 of 2390 chunks. The 185 cases invite-objectstack-workspace.test.tsandcheck-eager-closure-budget.test.tspass.The ablation was run once, with
node scripts/ablation-replace.mjs. It put the unanchored segment regex back insideworkspaceModuleMatcher. Two of the new cases went red: "does not attribute a framework package that shares an objectui package name" and the escaping case. The file was then restored: the blob hash matches HEAD andgit diff HEADis empty.Acceptance notes
ui/workspace:D1 裁定(A+)的执行父单 — 一个 PR 同时改 spec 与渲染器,删除两仓互钉,@object-ui 保留包名并与 @objectstack 同一版本组,objectui 仓归档为迁移说明 #25677), as the card says. This PR adds no gate and does not touchui/.github/**or the rootci.yml.advancedChunksgroup tests invite.config.tsuse the same unanchored segment form,framework's among them (it matchespackages/core,packages/reactandpackages/types). On this build that changes nothing: the probe found the only two colliding root modules invendor-objectstackand in the lazydistchunk, and none inframework. A group could still claim a framework module if the module ever stopped being$initial, because the vendor group would then no longer outrank it. Noted only: it is not reached today, and no card is filed for it.Generated by Claude Code