Giter Club home page Giter Club logo

antares's Introduction

Antares

Antares is a way to construct real-time web apps - web apps that have essentially banished the notion of stale data from their repertoire, and are configured to share and respond with data at the speed modern users expect.

🔊

ES 2015 npm version <22 kb Travis Appveyor for Windows Greenkeeper badge

Dev Dependencies npm type definitions styled with prettier try on runkit twitter link

What Exactly Is Antares?

Antares is an API for building the implementation of your custom-event protocol, on the client or server, by orchestrating the consequences for your chosen event types.

What Benefits Can I Get By Using It?

  • A Clean architecture of code with a high degree of decoupling and fault-tolerance.
  • A clean, cancelable model of async effects, not dependent on a component toolkit like React
  • Kickstart your apps' development by building abstractions that simulate input or output, allowing you to focus on the core functionality, of your app
  • Understand and use the Observable datatype - a type that is a superset of Promise, and which can stand in for processes that feed your app data, or processes that cause consequences to the outside world.
  • Drive your app during testing with 'simulated user interaction' to see more of its functionality without clicking around.
  • Use snapshot testing to verify your app's behavior, whether or not it uses React or even has a UI.

What kinds of apps can I build with it?

Antares, with RxJS, manages consequences, which any app has, so it's not limited to client or server, or even Web Apps.

There are many demo apps included in this project that show what you can build.

  • A console app that speaks names and writes to a file
  • A utility that turns all-at-the-end AJAX requests for arrays into streaming Observables (eg /users/)
  • A Web Server in demos/express/index.js
  • A Canvas-based requestAnimationFrame animation.
  • A Console app that detects a cheat-code of 5 clicks in a short interval.
  • A Web Audio app that streams and queues up music from attachments in your Inbox.
  • An IOT application interfacing with Raspberry Pi GPIO (Coming Soon)

OK, but where should I start?

The flagship demo which can be utilized as a course to learn how to fit an Antares Agent with an existing React/Redux/Express app, is located here: The Hotel California Antares Sample App.

It's becoming part of a workshop - if you're interested in learning more, or updating me on your progress, tweet it!

What's the TL;DR?

The 4 Principles:

  1. An agent processes Flux Standard Actions given it through either agent.process or agent.subscribe
  2. Actions are synchronously processed through functions given to agent.filter...
  3. ...and asynchronously processed through functions known as renderers, configured via agent.on.
  4. Renderer functions may produce consequences (i.e. effects, or side-effects) return Observables of new actions to be processed, specify a concurrency mode and be run with other options

Testing? Yes, please!

Antares is highly tested. And since testing async is hard, some integration level tests run a bunch of complex stuff (our demos), and simply assert on the console output. The slightest change in behavior can thus be visible in the output of the demo as a large change. This, with Jest Snapshot testing makes asserting on our output a piece of cake.

For unit tests, check out what the unit test suite looks like on a recent CI build. (Thanks to Dan Abromov for illustrating in his 2015 react-dnd/dnd-core project what a nicely formatted test suite output can be)

Antares has unit tests, and demos whose output is tested in CI on MacOS, Linux, and Windows. Because concurrency must be interacted with to truly be understood, many of the demos support you interacting with them in a console, or at least changing their parameters in config (demos/config.js)

See the output of a run of all demos on Travis CI, and if you run them locally, make sure you have sound turned on!

Here are some more ways you can run demos (use cross-env on windows)

> DEMO=muteFruit INTERACTIVE=1 node demos/index
> DEMO=muteFruit inner=100 outer=100 node demos/index
> cross-env DEMO=muteFruit inner=100 node demos/index

Show your love!

  • Display a badge on your project: I ♥️ Antares
  • Donate to the project to the project, or somewhere you think you can pay it forward, even if not here!

Gratitude, Props, Thanks To


Antares

antares's People

Contributors

deanius avatar deanrad avatar greenkeeper[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

antares's Issues

Accept complete and error props In 3rd argument to `on`

A handler attached via on may want to have its completion and error notifications be of a certain type. Currently the type property of the 3rd argument specifies how to wrap next notifications, this issue would bring it full cycle, so the author would not need to resort to concat and processResults: true as is necessary in a case like below.

 return concat(
        from(goodLines.map(line => ({ type: "goodLine", payload: line }))),
        of({ type: "linesDone" })
      )
    },
    { processResults: true }

https://gist.github.com/deanius/5aba8edf0f102a6269dfbf66a325e96b

addFilter should have an alias `filter`, with similar syntax to `on`.

Current API:
The first argument to addFilter is the filter function. An optional 2nd configuration argument allows you to specify an action filter in the actionsOfType field.

Desired API:
The existing addFilter API does not change its behavior.
A new filter method will take the ActionFilter first, and create a predicate function which will only execute the provided filter function if that predicate returns true (see existing behavior, tests).

The following should be equivalent:
New way:
filter(/room/, ({ action }) => {})
Legacy way:
addFilter(({ action }) => {}, {actionsOfType: /room/})

The legacy way can be useful when your filter will see all actions - this is the default behavior if a configuration object is not provided in a 2nd argument. The new way allows for rules to be independently added on 'shards' of similar actionTypes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.