-
Notifications
You must be signed in to change notification settings - Fork 2
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
Bundle size optimisations? #43
Comments
Hey, I'm all for it 🙌 Biota is build to be ran in any environment: client or server. So it should be able to fit in a CloudflareWorker too. Also, one nice thing about biota is that everything can be loaded in fauna (methods are individual User-Defined Functions too) so you - potentially - would only need to be calling fauna's endpoint for User-Defined Functions. It'ld lovely of you to have a look and see what's possible for tree-shaking and size optimization in general. Thanks! |
I've set up a webpack config instead (https://github.com/gahabeen/biota/blob/revamp/webpack.config.js). I think I'll write a second super-light library to use biota with the hosted code on fauna (in user-defined functions). It should be easy as well and weight nothing. Let me know what you think @vinaypuppal. |
Hi, I did not get chance to look in to the existing config yet. I am planning to check it this weekend and I let you know. |
Hi, @gahabeen Sorry for replying late was busy with work
- "target": "es5",
- "lib": ["es2015", "dom"],
- "module": "commonjs",
+ "target": "esnext",
+ "lib": ["esnext", "dom"],
+ "module": "ESNext", So TS -> ESNext will be built and then we can use microbundle or our own rollup config to generate Note: As mentioned in the article we should mention the
I tried to integrate microbundle in the revamp branch but I am getting a lot of TS errors so I did not continue. Once you are done with the API changes lets experiment with microbundle or our own rollup config and see bundle size. |
One more indicator for tree-shaking to work is we need to add is |
I'll have a look at those. Seems promising :) |
I'm splitting I'm reorganizing in a composable way just so it becomes tiny (and even more readable). Just the looking at the number of characters, I reduced it by 8 times :) I'll let you know once it's up! |
Awesome! Waiting for the release. |
Hi,
Thanks for creating this project, this will make getting started with Fauna easier for me as I am just starting with it.
To optimize bundle size, maybe the library can be split into various modules/packages so they are not bundled together and users can import what they need. At the present tree-shaking is not supported as it bundled as commonjs. If possible please enable tree shaking.
I can take a look at enabling tree shaking support if you are okay with it?
The text was updated successfully, but these errors were encountered: