-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Usage of Printexc increases the bundle size quite a bit #39
Comments
Yes, it should be possible to avoid. I seem to have assumed that most projects using Repromise will also somehow pull in If so, we can try to remove it in multiple ways. Perhaps we can print the exception using |
@aantron indeed, that single line is the offender. It cuts the minified bundle size from 41k down to 2.3k. Next largest one is BuckleScript's author recommends against using |
Using [ [ 'Failure', -2, tag: 248 ], 'message' ] If this is acceptable I can open a PR. I don't know a way to |
I think that's acceptable, and would be happy to merge a PR for it. We should probably prefix it with "exception," or something like that. I also thought it might be a good idea to give instructions on what the developer can do to get a proper message, but I'm not sure if that will be good post-deployment. |
I removed usage of I added a bundle size test, which is basically just This is built with webpack in CI:
So we can easily notice if it starts growing too much again. |
I also got rid of |
Awesome! Apologies for dropping the ball on this. |
No worries, I dropped the ball, too :) I'm catching up on all the issues in the repo, and will release this in a 1.0.0 release soon :) |
I'm having a great experience with Repromise, but had to give up on it for a project which aims for the smallest bundle size that's easily achievable. I noticed only Repromise depends on CamlinternalFormat in this particular case, and switching back to
Js.Promise
resulted in a much smaller bundle.Is this dependency easily avoidable in Repromise when targeting BuckleScript?
I created a Gist with
rollup-plugin-analyzer
to demonstrate where most of the 41k bundle (minified) comes from: https://gist.github.com/osener/91dd9838200d53c0b3bf824a9394885cYou can try it out by running
$ git clone https://gist.github.com/91dd9838200d53c0b3bf824a9394885c.git repromise_bundle_size_test $ cd repromise_bundle_size_test $ npm install $ npm run build
The text was updated successfully, but these errors were encountered: