Fix the CJS recipes entry eagerly loading nested d3-geo
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 139
- Avg merge
- 16h 56m
- Merged PRs (30d)
- 48
Description
Problem
A published CJS consumer importing a non-geo layout from semiotic/recipes can fail in Jest with SyntaxError: Unexpected token 'export' from d3-geo.
Two defects compound:
- The CJS recipes bundle is monolithic and eagerly requires
d3-geoeven for non-geo recipes. - The declared
d3-geo@^3.1.1floor can force a nested install beside the commond3meta-package dependency on 3.1.0, escaping consumer transform allowlists.
The public geographicDotGridLayout export must remain available from semiotic/recipes; removing or moving it is not a compatible fix.
Acceptance criteria
- Loading a non-geo recipe through the built CJS
recipesentry does not loadd3-geo. - An external-consumer packaging test resolves the
requirecondition againstdist/. - Every non-geo public entry is checked for reachable
d3-geo. - The minimum required d3-geo version is documented from APIs actually called; widen the range if justified.
- A fresh workspace that also installs the
d3meta-package has no unnecessary nested d3-geo. - Public recipe exports and package/API checks remain unchanged.
Roadmap source: Packaging defect EXP-27472.
Contributor 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.
Research direction
Start at the built CJS recipes entry and its dist/ output, then locate the external-consumer packaging test that resolves the require condition. Trace which non-geo public entries can reach d3-geo and inspect the APIs used to determine the supported version range. Done means non-geo loads avoid d3-geo, packaging and API checks pass, and public exports remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- d3js, typescript
- Domain
- build-system, data-visualization, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100