Skip to content

feat(vite-plugin): add entrypoint option to scope auto-inject to a single file#96

Open
IzumiSy wants to merge 1 commit intomainfrom
feat/entrypoint-required
Open

feat(vite-plugin): add entrypoint option to scope auto-inject to a single file#96
IzumiSy wants to merge 1 commit intomainfrom
feat/entrypoint-required

Conversation

@IzumiSy
Copy link
Contributor

@IzumiSy IzumiSy commented Mar 19, 2026

Add entrypoint option to appShellRoutes() to scope auto-inject interception to a single file.

Problem

The current auto-inject plugin intercepts all user-code imports of @tailor-platform/app-shell and replaces them with a proxy. This creates a circular dependency in the module graph (proxy → pages → page components → proxy). This circular dependency can cause issues such as TDZ errors from uninitialized bindings and unexpected module evaluation order, depending on what page components import or execute at the top level.

Solution

When entrypoint is specified, only imports from that file are intercepted. All other files import directly from the real package, structurally eliminating the circular dependency.

The option is optional — when omitted, the existing behavior is preserved. Setting it is recommended for safety.

@IzumiSy IzumiSy self-assigned this Mar 19, 2026
@IzumiSy IzumiSy force-pushed the feat/entrypoint-required branch from 78c41a8 to 253ff2a Compare March 19, 2026 04:16
@IzumiSy IzumiSy marked this pull request as ready for review March 19, 2026 04:16
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 19, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@tailor-platform/app-shell@96
npm i https://pkg.pr.new/@tailor-platform/app-shell-vite-plugin@96

commit: 253ff2a

@IzumiSy
Copy link
Contributor Author

IzumiSy commented Mar 19, 2026

/review

@IzumiSy
Copy link
Contributor Author

IzumiSy commented Mar 19, 2026

API design review agent did no-op. No meaningful review comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant