Ship an ES module build with sideEffects so apps can tree-shake Reqore
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- react, rollup, typescript, vite, webpack
- Ambito
- build-system, developer-experience
Direzione di ricerca
Start by reading package.json and the existing build configuration to find how the CommonJS output is produced and whether global styles have side effects. Then trace the build scripts and verify how package entry points are consumed. Done means publishing an ESM entry alongside CommonJS with an exports map and a correct sideEffects declaration; check that require consumers still resolve the CommonJS build.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What the landing page needs
The Qorus landing page (qorus.cloud) is slow to show its first screen on phones, and most of the time goes to Reqore's JavaScript. In a production build, Reqore and what it brings come to 4.7 MB raw / 1.22 MB gzipped (Vite 7, Reqore 0.78.0). In a throttled phone trace (Fast 4G, 4× CPU), LCP is about 7 s, almost all of it spent waiting on and running scripts.
The site uses a small part of Reqore, but every component ships, along with everything they import. Measured by source in the bundle:
- react-aria, react-aria-components, react-stately and @internationalized/date: about 28%;
- Slate: about 3%;
- lodash: about 5%.
The reason is the package:
package.jsonhas onlymain(CommonJS output,require(...)), nomoduleorexportsESM entry;- it has no
sideEffects.
A bundler cannot drop unused components from a CommonJS barrel, so import { ReqoreButton } from '@qoretechnologies/reqore' brings in the whole library.
Proposal
- Publish an ES module build next to the CommonJS one: for example
dist/esmbuilt withmodule: esnext, with"module"and an"exports"map pointingimportat it andrequireatdist/index.js. - Declare
"sideEffects": false, or list the files that do have side effects (global styles, if any).
Nothing changes for consumers that use require. The ESM path lets Vite, Rollup and webpack keep only the components an app imports.
Meanwhile
The landing page puts Reqore in a file of its own (manualChunks), so returning visitors keep it cached across the site's deploys. It also loads its editor lazily. Neither reduces what a first visit downloads.
- Lingua principale
- TypeScript
- Stelle
- 4
- Fork
- 0
- Merge medio
- 16h 28m
- PR unite (30g)
- 9
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
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 qoretechnologies/reqore
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
qoretechnologies/reqore#725 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
qoretechnologies/reqore#711 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
qoretechnologies/reqore#675 ·
I maintainer di solito rispondono entro 1 giorno
-
Checkbox: a long description pushes the control out of its container — the label column cannot shrinkForse già presa @Foxhoundn l’ha presa 49 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
qoretechnologies/reqore#662 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 64/100
qoretechnologies/reqore#745 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di qoretechnologies/reqore
Issue simili
-
area: documentation status: in progress type: documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
Oddmash/oddmash-ui#222 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
appium/appium-wincore-driver#169 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
india-ultimate/hub#715 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation Entwickler
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 89/100
I maintainer di solito rispondono entro 1 giorno