661 Commits

Author SHA1 Message Date
Mark Nadal
5ade1b6773 idea for solution 2016-12-17 23:54:32 -08:00
Mark Nadal
02381a123d so much 2016-12-15 16:17:50 -08:00
Mark Nadal
ad345582aa Merge pull request #294 from PsychoLlama/0.5
Shallow copy constructor options
2016-12-15 15:46:18 -07:00
Jesse Gibson
a566572a2d Shallow copy constructor options
Previously constructor options were deeply copied, which caused
issues with 3rd party plugins when they pass "class" instances as
options (since instances were copied into POJOs, breaking the prototype
chain). Now it's shallow copied. Special treatment is still given for
the `peers` property.
2016-12-15 15:35:11 -07:00
Mark Nadal
90f0d7f687 Merge pull request #292 from PsychoLlama/0.5
0.5: make the websocket logic more robust
2016-12-13 15:43:04 -05:00
Jesse Gibson
ba673f73f8 Attempt reconnect on disconnect
Previously, the client websocket layer would only attempt a reconnection
if there were pending messages in the queue. Now it will always attempt
a reconnection, solving most of issue #259 (although not completely, as
reconnects are susceptible to race conditions).
2016-12-13 13:37:43 -07:00
Jesse Gibson
304265e193 Pass backoff options from constructor
The Client constructor supports backoff configuration. This commit
exposes it to the end developer via the `peers` options object, in the
`backoff` property.
Example:

Gun({
  peers: {
    'url.com/gun': {
      backoff: { max: 1000, factor: 0.2 }
    }
  }
})
2016-12-12 16:24:51 -07:00
Jesse Gibson
30fe844cab Check JSON support just once
Two separate modules (localStorage & websockets) ensured JSON was
globally defined. Since only one is needed to alert the user, the
other has been removed.
2016-12-12 16:10:39 -07:00
Jesse Gibson
bb65acab10 Merge branch '0.5' of https://github.com/amark/gun into 0.5 2016-12-12 15:12:41 -07:00
Jesse Gibson
01c93157cb Fix msg passing, add reconnect & backoff
Fixed broadcast storm caused by re-enveloping the same message and
re-emitting it (I passed the envelope to gun, not just the msg body).
Sockets will attempt an exponential reconnect if the message queue isn't
empty, otherwise they're still just lazy bums that only open when
needed.
JSONP wasn't working before I took on this project, but now it's
completely disconnected. Once it's working, it should go in the
`request` function as a websocket fallback.
2016-12-12 14:37:09 -07:00
Mark Nadal
9f7acfd27f Merge branch '0.5' of https://github.com/amark/gun into 0.5 2016-12-09 18:20:45 -08:00
Mark Nadal
0779e32544 merged? Maybe? 2016-12-09 18:20:16 -08:00
Mark Nadal
69d1e81fc9 Update gun.js 2016-12-09 18:13:25 -08:00
Mark Nadal
34eb293a63 be brave, clean up 2016-12-06 23:48:10 -08:00
hillct
c5f7b6283b Merge pull request #289 from hillct/feature/herokuDeployButton
Feature/heroku deploy button
2016-12-03 14:47:36 -05:00
hillct
dda4ac3aaf Very simple addition of deploy to Heroku button
Typo corrections
2016-12-03 14:45:28 -05:00
hillct
97eaea6a75 BasicDocker Button deployment with template app.json file 2016-12-03 14:13:18 -05:00
Jesse Gibson
b352cd742a Update client WebSocket plugin
Lovely little abstraction layer over websockets sends messages using
gun's new envelope system. Exponential backoff has not been
implemented yet. If the socket fails to connect, it won't retry (yet).
Also, this update left some dead code with the jsonp implementation.
Soon that should be ported over to the new envelope system too, but now
it's disconnected from gun.
2016-12-01 16:51:35 -07:00
hillct
968ec73aea Removed extraneous merge conflict marker 2016-12-01 03:20:22 -05:00
hillct
84f8cd0661 Merge pull request #288 from hillct/0.5
Just a little cleanup go get #287 to merge cleanly
2016-12-01 01:40:11 -05:00
hillct
b13000c40c Merge branch 'hillct-feature/dockerHooks' into 0.5 2016-12-01 01:30:19 -05:00
hillct
7ae8011c00 Conflict Cleanup 2016-12-01 01:12:40 -05:00
hillct
6b78b2ee91 Fixed Vendor Name 2016-12-01 00:57:48 -05:00
hillct
9fe11f6e9f Added local Docker hook usage example 2016-12-01 00:53:08 -05:00
hillct
237b445ebc Merge branch 'feature/dockerHooks' of github.com:hillct/gun into feature/dockerHooks 2016-12-01 00:14:10 -05:00
hillct
ba1ca8f54f Made the Docker Hub Automated build hook usable offline via 'npm docker'
Incorporated the unbuild step into the prepublish lifecycle workflow
Assured that /src files from Unbuild will never be comitted accidentally
Updated the uglify-js depencency and prepublish script for module rename
2016-12-01 00:11:38 -05:00
hillct
fbbd5d5899 Commit Badge from Microbadger 2016-11-30 22:06:37 -05:00
hillct
6d98b19c67 Dwitched to an older style git call, to get the repo URL 2016-11-30 20:04:27 -05:00
hillct
967bc972f7 Alpine based Docker image, metadata labels & Autobuild hooks 2016-11-30 19:02:28 -05:00
Mark Nadal
dd72a24740 Merge branch '0.5' of https://github.com/amark/gun into 0.5 2016-11-29 20:20:32 -08:00
Mark Nadal
111d0f5bda instance specific dedup for @d3x0r 2016-11-29 20:19:59 -08:00
hillct
0886ab357e Quick fix Restoring the Gun Logo 2016-11-29 20:22:57 -05:00
hillct
fbb8bbccb1 Merge pull request #286 from hillct/feature/DockerHub
DockerHub Documentation and sugar
2016-11-29 19:40:36 -05:00
hillct
45eb39ff29 Documentation for Docker Hub 2016-11-29 19:37:10 -05:00
hillct
cb397aeb8b Merge pull request #3 from amark/0.5
0.5 catchup
2016-11-29 19:20:06 -05:00
Mark Nadal
bd960b4d67 thanks to @Stefdv #284 2016-11-29 11:35:20 -08:00
Mark Nadal
ce32d8414b ahem, thank you d3x0r 2016-11-28 20:31:27 -08:00
Mark Nadal
71f15e21c6 Merge branch '0.5' of https://github.com/amark/gun into 0.5 2016-11-28 19:41:11 -08:00
Mark Nadal
3e2bf996fa final touches 2016-11-28 19:40:39 -08:00
Mark Nadal
9abe3fb75f fix for d3x0r and Stefdv 2016-11-28 17:57:20 -08:00
Mark Nadal
dff24e2578 Merge pull request #283 from hillct/feature/withBuildMinified
Minify Gun at package publish-time
2016-11-28 11:07:53 -07:00
Mark Nadal
4526ffda52 Merge pull request #281 from PsychoLlama/0.5
Add envelope-system server sync
2016-11-28 10:59:43 -07:00
hillct
7c0c7f3605 Minify Gun at package publish-time 2016-11-27 13:04:37 -05:00
Jesse Gibson
4848493530 Add envelope-system server sync
Using gun's new envelope system (where routing and de-duplication happen
inside gun core), server-to-server synchronization has been
implemented.
However, it comes with this warning: the chain isn't yet ready and
you'll have difficulty reading or writing data via the chain.
2016-11-25 14:42:44 -07:00
Jesse Gibson
9d9dea2553 Add envelope plugin system
@amark made these changes, I'm just committing them.
2016-11-25 09:49:48 -07:00
Mark Nadal
c8e919f287 fix chain 2016-11-22 18:07:49 -08:00
Mark Nadal
42003cb82f Merge pull request #276 from PsychoLlama/s2s-sync
Optimistically open client sockets
2016-11-18 13:09:29 -07:00
Jesse Gibson
6a63b46d2b Add max reconnect backoff
Sockets will try to reconnect upon disconnection with an exponentially
rising backoff (configurable). However, if it's unbounded, at a certain
point does it need to even try? Probably not. Instead there's now a
`max` option that defaults to a minute, and the backoff will never
exceed that time.
2016-11-18 12:49:58 -07:00
Jesse Gibson
2696b4cf88 Merge branch '0.5' into s2s-sync 2016-11-18 11:57:06 -07:00
Jesse Gibson
70698112e4 Merge branch '0.5' of https://github.com/amark/gun into 0.5 2016-11-18 11:50:24 -07:00