Coder Social home page Coder Social logo

sharedjs.core's Introduction

SharedJS Core JS library

CommonJS Mocha testable shared JavaScript library. This project is a dependency for the following projects:

Purpose of this PoC library

Share as many code as possible in both Web and Mobile JS applications. This PoC library is set up in such a way that e.g. the same business logic and state, but e.g. different persistency, audioplayer or Google analytics implementations can be applied in both web and app projects.

###Why a shared JS codebase

  • Just like we use Titanium to develop apps for both iOS + Android, why not use JS to โ€ฆ
  • Take away inconsistencies between mobile app and web app logic.
  • Keep things DRY, why write something in JS twice?
  • Reduce TCO. Cut costs for both initial development + AM

###Objectives

  • Keep business logic in one place
  • Unit test business logic once
  • Leverage context specific technologies:
    • HTML5 BB Web App: It should be possible to use BB plugins like LayoutManager + Stickit
    • Ti Alloy App: It should be possible to use Alloy views and Alloy MV binding.
  • Keep it very simple! With very little, and no exotic, dependencies.

###Setup insctructions Setting up this project would require the following:

$ npm install

####proxy shim Apart from that to load our dependencies via node require, we need a shim for Mocha testing. To achieve this, we made a very cheap shim leveraging the way node uses node_modules as a search path when searching for modules. For this reason in node_modules we create a custom proxy.js which serves as a proxy of its own for our local project utils/proxy.js module. We explicitly added this file to git while ignoring everything else inside the node_modules folder.

image

###Test instructions Either use the repository grunt tasks to test the library or use.

$ mocha

Documentation

Please find a list of the main libraries and modules used in this project:

For more information see my slides on Speakerdeck

sharedjs.core's People

Contributors

karaoak avatar

Watchers

 avatar

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.