22 Commits

Author SHA1 Message Date
Jesse Gibson
dd8b472943 Update readme
Added section about the new Client#matches method.
2016-11-25 21:04:37 -07:00
Jesse Gibson
c84158af0a Add editorconfig, change scripts
Editorconfig files help you keep a consistent style across projects.
Recently, I've been using it to enforce spaces over tabs (I switched).
This commit adds the config file and changes the project indent
style to match.
New script, "all-tests", runs the unit tests and the linter. The "test"
script now just refers to unit tests.
2016-11-25 15:51:26 -07:00
Jesse Gibson
07250450a7 Fix readme
I forgot to uncomment the image and badge links! They slow down my
markdown previewer... [CI skip]
2016-10-06 11:08:31 -06:00
Jesse Gibson
bd8e1ce58e Update readme
Revise the docs to include the Client API, and change up some of the
confusing/bloated parts of the readme (like that monologue on promises).
2016-10-06 11:05:19 -06:00
Jesse Gibson
eb4d0adc00 Update docs and changelog
Removed "create client interface" from the readme roadmap, and added it
to the changelog.
2016-10-05 08:55:55 -06:00
Jesse Gibson
b220402001 Add method .atLeast
Resolves when a minimum number of clients join (or have joined) your
list.
2016-10-03 17:51:27 -06:00
Jesse Gibson
0d7c3b06e9 Add logo for readme
Cool logo/image from Alvaro (soon to link to the new website!). Updated
readme to reflect the direction a bit better...
2016-08-13 09:40:28 -06:00
Jesse Gibson
0ad6b4b8d3 Upgrade to panic-client v0.2.0, update docs.
Panic-client 0.2 comes with some great new improvements, like supporting back through IE6, making async functions more brief, and preventing implicit
scope injection except under a new flag, '@scope'. This commit updates
the docs to reflect the changes from panic-client, and updates the
client version dependency.
2016-05-28 22:31:39 -06:00
Jesse Gibson
7425aaac2d Rename .len() to .length, allow subclassing, export client bundle.
Instead of calling a method to find the length of a list, you can use a
property (which is a getter under the hood, doing the same thing as
`.len()`). This is cleaner and more intuitive, aligning itself more with
arrays.
Subclassing is now facilitated by a new method, `.chain`. It creates a
new list instance by calling the constructor property, instead of
statically creating a new ClientList instance. This allows you to
create subclasses that inherit from ClientList, without losing that
inheritance when calling `.filter` or `.pluck` (methods which create new
list instances).
The client bundle is now exported lazily, so when you import panic,
there's a `client` getter which memoizes a fs call for the client code.
This allows compatibility on pre-3.0 versions of npm, where other packages
might not be able to recursively find `panic-client`. Also, since it's a
getter, it doesn't do the file system call until it's needed.
2016-05-28 21:16:23 -06:00
Jesse Gibson
5bc03a2047 Don't extend Function.prototype
Instead of extending the Function's prototype with the `toJSON()`
method, since the `v0.1.0` refactor all functions have a narrow entry
point, meaning you can simply call `String(callback)`. The prototype is
no longer extended. Changelog and package.json updated.
2016-05-03 12:28:00 -06:00
Jesse Gibson
9a4c36a7b8 Added short section on using co.js
In the async/await section, it wouldn't have been the same without
mentioning our supreme leader Tj Holowaychuk and his co js library.
Basically a syntax sugar using generators over promises. Added a short
demo of how to use it with panic.
2016-05-02 15:33:23 -06:00
Jesse Gibson
e7eea4286a Add client max method, fix .excluding bugs
There's a new method called `.pluck` that limits a list's length,
allowing you to arbitrarily pick out clients and select them for tasks.
The version has been bumped, changelog updated and readme modified.
Also, the `.excluding` method wasn't reactively checking to see if the
exclusion set was reduced, only added to. All tests passing.
2016-05-02 15:12:25 -06:00
Jesse Gibson
5a6738bd7f Expose the ClientList, add super list feature
The `panic` object has a new property, `ClientList`, that allows users
to create their own lists easily. It brings in a new feature: you can
pass subgroups into the constructor as an array and it'll source it's
clients from them, allowing groups to be created from smaller
ones. Readme, changelog, npm version, and tests updated.
2016-05-02 12:46:13 -06:00
Jesse Gibson
05ddb23631 Fix documentation mistakes, remove duplicate examples
An example showing how to import code was showing the root route, which
has been deprecated in favor of /panic.js. Some examples were
duplicated, such as how to import client code. Now one simply links to
the other.
2016-05-02 11:28:06 -06:00
Jesse Gibson
e1ce854a9c Allow sharing of http.Server instances
`panic.serve` has been replaced with `panic.server`, which accepts
`http.Server` instances instead of options and always returns the
instance. This allows you to run one server and share it, instead of
creating one for each task. Also added a changelog to keep track of...
changes.

Breaks compatibility with `panic.serve`.
2016-05-01 13:55:15 -06:00
Jesse Gibson
4c50671892 Add shields.io badges, bump minor version, fix require path. 2016-04-29 15:29:01 -06:00
Jesse Gibson
6e9163c2dc Minor docs refactor 2016-04-29 15:09:06 -06:00
Jesse Gibson
6f9ebab74b Add extensive documentation on all methods.
Every method exposed through the clientList (except .set[deprecated])
has been thoroughly documented in the readme.md file.
2016-04-29 14:55:58 -06:00
Jesse Gibson
758a8fc8d6 Minor modifications (readme, tests)
Prep for server test dispatch interface by tying socket events to server events.

Link to gun in the readme.

Not really much in this commit.
2016-03-15 16:02:59 -06:00
Jesse Gibson
02ad7ff049 Add readme examples
Added example demo the readme so people can quickly understand why panic
is awesome.
2016-03-09 14:01:00 -07:00
Jesse Gibson
3e4946951a Test coverage, imperative instead of declarative test syntax
After discussing the goals for panic more with Mark and Sean, I decided to take panic in a different direction. Previously, the interface used an options object to do test setup, and was completely declarative in nature. In order to do more complex things with the framework, it would have needed new features hacked into the existing one, without a solid, well tested foundation to build on. That was a bit frightening. As radical as it was, I decided to mostly rewrite the framework to be similar to a traditional test framework (such as jasmine or mocha), with a major twist - it will send your tests out to the connected clients to be run, and you can filter which platforms/peer IDs to run on. Since the approach is more imperative, it will be more verbose, but it also allows for faster scaling, ease of adding new features, more expressive/flexible tests, greater coverage, and approachable syntax.

With luck, panic will be around for quite some time. If that's the case, it really, really needs high test coverage, so I began with jasmine from the start. In addition, who's going to trust results from an untested test framework?
2016-03-03 14:40:51 -07:00
Jesse Gibson
aa4d9b550c Add readme 2015-12-17 19:45:56 -07:00