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

Simpla SDK v2 interface #35

Closed
madeleineostoja opened this issue Sep 2, 2016 · 3 comments
Closed

Simpla SDK v2 interface #35

madeleineostoja opened this issue Sep 2, 2016 · 3 comments
Assignees
Milestone

Comments

@madeleineostoja
Copy link

madeleineostoja commented Sep 2, 2016

Simpla's SDK currently has some MVP work around internal states built. We need to finalise this interface, document it, and make it public. We also need to settle on a new data schema that is easier to reason about.

What we have so far:

  • State properties 'editable': Boolean (whether Simpla is in edit mode), authenticated: Boolean (whether the Simpla client has a logged in user).
  • State getter getState(state: String) : Multiple
  • State observer observeState(state: String, callback: Function) : Function

What we need to finalise

  • We want to implement a 'data': Object state which would hold the entire set of Simpla data on a page, to make reasoning about content both at an element level and for project developers much easier. Need to finalise how this works - is it primary (CRUD methods operate only on the buffer, then save() sets back to the API) or secondary (CRUD methods talk directly to the API, and update the buffer on the way through)?
  • The function name for entering/exiting edit mode imperatively (part of: Decouple edit mode from #edit #29)
  • Reimplement get/set/remove methods
  • Add observe() method for observing content changes, makes authoring Simpla elements trivial.
  • Data schema. The current 'anything goes' approach was fine for early development, but we're already running into inconsistencies and dodgy outcomes - eg: getting a block should not return an array, when getting a leaf node returns an object. All UIDs should have standardised metadata.
@madeleineostoja madeleineostoja added this to the Soon milestone Sep 2, 2016
@madeleineostoja madeleineostoja changed the title Publish new SDK state interface Finalise, implement, and publish SDK state interface Sep 6, 2016
@madeleineostoja
Copy link
Author

madeleineostoja commented Sep 6, 2016

After much discussion Simpla's SDK is going to be buffer-first, which means that get() / set() / etc will talk directly to the data state to get and set data, and it will talk to the API if need be. Then calling save() will PUT those changes in the buffer back to the API.

@madeleineostoja
Copy link
Author

Should also implement #31 while updating get to use data buffer

@madeleineostoja madeleineostoja changed the title Finalise, implement, and publish SDK state interface Simpla v2 Oct 14, 2016
@madeleineostoja madeleineostoja changed the title Simpla v2 Simpla SDK v2 Oct 14, 2016
@madeleineostoja madeleineostoja changed the title Simpla SDK v2 Simpla SDK v2 interface Oct 15, 2016
@madeleineostoja
Copy link
Author

This is live in the 2.0-preview branch, will be pushed live soon. Closing this since it's a bit of a nothing issue anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants