Skip to content

feat: restore web3js exports#382

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

feat: restore web3js exports#382
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

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