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

Make SCI dependency optional for smaller JS builds #203

Closed
Naomarik opened this issue Jun 5, 2020 · 8 comments
Closed

Make SCI dependency optional for smaller JS builds #203

Naomarik opened this issue Jun 5, 2020 · 8 comments
Labels
enhancement New feature or request
Milestone

Comments

@Naomarik
Copy link

Naomarik commented Jun 5, 2020

Currently in the context of my application I will never have a need for it and it adds 93kb gzipped at compression level 6.

@ikitommi ikitommi added the enhancement New feature or request label Jun 5, 2020
@ikitommi ikitommi added this to the alpha1 milestone Jun 5, 2020
@ikitommi
Copy link
Member

Did a quick test using shadow-cljs:

metosin/malli 43.1 KB
borkdude/sci  63.6 KB

The malli is currently not optimized either for bundle size. Will make sci optional and try to make malli smaller too.

@ikitommi
Copy link
Member

Added shadow-cljs as dev-dependency and guide how to measure the bundle sizes. With the latest versions (sci got docstrings, making it a lot bigger):

metosin/malli 50KB -> 11.8KB GZIP
borkdude/sci  564KB - > 120KB GZIP

@ikitommi
Copy link
Member

Not sure how correctly the bundle size is calculated, but here goes the report:

Screenshot 2020-06-12 at 8 54 51

@borkdude
Copy link
Contributor

Work in progress at #210. It works, but the tests need to be refactored to account for the optionality of sci.

@borkdude
Copy link
Contributor

I have closed the PR. Instead, I'm offering you this library https://github.com/borkdude/dynaload. If you need any help, let me know. :)

@ikitommi
Copy link
Member

ikitommi commented Jul 2, 2020

thanks, will try that :)

@ikitommi
Copy link
Member

Will be fixed in #227 .

@ikitommi ikitommi mentioned this issue Jul 23, 2020
@ikitommi
Copy link
Member

sci is now disabled by default. README has guide how to enable it for cljs. With the minimal dummy sample app:

  • js: 757,8kb -> 136kb
  • gzipped: 161kb -> 31,5kb

with sci:

with-sci

without (default):

no-sci

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants