224 Commits

Author SHA1 Message Date
d3x0r
751ac3b230 pass wsc options to client gun create ( wsc:protocols especially, since that translates to the optional parameter in the standard client websocket constructor ) 2016-12-21 15:03:10 -08:00
Mark Nadal
2e7b87c3b9 Update gun.js 2016-12-19 20:57:07 -08:00
Mark Nadal
44fa4f3252 Update gun.js 2016-12-19 20:30:42 -08:00
Mark Nadal
bdcea8c0d1 Update gun.js 2016-12-17 21:56:15 -08:00
Mark Nadal
ef89785525 Update gun.js 2016-12-17 14:01:58 -08:00
Mark Nadal
53d5417d4a Update gun.js 2016-12-17 12:25:36 -08: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
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
69d1e81fc9 Update gun.js 2016-12-09 18:13:25 -08: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
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
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
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
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
Cole Albon
86a5abd550 #271 one liner fix error while assigning console 2016-11-16 19:14:31 -07:00
Mark Nadal
126a668bf3 Update gun.js 2016-11-15 14:39:24 -08:00
Mark Nadal
24a6c858a2 Merge pull request #254 from alancnet/off-0.5
.off for .on, and .map. (0.5)
2016-11-10 16:39:45 -08:00
Alan Colon
281a56292e .off for .on, and .map. (0.5) 2016-10-23 20:02:28 -06:00
Alan Colon
74b0242682 Enable .set with node, or new soul. (0.5) 2016-10-23 16:45:39 -06:00
Mark Nadal
0aef927eec Update gun.js 2016-10-18 12:11:02 -07:00
Mark Nadal
23f126f219 Update gun.js 2016-10-18 12:05:14 -07:00
Mark Nadal
58753e0f9e Update gun.js 2016-10-12 01:35:20 -07:00
Mark Nadal
9355a36a54 Update gun.js 2016-10-12 01:00:42 -07:00
d3x0r
c5c2d190e5 Update gun.js
Fix localStorage to pull and cache options from parent.
2016-10-10 20:11:56 -07:00
Mark Nadal
df4d87eb3e Update gun.js 2016-10-10 02:03:25 -07:00
Mark Nadal
bf4097beeb temp fix for @d3x0r 2016-10-06 00:28:26 -07:00
d3x0r
5774fa37c6 hoise function implicit() 2016-10-04 21:59:20 -07:00
Mark Nadal
f0a06de464 fix var node for @d3x0r 2016-10-04 19:10:01 -07:00
Mark Nadal
873afd8325 fix @d3x0r 's double close 2016-10-02 09:58:13 -07:00
Mark Nadal
066340ba71 being lazy, using the easy approach for @devel-pa 2016-09-30 18:07:42 -07:00
devel-pa
b8025b207f Unbuilding structure. 2016-09-30 21:19:18 +02:00
Mark Nadal
436376358b wsp should use 'in' if not found. 2016-09-27 14:51:31 -07:00
Mark Nadal
21257424a5 localStorage should recover from a get response 2016-09-27 12:23:59 -07:00
Mark Nadal
f748ef0308 add set back in for @stefdv 2016-09-27 11:40:20 -07:00
Mark Nadal
05bb232d4d put now accepts refs again 2016-09-27 11:32:36 -07:00
Mark Nadal
a0a5be519a Update gun.js 2016-09-26 22:43:50 -07:00
Mark Nadal
00d8fe331e use intended message ID 2016-09-25 18:12:26 -07:00
Mark Nadal
11a390e7b2 toJSON 2016-09-25 18:10:58 -07:00
Mark Nadal
4d13585be8 check against undef not falsy 2016-09-25 15:40:32 -07:00
Mark Nadal
fa3d3eeff4 0.5 BETA TESTING 2016-09-25 13:06:29 -07:00
Mark Nadal
acc085a8ed currently VERY broken 2016-09-17 14:50:36 -07:00