GithubHelp home page GithubHelp logo

dworklight's Introduction

dworklight : Dojo - Worklight Libraries

This project contains several modules to assist in using Dojo within the IBM Worklight platform.

Discuss or ask questions

Status

No official release yet.

Licensing

This project is distributed by the Dojo Foundation and licensed under the "New" BSD License. All contributions require a Dojo Foundation CLA.

Dependencies

This project requires the following other projects to run:

  • dojo
  • dojox/mobile
  • dcordova

Installation

Prerequisites:

  • NodeJS for NPM install.
    • The magic goo that makes all things true
  • Grunt Command Line automation framework
    • npm install -g grunt-cli
  • Bower package management
    • npm install -g bower

Developers - Manual installation procedure:

  1. Ensure prereqs are installed
  2. Install this project by cloning from github
    • git clone git://github.com/ibm-dojo/dworklight.git
    • cd dworklight
  3. Install external required packages
    • npm install
  4. Put required modules in the right places
    • grunt bower
  • Manual installation by dropping dworklight as a sibling of the top level Dojo modules:
  • dojo
  • dcordova
  • dworklight

To install the latest master, go to the root Dojo installation directory and clone dworklight from github

git clone git://github.com/ibm-dojo/dworklight.git git clone git://github.com/ibm-dojo/cordova.git

Documentation

TODO, but here's the general modules

See the kfbishop/dworklight-testapp project for tests and usage of the dworklight modules within a actual Worklight app.

activity

Simple activity control that allows for native or Dojo basic activity indicators.

console

Worklight console logging adapter. Enables use of standard console.xxx() commands that will be output correctly on the Android LogCat and XCode loggers. Also enables multiple arguments with clean JSON encoding of WL.Logger.Xxx() commands.

features

'Has' feature detection for Worklight. Provides dozens of has tests to properly identify the Worklight operating environment.

request

Worklight Adapter integration to feel more like a normal dojo/request style. Standard promise style callback are supported over the unique Worklight adapter invocation style calls.

require

Worklight Custom AMD require support. Allows for remotely hosted modules located in the Worklight mobilewebapp environment to be loaded in a hybrid application, regardless of hosting location.

env

Environment specific modules.

env/android

Android specific support. Currently support back button handling.

env/preload

Preloader to mock Worklight env and set device type.

store

Worklight Stores

store/JSON

store/Adapter

stores/WorklightStore

API to enable direct access ot both JSONStore and EncryptedCache

Credits

  • Karl Bishop (IBM CCLA)
  • Chris Felix (IBM CCLA)

dworklight's People

Contributors

ccmitchellusa avatar cjolif avatar kfbishop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ccmitchellusa

dworklight's Issues

Add prebuilt packages to the Installation section.

The current installation examples are full source checkouts of the github projects. Can you please add examples that use NPM or bower to get a pre-built version of dworklight and automatically install dependencies like dcordova using package.json dependencies.

JSON.js support for managing connection to WL JSON Store.

