Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Plugin entries that extend another app pull in that app's UI, and every core UI container is named `ui`

Đang mở
#636 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
react, typescript

Hướng nghiên cứu

Start in src/services/resolution/load.ts and trace resolveComposableReference, getAssociatedUi, and withAssociatedUi to see how a plugin entry inherits app.ui; then inspect the descriptor schema and the UI merge helpers named in the issue. The proposed opt-out affects schema and merge behavior, while unique container names involve build and host resolution. Done means an extended plugin no longer loads the provider's whole UI when opted out, without breaking core UI loading.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem

When a child app extends another app's plugin, e.g.

plugins: {
  nostr: { extends: "bos://nearbuilding.near/nostr.nearbuilders.org#plugins.nostr" },
}

resolveComposableReference (src/services/resolution/load.ts) also copies the extended app's app.ui onto the plugin entry (getAssociatedUi → withAssociatedUi). The host then loads that whole app UI as a plugin UI on every page of the consumer.

Every app's core UI container is named after ui/package.json, so it's ui in practice: var ui, chunks in self.chunk_ui. Two containers with the same global name end up on one page. The second remoteEntry.js overwrites window.ui, and the host's ui/Hydrate resolves to the other app's UI.

Seen in

  • nearbuilders.org (NEARBuilders/nearbuilders.org#305) consumes nostr.nearbuilders.org's plugin.

  • The page loads both localhost:3003/remoteEntry.js and nostr's remoteEntry.js, both var ui.

  • Hydration runs nostr's __federation_expose_Hydrate, whose bundled react-dom/client 19.2.4 meets the shared react 19.2.9:

    [Hydrate] Failed: Minified React error #527 (19.2.9 vs 19.2.4)
    
  • Matching React versions only hides it: the consumer still hydrates with the other app's Hydrate.

  • Renaming the provider's UI package (e.g. nostr_ui) doesn't work either. The host addresses the core UI as ui unless the config has app.ui.name, which a core UI can't publish, so the provider's own SSR breaks (Cannot read properties of undefined (reading 'call')).

Proposed fix

  1. Opt-out (small, unblocks consumers now): let a plugin entry drop the attached UI, e.g. plugins.nostr.ui: null or false. getEntryAssociatedUi and mergeAssociatedUi treat null as "no override" today, and the descriptor schema would need to allow it.
    • nearbuilders.org has its own nostr screens and only needs the plugin's API.
    • This also keeps the provider's routes out of the consumer's route tree.
  2. Unique container names (general): build each app's core UI under a per-app container name, e.g. derived from account and domain. The host would resolve the core UI by the name in the published config instead of the hard-coded ui, so composed UIs can't collide.

Workaround without a framework change: the provider publishes a second, plugin-only config without app.ui, and consumers extend that.

Versions

everything-dev / platform 2.0.0-rc.24, every-plugin 3.0.0-rc.14.

Ngôn ngữ chính
TypeScript
Star
5
Fork
3
Merge trung bình
9 giờ 20 phút
Pull request đã merge (30 ngày)
159

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NEARBuilders/everything-dev

Tất cả issue của NEARBuilders/everything-dev

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.