Skip to content

chore(scripts): use variant index for browser/native instead of individual files - #2009

Merged
kuhe merged 1 commit into
mainfrom
kuhe/chore/variants
May 6, 2026
Merged

chore(scripts): use variant index for browser/native instead of individual files#2009
kuhe merged 1 commit into
mainfrom
kuhe/chore/variants

Conversation

@kuhe

@kuhe kuhe commented May 6, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available:
#1980

Description of changes:

This converts the core submodule browser and native bundler instructions metadata from file-based variants to variant indexes.

This enables:

  • far fewer files need to exist in dist-cjs, because now Node.js can use a fully inlined file, and browser/native has a separate but also fully inlined file. The amount of duplication this causes is very small relative to the init/file-count penalty otherwise carried by having so many individual variant files.
  • broader bundler support. Now core's package.json exports and browser metadata fields can both point the bundler(s) at the correct entry points, rather than relying solely on the browser metadata field, hoping that the bundler understands a mix of conditional exports and file replacement directives.
  • no more false file directives to indicate a file should not be imported. The variant index simply doesn't import the files in the first place (e.g. shared-ini-file-loader).

@kuhe
kuhe requested a review from a team as a code owner May 6, 2026 01:56
@kuhe
kuhe force-pushed the kuhe/chore/variants branch 7 times, most recently from 7ec1d3d to 33cf7a6 Compare May 6, 2026 15:00
@kuhe
kuhe force-pushed the kuhe/chore/variants branch from 33cf7a6 to edd8990 Compare May 6, 2026 15:14
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.

2 participants