It would be a huge help if JSON.js could abstract away some of the mechanics of getting the WL JSON Store in the first place. WL.JSONStore.init() took me a long time to get working (the docs weren't clear that it was returning a Deferred), and I still can't get WL.JSON.get() to work at all (instead, I am using the value returning from init's Deferred, which contains handles to all the collections. Abstracting out this flaky bit (which also needs to be wrapped in an onDeviceReady callback) would be a real time-saver.

Parity sync with dcordova

Per Christophe note:

Updates:

  • Rename sniff to features
  • Update license
  • Remove deviceReady (now dep on dcordova/deviceReady)

Adding in a "/src" directory?

I am adding in support various build tools like Grunt, and npm and all their various children. I would like to move all the actual source modules into a "/src" tree to clean up the entire structure. What are your thoughts on this good or bad?

I'm close to having a new generic grunt task that will scan the code base (and all dependents) and automatically generate a build profile, and then build the project(s). But not sure where the resulting files be located (if at all) in the project tree. For the most part, the end result will not be a single JS file (dworklight will have a minimum of 2 files). We can create a single zip, but I also think we need the full optimized tree available for extraction as well.

Thoughts?

Store/JSON.js doesn't behave correctly when it can't find data

I've been using JSON.js as the backing store of a dojo/store/Cache store. However, the Cache (and I think the Dojo store spec. more generally) expects get to return undefined if there is no data (this is an important case, as obviously the cache uses that to decide when it fetches data from the master store). However, JSON.js instead rejects the Deferred. That doesn't make sense to Cache, and causes it never to attempt getting data from the master store - obviously bad. I've hacked around this locally by changing the line in _getLocal to def.resolve(undefined) when nothing is found, but there may be a more robust fix.

Cleanup of "stores" modules

ESLint output. Please clean up when time permits:

./stores/WorklightStore.js: line 75, col 6, Warning - Unexpected use of ==, use === instead.
./stores/WorklightStore.js: line 89, col 3, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 97, col 49, Warning - Missing semicolon.
./stores/WorklightStore.js: line 98, col 48, Warning - Missing semicolon.
./stores/WorklightStore.js: line 120, col 3, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 128, col 49, Warning - Missing semicolon.
./stores/WorklightStore.js: line 129, col 48, Warning - Missing semicolon.
./stores/WorklightStore.js: line 148, col 49, Warning - Missing semicolon.
./stores/WorklightStore.js: line 149, col 48, Warning - Missing semicolon.
./stores/WorklightStore.js: line 167, col 49, Warning - Missing semicolon.
./stores/WorklightStore.js: line 168, col 48, Warning - Missing semicolon.
./stores/WorklightStore.js: line 186, col 49, Warning - Missing semicolon.
./stores/WorklightStore.js: line 187, col 48, Warning - Missing semicolon.
./stores/WorklightStore.js: line 199, col 32, Warning - Missing semicolon.
./stores/WorklightStore.js: line 199, col 68, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 199, col 114, Warning - Missing semicolon.
./stores/WorklightStore.js: line 199, col 146, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 199, col 196, Warning - Missing semicolon.
./stores/WorklightStore.js: line 201, col 6, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 210, col 3, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 217, col 5, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 220, col 5, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 223, col 6, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 227, col 6, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 234, col 4, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 242, col 3, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 244, col 4, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 247, col 4, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 252, col 8, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 256, col 8, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 262, col 7, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 284, col 8, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 291, col 7, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 301, col 6, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 319, col 7, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 321, col 23, Warning - Missing semicolon.
./stores/WorklightStore.js: line 321, col 23, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 322, col 25, Warning - Missing semicolon.
./stores/WorklightStore.js: line 322, col 25, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 333, col 3, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 337, col 40, Warning - Missing semicolon.
./stores/WorklightStore.js: line 338, col 40, Warning - Missing semicolon.
./stores/WorklightStore.js: line 349, col 3, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 360, col 3, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 368, col 4, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 371, col 5, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 375, col 5, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 380, col 4, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 392, col 5, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 395, col 8, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 399, col 8, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 403, col 5, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 406, col 8, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 410, col 8, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 417, col 4, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 430, col 14, Warning - Unexpected use of !=, use !== instead.
./stores/WorklightStore.js: line 431, col 4, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 433, col 12, Warning - Unexpected use of !=, use !== instead.
./stores/WorklightStore.js: line 434, col 4, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 436, col 4, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 445, col 5, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 449, col 5, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 454, col 4, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 464, col 6, Warning - Unexpected use of ==, use === instead.
./stores/WorklightStore.js: line 465, col 4, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 474, col 5, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 477, col 8, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 481, col 8, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 487, col 8, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 491, col 8, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 498, col 4, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 506, col 3, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 510, col 5, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 513, col 6, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 517, col 6, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 523, col 4, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 531, col 3, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 537, col 8, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 541, col 8, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 547, col 7, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 560, col 22, Warning - Use double quotes for string literals.
./stores/WorklightStore.js: line 560, col 37, Warning - Unexpected use of ==, use === instead.
./stores/WorklightStore.js: line 561, col 7, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 564, col 47, Warning - Use double quotes for string literals.
./stores/WorklightStore.js: line 564, col 90, Warning - Use double quotes for string literals.
./stores/WorklightStore.js: line 564, col 131, Warning - Use double quotes for string literals.
./stores/WorklightStore.js: line 565, col 7, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 566, col 21, Warning - A constructor name should start with an uppercase letter.
./stores/WorklightStore.js: line 569, col 7, Warning - Unexpected console statement.
./stores/WorklightStore.js: line 570, col 21, Warning - A constructor name should start with an uppercase letter.
./stores/_EncryptedCache.js: line 8, col 3, Warning - Unexpected console statement.
./stores/_EncryptedCache.js: line 50, col 3, Warning - Unexpected console statement.
./stores/_JSONStoreCache.js: line 37, col 6, Warning - Unexpected use of !=, use !== instead.
./stores/_JSONStoreCache.js: line 38, col 4, Warning - Unexpected console statement.
./stores/_JSONStoreCache.js: line 41, col 4, Warning - Unexpected console statement.
./stores/_JSONStoreCache.js: line 42, col 11, Warning - ['__parent'] is better written in dot notation.
./stores/_JSONStoreCache.js: line 47, col 36, Warning - Unexpected console statement.
./stores/_JSONStoreCache.js: line 47, col 92, Warning - Missing semicolon.
./stores/_JSONStoreCache.js: line 48, col 38, Warning - Unexpected console statement.
./stores/_JSONStoreCache.js: line 48, col 129, Warning - Missing semicolon.
./stores/_JSONStoreCache.js: line 61, col 3, Warning - Unexpected console statement.
./stores/_JSONStoreCache.js: line 65, col 4, Warning - Unexpected console statement.
./stores/_JSONStoreCache.js: line 73, col 5, Warning - Missing semicolon.
./stores/_JSONStoreCache.js: line 83, col 5, Warning - Unexpected console statement.
./stores/_JSONStoreCache.js: line 86, col 5, Warning - Unexpected console statement.
./stores/_JSONStoreCache.js: line 87, col 58, Warning - Missing semicolon.
./stores/_JSONStoreCache.js: line 88, col 67, Warning - Missing semicolon.
./stores/_JSONStoreCache.js: line 101, col 3, Warning - Unexpected console statement.
./stores/_JSONStoreCache.js: line 104, col 3, Warning - Unexpected console statement.
./stores/_JSONStoreCache.js: line 107, col 4, Warning - Unexpected console statement.
./stores/_JSONStoreCache.js: line 109, col 5, Warning - Unexpected console statement.
./stores/_JSONStoreCache.js: line 111, col 5, Warning - Unexpected console statement.
./stores/_JSONStoreCache.js: line 112, col 60, Warning - Missing semicolon.
./stores/_JSONStoreCache.js: line 112, col 107, Warning - Missing semicolon.
./stores/_JSONStoreCache.js: line 114, col 55, Warning - Missing semicolon.
./stores/_JSONStoreCache.js: line 114, col 102, Warning - Missing semicolon.
./stores/_JSONStoreCache.js: line 118, col 54, Warning - Missing semicolon.
./stores/_JSONStoreCache.js: line 118, col 101, Warning - Missing semicolon.
./stores/_JSONStoreCache.js: line 125, col 58, Warning - Missing semicolon.
./stores/_JSONStoreCache.js: line 126, col 55, Warning - Missing semicolon.
./stores/_JSONStoreCache.js: line 134, col 54, Warning - Missing semicolon.
./stores/_JSONStoreCache.js: line 135, col 41, Warning - Missing semicolon.
./stores/_JSONStoreCache.js: line 142, col 59, Warning - Missing semicolon.
./stores/_JSONStoreCache.js: line 143, col 40, Warning - Missing semicolon.

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.