-
Notifications
You must be signed in to change notification settings - Fork 0
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
what APIs to tree-shake and what not? #58
Comments
Arguments for tree-shakable:
Arguments for an all in one object
I tend to favor tree-shakable. The |
I forgot about Paraglide JS style tree-shaking + API discovery! This seems to combine the best of both worlds!
import * as sdk from "lix-js/sdk"
// full api discovery for every sdk api
sdk.x
// even `openLix()` is now discoverable
const lix = await sdk.openLix()
// "state" related functions are discoverable + tree-shakable 🎉
await sdk.commit({ lix, ... args })
await sdk.merge({ lix, ... args })
await sdk.resolveConflict({ lix, ...args }) In case you wonder why I do |
Context
We are exposing a mix of tree-shakable and non tree-shakable APIs atm.
Proposal
Settle on one consistent approach.
The text was updated successfully, but these errors were encountered: