nteract / nteract/semiotic

Fix the CJS recipes entry eagerly loading nested d3-geo

Open
#1,237 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug :bug:
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:

  1. The CJS recipes bundle is monolithic and eagerly requires d3-geo even for non-geo recipes.
  2. The declared d3-geo@^3.1.1 floor can force a nested install beside the common d3 meta-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 recipes entry does not load d3-geo.
  • An external-consumer packaging test resolves the require condition against dist/.
  • 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 d3 meta-package has no unnecessary nested d3-geo.
  • Public recipe exports and package/API checks remain unchanged.

Roadmap source: Packaging defect EXP-27472.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.