-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tree Shaking #162
Comments
Thanks for the offer! I can handle doing this myself - I just wanted to know if you were interested in having it in the library. I'll aim make a copy of this library with the fix in the project I mentioned. You're welcome to copy it back if you want. |
My work is over at https://github.com/jacobp100/technicalc-calculator/blob/master/decimal Still in the process of getting all the tests to pass - but a few of the suites are passing already I get a 15kb decrease minified. I noticed function names get minified now too. But also some of that reduction comes from reducing the precision of |
I'm committed to keeping this library ES3 compatible, but I'll take a look. It's a good idea. |
Have you looked into adding build tools to this? It should be possible to write just one version (ES3 but with ES6 imports/exports), then produce an ES3-only bundle. That's something I could help with if you need! |
Yes, that has been considered, but at the moment I prefer to just include a separate ES module file, decimal.mjs. |
ES5 is supported everywhere now, including Internet Explorer which is like 10 years old. You do not need to support anything below that. If someone's browser does not support ES5 (or even ES6 now) then that isn't our issuse. |
Why does it use ES3 compatible syntax? Modules were added in ES6. |
Any updates? |
Yes, I have a bad cold and can't concentrate on anything. |
get well soon!!! |
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.
The text was updated successfully, but these errors were encountered: