@void/react: a non-island component under an _-prefixed directory in pages/ ships every page module to the browser
Maintainer thường phản hồi trong vòng 1 ngày
Một pull request liên quan đã được merge.
- #603 của @dvkam — đã merge
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, typescript, vite
- Lĩnh vực
- backend, build-system
Hướng nghiên cứu
Read packages/react/src/plugin-pages.ts and compare its hasNonIslandPages() path handling with the scanner in scan.ts; the report says the Solid plugin has the same check. Reproduce with the provided _ui/frame.tsx example and inspect dist/client/assets after vp build. Done when files below underscore-prefixed directories are excluded from client bundles, with a regression test covering the case.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version: void / @void/react 1.2.1 (also 1.1.12); main at a6de7829.
Repro
pnpm create void(React, static output:output: 'static'invoid.config.ts).pages/index.island.tsx:import { Frame } from './_ui/frame'; export default function Home() { return <Frame><h1>Hello</h1></Frame>; }pages/_ui/frame.tsx, a shared server-only component that is not a page or an island:export const SECRET_COPY = 'server-only text'; export function Frame({ children }: { children: React.ReactNode }) { return <main data-x={SECRET_COPY}>{children}</main>; }vp build, thenls dist/client/assetsandgrep -l 'server-only text' dist/client/assets/*.js.
Expected: an island-only app emits no pages-client bundle, and frame.tsx (not a route, because the route scanner skips _ segments) never reaches dist/client.
Actual: pages-client-*.js plus a chunk for every page module and every import (frame-*.js) are emitted to dist/client/assets, and the server-only strings are in them. In our app that is 18 files and 351 KB instead of 5 files and 33 KB, and 42 strings that were meant to stay server-side.
Cause: packages/react/src/plugin-pages.ts hasNonIslandPages() skips only basenames that start with _:
if (name.startsWith('_') || name.startsWith('layout.')) continue;
entry.name for pages/_ui/frame.tsx is frame.tsx. The pages scanner (scan.ts) skips any segment that starts with _ (except _layouts), so the two disagree. The Solid plugin has the same check.
Suggested fix: test every path segment relative to dir, as the scanner does:
const rel = relative(dir, join(entry.parentPath, name));
if (rel.split(sep).some((s) => s.startsWith('_')) || name.startsWith('layout.')) continue;
This is adjacent to #559, which adds the .server. exclusion to the same line.
- Ngôn ngữ chính
- TypeScript
- Star
- 580
- Fork
- 56
- Merge trung bình
- 11 giờ 28 phút
- Pull request đã merge (30 ngày)
- 150
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của voidzero-dev/void
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
voidzero-dev/void#619 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
voidzero-dev/void#606 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
@void/react: client environment has no optimizeDeps.entries for pages, causing a dev re-optimization reload on first loadCó thể đã có người làm @0froq đã nhận 1 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/100
voidzero-dev/void#599 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`void/log`: add `logger.child(fields)` to bind fields to every lineCó thể đã có người làm @Dazzanova đã nhận 1 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 82/100
voidzero-dev/void#596 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
voidzero-dev/void#579 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của voidzero-dev/void
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
b310-digital/teammapper#1515 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
OneNote: import empty sectionsĐang mởonenote
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
obsidianmd/obsidian-importer#689 ·
-
In a half-screen window, the title bar cuts the workspace and version names until they can't be readĐang mởbug launch local use macOS Windows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Integration]: eRPCĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
ava-labs/builders-hub#4826 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
记忆分析的默认模型显示与实际使用不一致Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày