Older versions of npm don't support the caret version selector, which
seems to be failing Travis-CI gun build 649.1 & 649.2.
I've switched it to a more backwards-compatible version selector.
Sadly, I can't test if it works on my machine, since the node install
seems to fail on all versions prior to v4. Travis will just need to tell
us :)
Move E2E panic tests into their own dedicated folder so mocha won't
automatically attempt to run it. New npm script (`npm run e2e`) runs
those tests with mocha explicitly.
This solves a number of problems:
- Travis-CI can't run the panic tests without a selenium server, which
requires a ton more setup that simply hasn't been done yet.
- Selenium-webdriver doesn't support node < v4, and immediately fails
the build on those environments.
If at any point in the future we want those tests to run automatically,
here's what we'll need:
- Browserstack or SauceLabs tunneling and auth env variables.
- Bash script to detect node version and only install deps and run the
tests if the environment supports it.
Also, a number of tests had `.only` in front, preventing all the others
from running. They've been removed.
Running the unbuild step wipes out the src/.gitignore file. Instead,
now the root .gitignore file is told to ignore src/.
Prevents a scenario where you run unbuild, it wipes out the .gitignore
file, and `git status` shows all the new src files as untracked. A
developer could accidentally commit them without realizing it.
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.
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).
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 }
}
}
})
Two separate modules (localStorage & websockets) ensured JSON was
globally defined. Since only one is needed to alert the user, the
other has been removed.
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.
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.
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
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.