Closed aantron closed 4 years ago
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.
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.
After #58 by @cknitt replaced Array
fully by Belt.Array
, the compiled size is 1184 bytes
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 :)
See https://github.com/aantron/promise/issues/54#issuecomment-646112858. It is currently a bit
under 4Kover 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.