fix(feed): import EmbeddedAppViewer from the @elizaos/ui barrel (view-bundle guard fix) - #10549
Conversation
…a deep subpath
On develop, FeedView imports EmbeddedAppViewer from the deep subpath
`@elizaos/ui/components/apps/EmbeddedAppViewer`. The view-bundle import guard
(packages/scripts/view-bundle-import-guard.mjs) only allows specifiers that are
keys in DynamicViewLoader's HOST_EXTERNAL_IMPORTERS map; that deep subpath is
NOT a key, so plugin-feed's built view bundle externalises an import the host
can never rewrite — the view fails to load in the browser ("Failed to resolve
module specifier") and build-views fails the guard.
`@elizaos/ui` (bare) IS an allowed key; the root barrel (index.ts:159 — the
view-bundle runtime target via importUiRootCompat) AND the browser entry
(browser.ts:34 — the app-renderer alias target) both re-export EmbeddedAppViewer,
so importing from the bare barrel resolves in both build paths. Matches the
plugin's documented contract ("EmbeddedAppViewer (from @elizaos/ui)" in
plugins/plugin-feed/CLAUDE.md).
Verify: rebuilt dist/views/bundle.js imports only allowlisted @elizaos/ui
specifiers (no deep subpath); both index.ts and browser.ts export the symbol.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
What
Fixes a build-breaking bug on
developfound while reviewing the recently-landed view-architecture PRs:plugins/plugin-feed/src/components/FeedView.tsximportsEmbeddedAppViewerfrom the deep subpath@elizaos/ui/components/apps/EmbeddedAppViewer.The view-bundle import guard (
packages/scripts/view-bundle-import-guard.mjs) only allows specifiers that are keys inDynamicViewLoader'sHOST_EXTERNAL_IMPORTERSmap. That deep subpath is not a key, so plugin-feed's builtdist/views/bundle.jsexternalises an import the host can never rewrite → the view fails to load in the browser (Failed to resolve module specifier) andbuild-viewsfails the guard.Fix
One line: import from the bare
@elizaos/uibarrel, which is an allowed key. Both barrels re-export the symbol, so it resolves in both build paths:importUiRootCompat→index.ts:159(export * from "./components/apps/EmbeddedAppViewer")browser.ts:34(export * from "./components/apps/EmbeddedAppViewer.tsx")This matches the plugin's own documented contract ("EmbeddedAppViewer (from
@elizaos/ui)" inplugins/plugin-feed/CLAUDE.md).Evidence
Context
Surfaced during an adversarial sub-agent review of this session's landed/competing PRs (#10366 deploy, #10412 camera/wearables, #10434 companion, steward removal, #10333 benchmark lanes, #10408 external-dataset). All others verified good; notably the views review's claimed "wearables Settings section never registers" was refuted — facewear is auto-loaded via the
elizaos.appRegistervite discovery (CI-asserted inplugin-registrations.test.ts). This feed import is the one real, build-breaking bug.🤖 Generated with Claude Code