Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Client builds should be static #16

Open
binocarlos opened this Issue · 0 comments

1 participant

@binocarlos
Owner

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
Something went wrong with that request. Please try again.