You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently starknet.js export many of its utilities as object, which prevent best dead code elimination
Describe the solution you'd like
It would be better to expose the utils via package.json exports field
so if you were to export num utils this way in your package.json:
hello @wighawag
Can i be assigned to this task?
I propose restructuring Starknet.js to export utilities more modularly by utilizing the package.json exports field. This change will allow for better dead code elimination and enhance the ability to import only the needed utilities.
The benefit of doing this are:
By exposing individual utilities through the exports field, unused code can be excluded from the final bundle, resulting in smaller and more optimized builds.
Type-Safe Imports: Developers will be able to directly access types from each utility, improving code clarity and the developer experience, especially in TypeScript environments.
Is your feature request related to a problem? Please describe.
Currently starknet.js export many of its utilities as object, which prevent best dead code elimination
Describe the solution you'd like
It would be better to expose the utils via package.json
exports
fieldso if you were to export num utils this way in your package.json:
we would then be able to import it this way and benefit from dead code elimination if we were to only use part of the num exports:
Also another bonus is that it will let us access types defined there too
The text was updated successfully, but these errors were encountered: