Git Product home page Git Product logo

kanso's Introduction

**NOTE: this project is no longer actively maintained and not recommended for use. It is left here for reference. **

Kanso

Simple, distributable JavaScript apps using CouchDB

Kanso Tools in action

Kanso is a set of tools and packages for creating JavaScript apps that run directly on CouchDB. Your app and related code can be easily packaged and shared with the community, or deployed to a number of cloud-hosted services.

The command-line tool is used for building and deploying these applications, as well as providing some useful utilities for working with CouchDB and JSON data.

Why develop apps with Kanso?

  • Scalability: easily grow from hobby-project to high-demand app with CouchDB
  • Deployment: effortless to deploy, to the cloud or local machines, promoting quick iterations
  • Multi-platform: runs anywhere with CouchDB (Windows, OSX, Linux, Android and iOS)
  • Keep your data yours: now you can keep sensitive data in-house, and avoid sharing it with cloud services
  • Easy to distribute: apps are easy to share and distribute, between people and servers
  • Avoid lock-in: easy to deploy and based on open-source, don't be held hostage to a proprietary API
  • Homogeneity: your development environment matches your production environment
  • One language to rule them all: with just CouchDB and the browser, all you need to speak is JavaScript!

Get started

sudo npm install -g kanso

Learn more: Simplest possible app

Developer community

Kanso is an open-source project written by developers using CouchApps everyday, in real-world projects. Kanso provides the tools to share code and resources, regardless of the way in which your app is built. It's easy to use coffee-script, less stylesheets, or any number of JavaScript frameworks in your app, and still benefit from the wealth of packages provided by the community.

Find other Kanso developers in #kansojs on FreeNode, or on the mailing list.

Find out more

For more information on the project, check out the Kanso website.

kanso's People

Contributors

alxndrsn avatar butterfill avatar chapel avatar endor avatar estellecomment avatar garethbowen avatar holaso avatar jhs avatar kika avatar mandric avatar mgmarino avatar mikewallace1979 avatar nolith avatar nrw avatar ozomer avatar pfiled avatar rgabo avatar romangeber avatar ryanramage avatar shammond42 avatar skiqh avatar smhoekstra avatar svadagir avatar thriqon avatar wombleton avatar

Stargazers

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

Watchers

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

kanso's Issues

Possible simplification of generated app

Hi!

Change lib/app.js to:

var kanso = require('kanso/core');

exports.rewrites = [
    {from: '/static/*', to: 'static/*'},
    {from: '/', to: '_show/welcome'}
];

exports.shows = {
    welcome: function (doc, req) {
        if (req.client) {
            var content = kanso.template('welcome.html', req, {});
            $('#content').html(content);
        }
        else {
            return kanso.template('base.html', req, {
                title: 'It worked!',
            });
        }
    }
};

In the base.html template remove {content|s} from the div#content element:

<div id="content"></div>

Regards

--Włodek Bzyl

500 template

If possible, catch errors from kanso show, list and update functions and render a default 500.html template (set in kanso.json, in the same way as 404's are handled).

Don't do this (or at least make it optional) if this means we loose useful information about the source of the error.

Is it possible to use jquery.couch.js with Kanso?

Hi!

jquery.couch.js implements openDoc, saveDoc, removeDoc, copyDoc, AllDocs and several other functions. Is it possible to use these functions with Kanso?

The kanso object already contains getDoc (implemented consistently with
nodejs functions). So, maybe, there are some plans to add these functions
to Kanso soon.

--Włodek Bzyl

not able to get out of the box

Installed node and kanso as per the tutotial and get this error trying to push app:

~/emacs/myblog:$ kanso push http://127.0.01:5984/myblog
kanso push http://127.0.01:5984/myblog
Error: TypeError: undefined is not a function
at CALL_NON_FUNCTION_AS_CONSTRUCTOR (native)
at Object.require (/usr/local/lib/node/kanso/lib/modules.js:191:17)
at Object.load (/usr/local/lib/node/kanso/lib/app.js:76:31)
at /usr/local/lib/node/kanso/lib/kanso.js:26:13
at /usr/local/lib/node/kanso/deps/async/lib/async.js:163:13
at /usr/local/lib/node/kanso/deps/async/lib/async.js:105:25
at /usr/local/lib/node/kanso/deps/async/lib/async.js:160:17
at /usr/local/lib/node/kanso/deps/async/lib/async.js:426:34
at /usr/local/lib/node/kanso/deps/async/lib/async.js:105:25
at /usr/local/lib/node/kanso/lib/modules.js:89:9
Failed

Error doing kanso push - path has no method normalizeArray - reminder

Hi, I'm doing a kanso push and getting this error:
I'm using nvm and I have installed kanso this way: npm install kanso.
Maybe this is the same error as issue #22
Thanks in advance.

aldonievas@macbookpro ~/Satio/Desarrollo/couchapp_env/mercado-kanso > nvm use v0.4.5
Now using node v0.4.5
aldonievas@macbookpro ~/Satio/Desarrollo/couchapp_env/mercado-kanso > kanso push http://localhost:5984/mercado-kanso
Error: TypeError: Object # has no method 'normalizeArray'
at Object.relpath (/Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/lib/utils.js:194:20)
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/lib/modules.js:67:29
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/lib/utils.js:146:20
at Array.filter (native)
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/lib/utils.js:145:29
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/lib/utils.js:110:25
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/deps/async/lib/async.js:163:13
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/deps/async/lib/async.js:105:25
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/deps/async/lib/async.js:160:17
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/lib/utils.js:116:13
Error: TypeError: Object # has no method 'normalizeArray'
at Object.relpath (/Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/lib/utils.js:194:20)
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/lib/templates.js:58:29
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/lib/utils.js:146:20
at Array.filter (native)
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/lib/utils.js:145:29
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/lib/utils.js:110:25
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/deps/async/lib/async.js:163:13
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/deps/async/lib/async.js:105:25
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/deps/async/lib/async.js:160:17
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/lib/utils.js:116:13
Error: TypeError: Object # has no method 'normalizeArray'
at Object.relpath (/Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/lib/utils.js:194:20)
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/lib/attachments.js:55:29
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/lib/utils.js:146:20
at Array.filter (native)
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/lib/utils.js:145:29
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/lib/utils.js:110:25
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/deps/async/lib/async.js:163:13
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/deps/async/lib/async.js:105:25
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/deps/async/lib/async.js:160:17
at /Users/aldonievas/.nvm/v0.4.5/lib/node/.npm/kanso/0.0.1/package/lib/utils.js:110:25
Failed

Remove History.js and drop hash state support?

If we implement better progressive enhancement of pages using the post-render hook the performance hit on older browsers which previously required hash state support might not be as bad. It would also reduce the amount of client-side JS that need to be pulled down before the first render and should simplify the code (depending on how different each browser's implementation of pushState is).

Pre and Post-render hooks

Currently, showing a loading spinner before loading the resources for the next view is a little awkward. Adding a 'before' and 'after' attribute to show, list and update functions would allow some more useful feedback for users. The 'before' stage can show loading information, the main function would then render the fall-back (basic main content) version, which can then be enhanced by the 'after' hook.

This has a few other advantages:

  1. It could reduce load time on initial hit by only running the 'after' stage instead of re-rendering the whole page client-side
  2. combined with the plan to reduce render function verbosity in issue #34 it could reduce the amount of repeated code, and
    forking based on the req.client property.

The downside is moving away from the traditional CouchDB API... using a helper function to wrap the normal API like kanso.page() or something would allow it to remain technically compatibile though.

Improve stack traces in the browser

Loading the code through eval means the browser cannot highlight the offending code in its source file, which can make debugging very difficult.

This could be improved by pre-wrapping the commonjs module code on "kanso push" and adding as an attachment rather than eval()'ing from the design document. This would increase the size of the app on the database but wouldn't increase the amount the client has to download, provided you can avoid fetching the design doc and just use the commonjs modules served as an attachment instead.

utils is not imported in create.js

$ kanso create recordstore
Error: ReferenceError: utils is not defined
at /usr/local/lib/node/kanso/lib/commands/create.js:20:9
at /usr/local/lib/node/kanso/deps/async/lib/async.js:163:13
at /usr/local/lib/node/kanso/deps/async/lib/async.js:105:25
at /usr/local/lib/node/kanso/deps/async/lib/async.js:160:17
at /usr/local/lib/node/kanso/deps/async/lib/async.js:426:34
at ChildProcess. (/usr/local/lib/node/kanso/lib/utils.js:293:13)
at ChildProcess.emit (events:34:17)
at Stream. (child_process:155:12)
at Stream.emit (events:31:17)
at Array. (net:1005:12)
Failed

after changing this:

var kanso = require('../kanso'),
logger = require('../logger');

to this:

var kanso = require('../kanso'),
logger = require('../logger'),
utils = require('../utils');

everything worked fine

Add middleware system

Currently the flashmessages implementation hooks into the core code before and after a list, show or update function has run. This is too tightly coupled and should be abstracted using somekind of middleware system. Then the flashmessages module could be removed from the core install and made into a contrib module.

http://kansojs.org/ -- 2 suggestion

Hi!

  1. The comment in the code in section kanso.json:
"name": "recordstore",        // the name of the app

is misleading. What about

"name": "recordstore",        // the name of the design doc document
  1. In the section The Recordstore I would like to see the code:
{ "docs": [
  {
    "type": "album",
    "title": "Blue Lines",
    "artist": "Massive Attack",
    "cover": "http://userserve-ak.last.fm/serve/174s/47527219.png"
  },
  {
    "type": "album",
    "title": "Mezzanine",
    "artist": "Massive Attack",
    "cover": "http://userserve-ak.last.fm/serve/174s/38150483.png"
  },
  {
    "type": "album",
    "artist": "Underworld",
    "title": "Beaucoup Fish",
    "cover": "http://userserve-ak.last.fm/serve/174s/41665159.png"
  }
]}

Then, you can suggest to insert the documents into the CouchDB with:

curl -X POST -H "Content-Type: application/json" \
  --data @albums.json http://127.0.0.1:5984/recordstore/_bulk_docs

(where file albums.josn contains the above JSON).

Thanks for very nice idea!

--Włodek Bzyl

Error when pushing to non-existent db

Sometimes, when pushing to a database that doesn't exist yet (kanso creates it) the following error is reported:

Error: ENOTCONN, Transport endpoint is not connected
    at Client._shutdownImpl (net:309:18)
    at Client._shutdown (net:1020:14)
    at Client.flush (net:798:12)
    at Client.end (net:1047:14)
    at IncomingMessage.<anonymous> (http:955:14)
    at IncomingMessage.emit (events:41:20)
    at HTTPParser.onMessageComplete (http:107:23)
    at Client.onData [as ondata] (http:848:27)
    at IOWatcher.callback (net:494:29)
    at node.js:773:9

Even though the push operation is successful!

Add autopush command

Watch files for changes and automatically push when detected. Saves developers having to constantly push the app manually to test out their changes.

Add push hooks

Run javascript hooks before push, hooks should be passed the parsed settings from kanso.json and the design_doc. Modifications should be passed to the next hook for processing. Hooks should be defined in kanso.json.

After all hooks have completed, the design_doc is pushed.

Comment on “Templates and list functions”

On the client side, getRow is no-op(?). So, kanso.template
is called with an empty array. So, the content contains empty list of artists:

exports.artists = function (head, req) {
    start({headers: {'Content-Type': 'text/html'}});
    var row, rows = [];
    while (row = getRow()) {
        rows.push(row);
    }
    // create a html list of artists
   var content = kanso.template('artists.html', req, {rows: rows});

Am I right?

--Włodek Bzyl

Cache invalidation for kanso.js file

When you push a new version of the app it might be a good idea to ensure the latest client-side code is used by generating a URL to fetch kanso.js. This could include the md5 of the file's content's or the time it was pushed. The URL for the kanso.js file could then be made available as a builtin template variable like baseURL.

Doesn't work on Cloudant / BigCouch

This is due to using relative paths with require(). This is a bug in BigCouch and has been reported. This Issue is only here as a reminder to check that the fix gets rolled out ;)

Use of reserved words as identifiers

In particular, commonjs/kanso/fields.js the permissions object uses delete as an identifier. Unlike other JS engines IE8 actually won't let you use reserved words like delete as identifier. I'm pretty sure that's the correct behavior too.

I'm just learning my way around your new 'types' feature so I'd rather not start renaming things on you, but if you'd like I can fork and give it a shot.

GET http://localhost:5984/_designdoc 400 Bad Request

Hi!

A fresh app generated with:

kanso create fresh
cd fresh
kanso push http://localhost:5984/fresh

yields 400 bad request error, whenever the following
url is visited:

http://localhost:5984/fresh/_design/fresh/_show/welcome

GET http://localhost:5984/_designdoc 400 Bad Request
{"error":"illegal_database_name",
 "reason":"Only lowercase characters (a-z), digits (0-9), 
      and any of the characters _, $, (, ), +, -, and / are allowed. 
      Must begin with a letter."}

But “rewritten” request:

http://localhost:4000/fresh/_design/fresh/_rewrite/

is OK.

Regards

--Włodek Bzyl

make install fails on OS X

This is the error output:
install --directory /usr/local/lib/node
install: illegal option -- -
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 file2
install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 ... fileN directory
install -d [-v] [-g group] [-m mode] [-o owner] directory ...
make: *** [install] Error 64
Looking through the Makefile I found some issues that caused it to not work.
install: build
install --directory $(NODEJSLIBDIR)
cp -a $(BUILDDIR)/kanso $(NODEJSLIBDIR)
install --mode=0755 $(BUILDDIR)/kanso.sh $(BINDIR)/kanso
The install --directory line just doesn't work at all. It is what is causing the error above. There was nothing I really could do to make that work.

The second install line failed due to --mode=0755, because on OS X it seems to need -m 0755, which worked. So doing the above commands sans the first install, I was able to manually install kanso and get it to work as far as I can tell.

Also I wonder why you didn't just use npm for this. All your submodules are in npm. I don't know the specifics of making that work, but I take it you do. Anyways food for thought.

I really like what you have done with kanso, and want to use it. It solves many issues I have had with making CouchApps, namely most of the logic in the client. So thank you for this, it should save me a lot of headaches.

Rewording list example

The last code example in “Templates and list functions” contains:

exports.rewrites = [
    {from: '/static/*', to: 'static/*'},
    {from: '/', to: '_list/artists/artists', query: {group: true}}
];

The piece _list/artists/artists is difficult to decode.
It takes time to realize, that the first word artists refers to name
of list function and the second artists – view name.

What about something more self-readable, for example:

{from: '/', to: '_list/all/artists', query: {group: true}}

--Włodek Bzyl

Superfluous client requests

Hi!

I added logging to the freshly generated lib/app.js:

var kanso = require('kanso/core');

exports.rewrites = [
    {from: '/static/*', to: 'static/*'},
    {from: '/', to: '_show/welcome'}
];

exports.shows = {
    welcome: function (doc, req) {
        var content = kanso.template('welcome.html', req, {});

        if (req.client) {
            console.log('CLIENT (BROWSER) REQUEST');
            console.log(req);
            $('#content').html(content);
            document.title = 'It worked!';
        }
        else {
            log('SERVER (APPLICATION) REQUEST');
            log(req);
            return kanso.template('base.html', req, {
                title: 'It worked!',
                content: content
            });
        }
    }
};

Now visiting:

http://localhost:4000/recordstore/_design/app/_rewrite/

reveals (in the couchdb log and the browser console) that
there was one server request and two client requests.

I think, that both client requests are superfluous
(or do not know under what circumstances client requests are created).

I also think, that setting the document title with

document.title = 'It worked!';

is superfluous too.

Regards

--Włodek Bzyl

Reworking the example code in the “Browser and server together” section

Two remarks:

  1. the result variable pops from nowhere
  2. further on the page you use the name content

So, my first suggestion is:

function example_show(doc, req) {
    var content = kanso.template('welcome.html', req, {});

    if (req.client) {
        // being run client-side, update the current page
        $('#main').html(content);
    }
    else {
        // fallback, returns a complete rendered page
        return kanso.template('base.html', req, {main: content});
    }
};

Whenever a user visits the page, the example_show function is run twice
(even if Javascript is disabled?).

The second time the req.client branch is chosen, and the content
of the #main is updated with the same content (and welcome template
is rendered twice, too). This does not make sense to me.
So, my second suggestion is:

function example_show(doc, req) {
    if (req.client) {
        // being run client-side
    }
    else {
        // fallback, returns a complete rendered page
        var content = kanso.template('welcome.html', req, {});
        return kanso.template('base.html', req, {main: content});
    }
}

But, that example does not make sense.

So, maybe, this example makes some sense:

function example_show(doc, req) {
    if (req.client) {
        // being run client-side: attach event handlers, ajaxify forms..
        require('lib/client').init();
    }
    else {
        // fallback, returns a complete rendered page
        var content = kanso.template('welcome.html', req, {});
        return kanso.template('base.html', req, {main: content});
    }
}

Regards

--Włodek Bzyl

Broken the latest version (+ node v0.4.0)

Hi!

The following sequence of commands:

kanso create xxx
cd xxx
kanso push http://localhost:5984/xxx

and visiting the page at:

http://localhost:4000/xxx/_design/xxx/_rewrite/

yields in the browser:

{"error":"render_error","reason":"function raised error: 
(new TypeError(\"kanso.template is not a function\", \"\", 10)) 
\nstacktrace: (null,[object Object])
@:10\napply([object Object],[object Object])
@:0\n(null,[object Object])@:0\napply([object Object],[object Array])
@:0\nrunShow(function () {return require(\"lib/app\").shows.welcome.apply(this, arguments);},[object Object],[object Array])
@/home/wbzyl/.nosql/share/couchdb/server/main.js:910\n(function () {return require(\"lib/app\").shows.welcome.apply(this, arguments);},[object Object],[object Array])
@/home/wbzyl/.nosql/share/couchdb/server/main.js:1013\napply(null,[object Array])
@:0\n(\"_design/xxx\",[object Array],[object Array])
@/home/wbzyl/.nosql/share/couchdb/server/main.js:1463\napply(null,[object Array])
@:0\n()
@/home/wbzyl/.nosql/share/couchdb/server/main.js:1506\n
@/home/wbzyl/.nosql/share/couchdb/server/main.js:1517\n"}

--Włodek Bzyl

404 template

Currently a 404 in a kanso app just pops up an unfriendly alert box. It should instead render a 404 template, which should be set in kanso.json and default to templates/404.html

EDIT: It might be simpler / more flexible to just add a catch-all rewrite rule the the project skeleton which renders a not_found show function

Reduce list, show and update verbosity

Currently, it's common to repeat the final rendering stage for couchdb and client-side:

if (req.client) {
    $('#content').html(content);
    window.title = 'some title';
}
else {
    return templates.render('base.html', req, {
        content: content,
        title: 'some title'
    });  
}

This could be reduced by providing a wrapper for list, show and update functions which wraps a function which returns an object containing the main content and a title, then doing the appropriate action for the environment.

Easy access to commonjs env for test suites and scripts

Currently Kanso's commonjs environment for apps is awkwardly bootstrapped for Kanso's own test suite. It would be nice to improve this and provide a simple API (perhaps a 'kanso run ...' command which will run a script in the context of the current app) for people to run test suites or scripts of their own.

Multiple form submits with same values ignored

The form submit is detected by kanso and it attempts to push the new state, but multiple pushStates with the same information are ignored by the browser. May need to add a unique identifier to requests, or manually trigger a popState event using the existing entry.

HTML5 template

Hi!

kanso create generates base.html which is an XHTML 1.0 template.
What about something simpler, for example HTML5:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>{title}</title> 
  </head> 
  <body> 
    <div id="content">
      {content|s}
    </div>
    <script src="{baseURL}/static/js/jquery-1.4.2.min.js"></script>
    <script src="{baseURL}/static/js/jquery.history.js"></script>
    <script>
        if (typeof JSON === 'undefined') {
            $.getScript("{baseURL}/static/js/json2.js", function () {
                $.getScript("{baseURL}/kanso.js");
            });
        }
        else {
            $.getScript("{baseURL}/kanso.js");
        }
    </script>
  </body>
</html>

Regards

--Włodek Bzyl

Add plural name property to Types for admin app

Currently there is support for display name for Type instances, it would also be useful to support a plural name for a Type definition. Consider a Type definition with the name 'activity', in the admin app it would sometimes be displayed as 'Activitys', which is wrong.

I think Django does something similar, allowing developers to set plural names for the admin interface.

npm (0.3.7) + node (0.4.1) + kanso (from the github repo) did not work together

Hi!

I tried the following:

git clone git://github.com/caolan/kanso.git
cd kanso
git submodule init
git submodule update
npm link .

with the following results:

...
npm info it worked if it ends with ok
/home/wbzyl/.node/lib/node/.npm/.cache/underscore/1.1.2/package.tgz
npm info shasum b65f8a4f3cd87c80598bbe66e2dea9f0a9705db3
npm info calculating sha1      /home/wbzyl/.node/lib/node/.npm/.cache/nodeunit/0.5.0/package.tgz
npm info shasum d24f5ab2cc930dbc58a0c83e1d26721bc2a0559c
npm ERR! couldn't read package.json in /tmp/npm-1298476856303/1298476857075-   0.22199632367119193/contents/package
npm ERR! Error installing [email protected]
npm ERR! error linking, rollback Error: Failed to parse json
npm ERR! error linking, rollback Unexpected token }
...

Full log: gist.

Regards

--Włodek Bzyl

Check session info when db module call results in a permissions error

When a call to a db module function results in a permissions error, it may be because the user's session has changed (perhaps it has timed out or they logged out in another window). In this case we should make a throttled call to /_session to see if the session information for the user has changed, allowing us to fire a sessionChange event.

Routing race condition

Currently, two clicks on URLs in quick succession set's up a race condition for the callbacks the relevant resources for each URL are fetched. If the former click returns later than the second the user will see the content they wanted briefly appear before being replaced by the content for their mistaken click.

Handle redirects from list and show functions

Currently, return values from list and show functions are ignored when run client-side. If these functions return a redirect, then the browser should respond by setting window.location to the new URL.

New events

Move the existing init and sessionChange functions to the 'events' namespace. Create an events module in the project skeleton and link to app.js. Add new events which fire before and after every request.

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.