What are your thoughts on making all functions ES6 exports (like add etc), then providing a 'lite' constructor with no functions defined on the prototype or as static functions constructor? This would mean people could use the exported functions directly and can tree shake.
My project uses ReScript (/ReasonML), so I just write bindings to whatever the exports are.
In the app, the calculations are done in a web worker, so pretty much requires the whole of this library. However, once calculated, the results are sent back to the client, but the only functionality I need from this library is toString.
Having this library be tree-shakable would significantly reduce the size of my client file.
What are your thoughts on making all functions ES6 exports (like
addetc), then providing a 'lite' constructor with no functions defined on the prototype or as static functions constructor? This would mean people could use the exported functions directly and can tree shake.My project uses ReScript (/ReasonML), so I just write bindings to whatever the exports are.
In the app, the calculations are done in a web worker, so pretty much requires the whole of this library. However, once calculated, the results are sent back to the client, but the only functionality I need from this library is
toString.Having this library be tree-shakable would significantly reduce the size of my client file.