Skip to content

feat: restore web3js exports - #382

Closed
ChiefWoods wants to merge 2 commits into
LiteSVM:masterfrom
ChiefWoods:feat/web3js-kit-exports
Closed

ChiefWoods wants to merge 2 commits into
LiteSVM:masterfrom
ChiefWoods:feat/web3js-kit-exports

Conversation

@ChiefWoods

Copy link
Copy Markdown

web3js and Kit can be optionally imported through split exports

@ChiefWoods
ChiefWoods force-pushed the feat/web3js-kit-exports branch from d060cff to b19ecb0 Compare July 17, 2026 01:57
@lorisleiva

Copy link
Copy Markdown
Contributor

Hi there, thanks for the PR. There are a quite few implementation details that can be improved here (e.g. no need for /kit is default import is already using Kit, why the new tsconfigs, etc.) but before digging into this I would like to flag that this is going to push some extra challenges to consumers:

  • They are going to need to use a TS mode such as bundler in order to support subpath module imports.
  • If they don't use a bundler that's clever enough to treeshake nested dependencies (e.g. pure Node environments) they are going to load the entire Web3.js library even though they'll never use it.

My recommendation, if supporting web3.js is desired moving forward, would be to create a new package such as litesvm-web3js that is self-contained.

@ChiefWoods

Copy link
Copy Markdown
Author

Hi there, thanks for the PR. There are a quite few implementation details that can be improved here (e.g. no need for /kit is default import is already using Kit, why the new tsconfigs, etc.) but before digging into this I would like to flag that this is going to push some extra challenges to consumers:

Separate tsconfig files were added for explicit CJS-ESM handling when building.

My recommendation, if supporting web3.js is desired moving forward, would be to create a new package such as litesvm-web3js that is self-contained.

That's fair, do you think the web3js package should be added as a sibling to node-litesvm, or in a separate repo?

@lorisleiva

Copy link
Copy Markdown
Contributor

IIRC, the way this package is created and published is pretty complex as it bundles various binaries. Having it in a separate repo would duplicate a lot of the CI work in this repo unfortunately so I'd see it more as a sibling.

A cleaner alternative (which would be a much bigger refactoring though so likely out-of-scope) would be to only publish the generated internal LiteSVM class from this repo as something like litesvm-core. That way, you get the pure LiteSVM logic with no Kit or Web3.js layer. Then, we could have two separate litesvm-kit and litesvm-web3js repos/packages that import that litesvm-core and simply add the relevant wrapper on top of it.

@Aursen Aursen added the blocked label Jul 20, 2026
@ChiefWoods

Copy link
Copy Markdown
Author

@lorisleiva shall I open a separate new PR for the changes? it's bigger in scope, and is no longer committed on top of the above commits

@lorisleiva

Copy link
Copy Markdown
Contributor

@ChiefWoods Sounds good, let's start from a fresh new PR and close this one. @Aursen Let us know which direction you like the most? One gets us to web3.js support quicker, the other makes LiteSVM more decoupled from JS frameworks but takes more work (and a new version of LiteSVM likely means bumping the framework-specific packages as well so there's a bit more ceremony).

Perhaps a good middle-ground is having all three JS packages (core, Kit and Web3.js) inside this repo such that only the core package includes the binaries and the other two a small API wrappers that imports core. Having it inside the same repo means CI fails within the same commit if the framework-specific packages are not updated after a new version of LiteSVM core.

But I'm just offering ideas here haha, ultimately it's for @Aursen to decide. ☺️

@ChiefWoods

Copy link
Copy Markdown
Author

Moved to #387

@ChiefWoods ChiefWoods closed this Jul 26, 2026
@ChiefWoods
ChiefWoods deleted the feat/web3js-kit-exports branch September 5, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants