refactor(admin): remove circular deps and recover lazy HMR loads#83
Merged
Conversation
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.
Summary
reset(), and render a retryable chunk boundary instead of leaving the admin on an endless skeleton.Impact
The broad app-facing barrels remain available, while cycle-sensitive internals now depend on pure leaves such as
@core/page-tree-schema,@core/module-engine-schema,@core/site-runtime-schema,@core/visual-components-schema, and@core/html-sanitize. Base module editor components no longer import their registration barrels, which keeps Fast Refresh boundaries component-only.Verification
bun x madge --circular --ts-config tsconfig.json --extensions ts,tsx src server— processed 2282 files, 3 warnings, 0 circular dependencies.bun test src/__tests__/architecture/no-circular-dependencies.test.ts— 1 pass, 0 fail.bun test src/__tests__/architecture/canvasFastRefreshBoundaries.test.ts src/__tests__/architecture/site-editor-shell-lazy-body.test.ts— 8 pass, 0 fail.bun run build— passed.bun test— 5486 pass, 0 fail.bun run lint— passed.Manual Smoke
PORT=3102,VITE_PORT=5175,VITE_ALLOWED_ORIGIN=http://localhost:5175,DATABASE_URL=sqlite:./.tmp/e2e-hmr.db,UPLOADS_DIR=./.tmp/e2e-hmr-uploads./admin/site, completed local setup, loaded the Site editor body past the skeleton, added a base Container module, temporarily editedsrc/modules/base/container/ContainerEditor.tsx, and observed Vite HMR update the canvas placeholder without falling back to an endless skeleton. The temporary probe edit was reverted before commit.