-
Notifications
You must be signed in to change notification settings - Fork 43
Feature: Decrease bundle size by including only specified methods #154
Comments
Hi @styxlab, Thanks a lot for point that out! Reducing the bundle size is definitely a good thing. I would recommend using a tool like source-map-explorer for diagnosing this. Note: the sizes in that graph represent the uncompressed file sizes and do not take into account things like From what we can see, the In contrast, we've identified the following potential problems in terms of size:
|
Thanks for this thorough analysis and your willingness to look into reducing the bundle size. In the meantime, however, I switched to using the endpoints directly utilizing Maybe this is another direction you might want to consider: Provide a few lightweight js-helpers for node and React that act as simple wrappers of the original endpoints instead of trying to reduce a big package that is hard to optimize. |
I am using the js-client with Next.js and the netlifyAPI class increases my bundle size by approx. 20 KB, although I am using just a few methods. This is too much for a typical SPA and should be reduced. I have not found a way to include only the methods I actually need, which would substantially reduce the bundle size.
I think the problem is that all methods specified are exported:
js-client/src/index.js
Line 99 in 960089a
js-client/src/operations.js
Line 1 in 960089a
Feature request: Implement a configuration option which allows only to include pre-specified methods with the aim to substantially reduce bundle size.
The text was updated successfully, but these errors were encountered: