Conversation
|
Here's a visual recap of what changed: Open the full interactive recap |
There was a problem hiding this comment.
Builder reviewed your changes and found 1 potential issue 🟡
Review Details
Code Review Summary
This incremental update preserves the intended single SSR module graph by removing production externalization for Core and the React singleton packages and by applying the Core source alias during builds. The focused test and build claims are directionally consistent with that goal, and the diff remains narrowly scoped. However, the production alias change also affects bare @agent-native/core imports in server/action graphs, not only the route/client entries that need singleton unification.
Key Finding
- 🟡 MEDIUM — Applying
getCoreSourceAliases()during production builds maps bare@agent-native/coreto the browser barrel. That can pull the React client surface into serverless action graphs instead of preserving the package's Node/default entry, contributing to the substantial server bundle increases reflected in the updated baselines. The alias should be scoped by entry/context or bare server imports should remain on the compiled Node export.
This was identified by one of two independent balanced reviews and is sufficiently concrete to warrant fixing because the changed line alters production package entry resolution. The prior review's clean findings were not resubmitted. Risk assessment: standard, due to shared production build and package-resolution behavior.
🧪 Browser testing: Skipped — the PR changes build configuration, tests, release metadata, and serverless bundle baselines; it does not introduce user-facing browser UI behavior.
| // Uses regex with $ anchor for exact matching to prevent | ||
| // @agent-native/core from prefix-matching @agent-native/core/client. | ||
| ...(isBuildCommand(command) ? [] : getCoreSourceAliases(cwd)), | ||
| ...getCoreSourceAliases(cwd), |
There was a problem hiding this comment.
🟡 Keep bare Core server imports on the Node entry
getCoreSourceAliases() maps the bare @agent-native/core specifier to src/index.browser.ts (the root entry mapping is defined earlier in this file). Applying these aliases during production builds overrides the package's Node/default export for SSR and action imports, pulling the browser client barrel into serverless graphs; the corresponding server bundle baselines increase substantially. Please scope the alias to route/client entries or preserve the compiled Node entry for bare server imports.
Additional Info
Found by 1 of 2 independent review agents; based on the changed production alias line and getCoreSourceAliases root mapping.

What changed
Keep production SSR routes and Core hooks in one Vite module graph. Production externalization had split
@agent-native/coreand the React singleton packages from the app's route graph, allowing Nitro to emit one tracedreact-routercopy and another inlined copy with different context objects.This restores the Core source alias during production builds and stops externalizing Core, React, React DOM, React Router, and TanStack Query from the intermediate SSR graph. Native
yjsand caller-provided externals remain unchanged.The Nitro
noExternalsand serverless copier variants were tested against the same failure and did not remove the duplicate runtime; this fixes the split at the Vite boundary.Verification
NITRO_PRESET=netlify) completed successfully.useLocation() may be used only in the context of a <Router>:_chunks/server4.mjs.GET /design/abcreturned200HTML with no Router-context error.pnpm guards: all 77 checks passed.@agent-native/docsentries inscripts/serverless-function-baseline.jsonwith the guard's--update; the intended unified SSR graph is the shipped runtime and the PR preview size guard now measures it.The broad local deploy spec is currently unable to resolve
h3from its generated/tmpworker module; it fails before exercising this change.