Skip to content

refactor(s2): add @spectrum-charts/core-s2 and decouple S2 from shared packages - #966

Open
c-lamoureux wants to merge 6 commits into
mainfrom
refactor/core-s2
Open

c-lamoureux wants to merge 6 commits into
mainfrom
refactor/core-s2

Conversation

@c-lamoureux

Copy link
Copy Markdown
Contributor

Summary

Adds @spectrum-charts/core-s2, an S2-only package for the shared code S2 needs. vega-spec-builder-s2 and react-spectrum-charts-s2 now import from it instead of the shared S1 UMD packages (@spectrum-charts/constants, locales, themes, utils). This lets S2 move to ESM independently of S1 (#952 is stacked on this PR).

core-s2

Subpath exports:

  • @spectrum-charts/core-s2/constants: copied from constants, with S1-only constants removed
  • @spectrum-charts/core-s2/locales: copied from locales
  • @spectrum-charts/core-s2/tokens: copied from themes, without getSpectrumVegaConfig, which only S1 uses
  • @spectrum-charts/core-s2/utils: copied from utils

Versioning: it starts at 0.9.0 and is in the changesets fixed group with rsc-s2 and vsb-s2, so all three release at the same version.

Other changes

  • vsb-s2 and rsc-s2 now depend on core-s2 instead of the four shared packages, and their webpack externals are updated to match.
  • Root tsconfig paths, Jest module mapping and the Storybook S2 webpack alias resolve core-s2 from source.
  • build:s2 builds core-s2 first.
  • CLAUDE.md is updated.
  • Breaking: rsc-s2 no longer re-exports getSpectrumVegaConfig. This is noted in the changeset.

S1 packages are unchanged.

Validation

  • yarn tsc is clean.
  • S2 tests (164 suites, 2,641 tests) and S1 tests pass.
  • yarn lint passes.
  • yarn build, yarn build:s2 and yarn build:storybook:s2 succeed.

c-lamoureux and others added 6 commits October 2, 2026 09:57
…d UMD packages

Adds an S2-only core package (constants, locales, tokens, utils subpaths)
copied from the shared packages and pruned to what S2 uses. vega-spec-builder-s2
and react-spectrum-charts-s2 now depend on core-s2 instead of
@spectrum-charts/{constants,locales,themes,utils}, so S2 can evolve and adopt
ESM independently of S1.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The word-matching regex backtracked super-linearly on user-provided mark
names. Split on explicit word boundaries instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Matches the S1 fix so both copies stay identical; same output, linear time.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Main changed the S2 horizontal legend anchor to 'start' in packages/themes after
core-s2 copied it; apply the same change and test to core-s2.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sonarqubecloud

sonarqubecloud Bot commented Oct 2, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant