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

Move storage to adapter #77

Open
madeleineostoja opened this issue Oct 18, 2017 · 2 comments
Open

Move storage to adapter #77

madeleineostoja opened this issue Oct 18, 2017 · 2 comments
Assignees
Milestone

Comments

@madeleineostoja
Copy link

madeleineostoja commented Oct 18, 2017

I'm submitting a

Feature request

Description

Right now Simpla is tightly coupled to using Github as a backend. Instead, we should split both Auth and Storage into adapters. Under this setup the auth adapter would handle everything to do with user management, rather than just authenticating an access token with github, and the storage adapter would just check with the auth adapter whether a change can be written, and then go ahead and write that change to where it's configured to.

Public API would stay relatively unchanged

Simpla.init({
  storage: new SimplaGithub({ repo: 'username/repo' }),
  auth: new SimplaNetlify({ site: 'mysite' }),
  ...
});
@bedeoverend
Copy link
Contributor

It'd be great if we could land this earlier than 4, to unblock things like #84. We could just split out the current adapter, but keep it as a fallback for if people don't supply one. Only downside here is people using an external adapter would still cary the weight of the builtin one (~1.2kb gzip)

IMO this is a worthwhile tradeoff to get it in earlier, as it'd only affect people wanting to use an external adapter. Can then properly strip out in version 4.

@madeleineostoja
Copy link
Author

Sounds like double handling for the sake of it to me. If we really want to get this out before implementing observables (main planned breaking change for 4), we can bake a major version now and call that stuff 5.

Personally I'd prefer to hold off until we can bundle several breaking changes though, especially since we literally just released 3/OSS. We already know the interface for observables (mostly), so it's just implementation and updating the el behavior (which can stay on WC v0).

Or alternatively can just push it to a v4 branch or even master and not bake a release at all yet, then just install straight from git to use/test it.

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