Ship an ES module build with sideEffects so apps can tree-shake Reqore
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- react, rollup, typescript, vite, webpack
- Domain
- build-system, developer-experience
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- TypeScript
- Stars
- 4
- Forks
- 0
- Avg merge
- 16h 28m
- Merged PRs (30d)
- 9
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from qoretechnologies/reqore
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
qoretechnologies/reqore#725 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
qoretechnologies/reqore#711 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
qoretechnologies/reqore#675 ·
Maintainers usually reply within 1 day
-
Checkbox: a long description pushes the control out of its container — the label column cannot shrinkPossibly taken @Foxhoundn claimed this 53 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
qoretechnologies/reqore#662 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
qoretechnologies/reqore#745 ·
Maintainers usually reply within 1 day
All issues in qoretechnologies/reqore
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zabuton-app/meguri#875 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
iruzen-dono/workless#117 ·
Maintainers usually reply within 1 day
-
area:api area:web wave wave:trivial
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
vetro-protocol/vetro-monorepo#1321 ·
Maintainers usually reply within 1 day