Skip to content
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

Reduce compiled size again #57

Closed
aantron opened this issue Jun 18, 2020 · 4 comments
Closed

Reduce compiled size again #57

aantron opened this issue Jun 18, 2020 · 4 comments

Comments

@aantron
Copy link
Owner

aantron commented Jun 18, 2020

See #54 (comment). It is currently a bit under 4K over 1K (thanks @cknitt), up from an earlier ~950 bytes, but, per the linked comment, there is likely a lot of the new stuff that can be easily reduced.

@cknitt
Copy link
Contributor

cknitt commented Jun 18, 2020

Also, the Promise.allOk code uses the Array module from the OCaml stdlib, so that the compiled code imports both

var Belt_Array = require("bs-platform/lib/js/belt_Array.js");
var Caml_array = require("bs-platform/lib/js/caml_array.js");

I think it would be better to use Belt everywhere.

@aantron
Copy link
Owner Author

aantron commented Jun 18, 2020

Thanks, good catch. I chose Array for this initial version so I could write the same code for native and JS in limited time :) I'll solve this issue in a week or two and do a follow-on release.

@aantron
Copy link
Owner Author

aantron commented Jun 20, 2020

After #58 by @cknitt replaced Array fully by Belt.Array, the compiled size is 1184 bytes

aantron added a commit that referenced this issue Jun 21, 2020
aantron added a commit that referenced this issue Jun 21, 2020
@aantron
Copy link
Owner Author

aantron commented Jun 21, 2020

The above commit further reduced the compiled size, to 1099 bytes. This version of the library is now in npm as reason-promise@1.1.1.

As an interesting factoid, when it comes to the source size, 60% of the published npm package is the library README :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants