Comments (8)
Hey,
I'm all for it π
Size matters and it should be as small as possible. Biota is still new and clearly needs optimization.
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!
P.S: Be careful, project isn't production ready just yet π
from biota.
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.
from biota.
I'll have a look at those. Seems promising :)
from biota.
I'm splitting biota
in quite a few libraries. Like @biota/schema, @biota/builder, @biota/factory, @biota/api, @biota/auth, etc.
I'm reorganizing in a composable way just so it becomes tiny (and even more readable).
Btw, I'm using microbundle
as following your recommendations ;)
Just the looking at the number of characters, I reduced it by 8 times :)
I'll let you know once it's up!
(Disputing the @biota organization on npmjs right now, and still have some work before release anyway)
from biota.
I've set up a webpack config instead (https://github.com/gahabeen/biota/blob/revamp/webpack.config.js).
It's still way too big because of the number of files and contents.
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.
I'll also need to refactor some code at some point anyway too.
from biota.
Hi, @gahabeen Sorry for replying late was busy with work
- Rather than using Webpack, we should use Rollup as this is library. A quote from this article
If your codebase is ES2015 modules and youβre making something to be used by other people, you probably want Rollup.
- As mentioned in the article I would suggest changing
tsconfig
to
- "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 commonjs
and umd
bundle.
Note: As mentioned in the article we should mention the module
filed in package.json which should point to ES Modules version of our lib, so bundlers used by our library users like Webpack can implement tree-shaking.
"main": "dist/foo.js", // output path for CommonJS/Node
"module": "dist/foo.module.js", // output path for JS Modules
"unpkg": "dist/foo.umd.js", // optional, for unpkg.com
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.
from biota.
One more indicator for tree-shaking to work is we need to add is sideEffects
field in package.json
More info about it here
from biota.
Awesome!
Waiting for the release.
from biota.
Related Issues (20)
- Issue with pagination properties definition
- Add magic.link authentication integration HOT 2
- Add an Error Management System
- Make sure every method returns ctx+data+action
- Add backup strategies
- Add environments switch (dev/test/staging/prod for ex)
- Add data validation (in FQL)
- Project Sample Ideas
- Privileges rights only works on specific updates
- FQL Function: Format("%@, params) fails when given big object HOT 1
- Add auth via Authy
- Add custom resolvers
- Add public rights
- Anyone should be able to access public doc by id but not paginate them HOT 1
- Add plans/subscriptions management
- Add unlogged (guest) access
- Deduplicate the code from factory.document for user/session/action
- Add versionning to resources (indexes, UDFs?, roles?)
- Add type tests with an adapted version of JSONSchema validator in FQL
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from biota.