@void/react: a non-island component under an _-prefixed directory in pages/ ships every page module to the browser
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- react, typescript, vite
- Área
- backend, build-system
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 580
- Forks
- 56
- Merge medio
- 12 h 25 min
- PR fusionados (30 d)
- 134
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de voidzero-dev/void
-
Dificultad 3/5 1-2 días Aptitud para principiantes 66/100
voidzero-dev/void#599 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 82/100
voidzero-dev/void#596 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 56/100
voidzero-dev/void#579 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
voidzero-dev/void#573 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 53/100
voidzero-dev/void#567 · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de voidzero-dev/void
Issues similares
-
e2e-failure ready-to-code
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
redhat-developer/rhdh-plugin-export-overlays#4580 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
devdotfast/whiteboard#1415 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area/sessions comp/desktop desktop/sessions P2 type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
NousResearch/hermes-agent#145383 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
enhancement p2 setup
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
vercel/eve#5419 · 1 comentario ·
Los mantenedores suelen responder en 1 día