/recurve

Javascript front-end framework

Primary LanguageJavaScriptMIT LicenseMIT

recurve Build Status

Javascript front-end framework for single page applications

Based on similar design to AngularJS with dependency injection for loading modules, services and to facilitate easy unit testing. But the core framework does not make any assumptions about the View. Can be used with any view/templating library, but designed with React in mind since it is great :)

Don't use this framework!!! there is no documentation (unless you count the +1500 unit tests as documentation) and never will be. I won't be maintaining this project. Many of the services have been released as independent libraries such as recurve-storage, recurve-cookies instead.

Why won't this be finished? There are too many Javascript front-end frameworks already, and I don't have enough spare time to finish and maintain this project. This project was mainly to explore some design ideas and concepts.

Overview

Everything is broken down into modules which are further broken down into services. The goal is to pick and choose modules depending on the app.

Core

Core of the framework that offers a set of re-usable services that can be used with any view/templating library to build apps.

  • di - dependency injection framework: containers and modules
  • http - http request handling, promise based
  • log - logging framework with default logging target to window.console
  • async - asynchronous helpers
  • cache - generic cost and count based cache
  • common - support/helper methods used by all services
  • cookies - cookies wrapper
  • document - wrapper around window.document to facilitate easy mocking for unit tests
  • error-handler - error handler helpers
  • event-emitter - event emitter bus
  • performance - wrapper around performance tracking
  • promise - A+ compliant promise implementation. The framework is based around the usage of promises.
  • router - push state router
  • signal - signal event/messaging. Inspired by AS3 signals
  • storage - local/session storage wrapper
  • timeout - promise based time outs
  • uncaught-error-handler - handle uncaught errors
  • window - wrapper around window to facilitate easy mocking for unit tests

Mock

Mocked core services to simplify unit testing

  • mock - bootstrap and helpers for Mocha/Jasmine unit testing
  • mock-async - makes usage of async service to be synchronous through calls to flush()
  • mock-cookies - stores cookies in memory instead of document.cookie
  • mock-error-handler-decorator - logs all uncaught errors to memory with helpers to query errors
  • mock-http-provider - mock http responses
  • mock-log - logs all to memory with helpers to query the logs
  • mock-storage - stores to memory instead of window.localStorage/window.sessionStorage

Flux

Implementation of Flux

Flux-React

Services for React using Flux architecture.

  • state-router - nested state based router that also handles data loading for states
  • state-store - data store of the current app state
  • state component - React component to render a router state

Flux-Rest

REST implementation for use with the Flux architecture. Builds on the http service.

Docs

The unfinished part...

All documentation would be generated from comments in the code. The code would be run through the dox library along with some post processing, and then rendered in an app built with the Core and Flux-React modules. This is an absolutely terrible use case for SPA frameworks

Everything is mostly done, except for writing all of the comments in the code :(

Running the Tests

grunt test

Browser Support

IE9+

License

The MIT License (MIT)

Copyright (c) 2015 Sebastien Couture

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.