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

Client builds should be static #16

Open
binocarlos opened this issue Nov 20, 2013 · 0 comments
Open

Client builds should be static #16

binocarlos opened this issue Nov 20, 2013 · 0 comments

Comments

@binocarlos
Copy link
Contributor

digger-serve should not be concerned with building client javascript - they should be delivered as static files once built (from CDN or somewhere)

Then - you 'connect' to servers using whatever supplychain's that have been registered.

This means you can run a multi-digger page that uses Sockets to connect to one server and XHR to another:

The static client library (digger-client for browser):

<script src="http://cdnjs.com/digger.min.js"></script>
var digger1 = $digger.supplychain('http://server1.com/v1', 'socket');
var digger2 = $digger.supplychain('http://server2.com/v1', 'xhr');

var warehouse1 = digger1.connect('/my/db');
var warehouse2 = digger2.connect('/my/db2');

More importantly than connecting to 2 different servers is that the supplychain implementation is totally separated from the digger-client static file.

To do this we need a way of registering supplychains:

$digger.supplychain.register('socket', require('digger-sockets'));
$digger.supplychain.register('xhr', require('digger-xhr'));

This also means we can write LocalStorage supplychains and have a whole digger app in the browser.

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

No branches or pull requests

1 participant