@void/react: a non-island component under an _-prefixed directory in pages/ ships every page module to the browser
I maintainer di solito rispondono entro 1 giorno
Una pull request collegata è già stata integrata.
- #603 di @dvkam — integrata
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript, vite
- Ambito
- backend, build-system
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 580
- Fork
- 56
- Merge medio
- 11h 28m
- PR unite (30g)
- 150
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di voidzero-dev/void
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
voidzero-dev/void#619 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
voidzero-dev/void#606 ·
I maintainer di solito rispondono entro 1 giorno
-
@void/react: client environment has no optimizeDeps.entries for pages, causing a dev re-optimization reload on first loadForse già presa @0froq l’ha presa oggi. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 66/100
voidzero-dev/void#599 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
`void/log`: add `logger.child(fields)` to bind fields to every lineForse già presa @Dazzanova l’ha presa oggi. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 82/100
voidzero-dev/void#596 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 56/100
voidzero-dev/void#579 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di voidzero-dev/void
Issue simili
-
[Bug]: Payment providers removed from config are never disabled in payment_providerForse già presa @medusa-os-bot l’ha presa oggi. Apertatype: bug
Difficoltà 2/5 Mezza giornata Idoneità per principianti 82/100
medusajs/medusa#17544 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
software-mansion/argent#1651 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
lane:reliability
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno