Repository navigation
feat(core): create independent server entries through slots - #148
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2254ed53fc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| (entry.kind === "server-runtime" || entry.kind === "page-server"), | ||
| (entry.kind === "server-runtime" || | ||
| entry.kind === "page-server" || | ||
| entry.kind === "runtime"), |
There was a problem hiding this comment.
Keep plugin server entries self-contained
When a plugin entry and another server entry import the same module, Utoopack can factor that dependency into a shared chunk—the existing multi-server-entry.test.ts explicitly verifies shared entrypoint assets. Including runtime entries in this multi-entry compilation therefore conflicts with selectServerEntrypointAssets() in manifest-generator.ts:325-338, which retains only the named entry JavaScript file. A consumer following the new documented contract and deploying only BuildOutput.assets[entryName] will omit the shared chunk, so the isolated plugin entry cannot load; configure plugin runtime entries to produce standalone bundles rather than relying on shared server chunks.
Useful? React with 👍 / 👎.
| const id = validateContributionId(input.id, pluginId); | ||
| assertGeneratedModuleOrString(pluginId, id, input.module); | ||
| const key = this.reserveKey(pluginId, id, "server entry", namespace); | ||
| const name = `plugin-${key.replace(/[^a-zA-Z0-9_-]/g, "-")}`; |
There was a problem hiding this comment.
Reject portable-name collisions for plugin entries
Contribution IDs may differ only by case, and this generated name preserves that difference; the later assertUniqueBuildEntryNames() uses an exact Set, while the normal build-plan validation—which canonicalizes names for case-insensitive filesystems—already ran before these entries were appended. Thus IDs such as worker and Worker are accepted but produce colliding physical entry files on Windows or a case-insensitive macOS volume. Validate these appended names with the same canonical portable identity used by validateBuildOutputNames(), including collisions with existing plan entries.
Useful? React with 👍 / 👎.
Summary
ctx.slot("server.entry").add({ mode: "create", ... }), reusing the existing generated-contribution model.Changes
createmode toserver.entry. It returns the entry'sBuildOutput.assetskey and rejects Page-onlytarget/positionoptions. Existingimport/replacebehavior and return values remain unchanged.BuildPlan; no separate entry collector or newEmitApimethod is introduced.Validation
git diff --checkpassed.a493afef: dependency installation, core/example/docs builds, repository lint and type checks, unit tests, and Playwright E2E. The shared local dependency tree still has missing packages and Webpack type mismatches; the complete CI run validates a fresh installation.Risk / rollout
import/replace; omitted mode never creates an entry implicitly. No PPR migration is required.FrameworkSlotneed to account for the create overload's string return.Reviewer notes