Skip to content

fix: Bun + Deno runtime compatibility audit#37

Merged
truthixify merged 1 commit into
wraith-protocol:developfrom
isaacCodes1:fix/compat-runtime-audit
Jun 1, 2026
Merged

fix: Bun + Deno runtime compatibility audit#37
truthixify merged 1 commit into
wraith-protocol:developfrom
isaacCodes1:fix/compat-runtime-audit

Conversation

@isaacCodes1
Copy link
Copy Markdown

@isaacCodes1 isaacCodes1 commented May 30, 2026

Overview

This PR adds a runtime compatibility audit for Bun, Deno, Cloudflare Workers, and Vercel Edge, and fixes the Stellar announcement parser so it no longer uses require() inside ESM. It also documents the current runtime matrix and adds an edge-runtime guide for using the SDK outside Node.

Related Issue

Closes #23

Changes

⚙️ Stellar Runtime Fix

  • [MODIFY] src/chains/stellar/announcements.ts

  • Replaced the inline require('@stellar/stellar-sdk') path with a lazy import() loader.

  • Kept the parser compatible with ESM and edge runtimes.

  • [ADD] test/chains/stellar/scan.test.ts

  • Added a regression test that exercises fetchAnnouncements().

  • Verified the Stellar parser path works without require().

🌐 Compatibility Documentation

  • [ADD] COMPAT.md

  • Added a runtime matrix for Node 20/22, Bun, Deno, Cloudflare Workers, and Vercel Edge.

  • Documented working, partial, and caveated runtime states.

  • [ADD] docs/running-on-the-edge.md

  • Added guidance for Bun, Deno, Cloudflare Workers, and Vercel Edge.

  • Included import examples and notes about optional peer dependencies.

  • [MODIFY] README.md

  • Linked the new compatibility matrix and edge-runtime guide from the main README.

🧪 CI

  • [MODIFY] .github/workflows/ci.yml
  • Expanded the Node matrix to cover Node 20 and Node 22.
  • Added a Bun job so at least one non-Node runtime is verified in CI.

Verification Results

Acceptance Criteria Status
COMPAT.md table covering Node 20/22, Bun, Deno, Cloudflare Workers, Vercel Edge
All fixable issues fixed
CI matrix expanded to include at least one non-Node runtime (Bun)
Stellar announcement parser no longer uses require() inside ESM
Regression test added for the Stellar parsing path

How to Test

# 1. Confirm you're on the branch
git branch --show-current

# 2. Run the full test suite
pnpm test

# 3. Verify Bun compatibility
bun test

# 4. Verify the package builds cleanly
pnpm build

# 5. Check formatting
pnpm format:check

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@isaacCodes1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@truthixify truthixify changed the base branch from main to develop June 1, 2026 15:33
@truthixify
Copy link
Copy Markdown
Contributor

COMPAT.md, the edge runtime guide, the require() → dynamic import() fix in announcements.ts, and the CI matrix expansion are all good. Same rebase blocker as the others, your branch is pre-develop.

git fetch origin
git rebase origin/develop
git push --force-with-lease

Resolve by keeping develop's versions for the files you didn't intend to touch, keep your COMPAT.md, docs/running-on-the-edge.md, the CI changes, and the lazy-import fix. Thanks @isaacCodes1.

@isaacCodes1 isaacCodes1 force-pushed the fix/compat-runtime-audit branch from c7590e2 to 8f7085b Compare June 1, 2026 20:16
@isaacCodes1 isaacCodes1 force-pushed the fix/compat-runtime-audit branch from 8f7085b to 1ccbbb6 Compare June 1, 2026 20:20
@isaacCodes1
Copy link
Copy Markdown
Author

Rebased onto upstream/develop and resolved the Stellar announcements conflict by keeping the new range/cursor logic while preserving the edge-safe lazy import fix. @truthixify

@truthixify
Copy link
Copy Markdown
Contributor

Clean rebase, COMPAT.md + edge-runtime guide + the announcements.ts dynamic-import fix all land cleanly. Merging. Thanks @isaacCodes1.

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.

Bun + Deno runtime compatibility audit

2 participants