Skip to content

Add /base subpath export and document Jest setup - #1550

Merged
Ryang-21 merged 4 commits into
mainfrom
base-subpath-export
Jul 24, 2026
Merged

Add /base subpath export and document Jest setup#1550
Ryang-21 merged 4 commits into
mainfrom
base-subpath-export

Conversation

@Ryang-21

Copy link
Copy Markdown
Contributor

What

Adds a ./base subpath export to the package, so offline primitives can be imported without the rest of the SDK:

import { StrKey, Keypair } from "@stellar/stellar-sdk/base";

Also adds base/index as an explicit rollup entry (guaranteeing emission independent of tree-shaking, like http-client), documents the new subpath in the stellar-base migration section, and adds a "Usage with Jest" README section covering the transformIgnorePatterns recipe and the ≥es2020 compilation-target requirement for the ESM-only crypto dependencies.

Why

Since the v16 stellar-base fold-in, the package root is the only way to reach primitives like StrKey. The root is a barrel, and under CommonJS require() can't tree-shake it, so importing one symbol loads Horizon, RPC, and the SEP helpers along with their networking dependencies (axios, eventsource, smol-toml) — which breaks Jest consumers on ESM-only transitive deps. With /base, a CJS require loads 101 modules with zero networking/SEP modules, versus 174 for the root import. The remaining Jest friction (@noble/* being ESM-only) is a test-runner transform concern, so it's documented rather than worked around in the build.

Closes #1533

Ryang-21 and others added 2 commits July 16, 2026 15:47
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 16, 2026 22:48
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Jul 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Shaptic Shaptic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changelog entry pls

@Ryang-21
Ryang-21 merged commit 1863b01 into main Jul 24, 2026
12 checks passed
@Ryang-21
Ryang-21 deleted the base-subpath-export branch July 24, 2026 20:21
@github-project-automation github-project-automation Bot moved this from Backlog (Not Ready) to Done in DevX Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Importing StrKey from @stellar/stellar-sdk v16 eagerly loads ESM-only/networking deps; request base-only subpath export

3 participants