optimizely / nuclear-js

Reactive Flux built with ImmutableJS data structures. Framework agnostic.
https://optimizely.github.io/nuclear-js/
MIT License
2.23k stars 141 forks source link

A few more examples fixes #156

Closed aldanor closed 9 years ago

aldanor commented 9 years ago

Updated package.json and READMEmd for shopping-cart and rest-api examples.

aldanor commented 9 years ago

There's a problem with isomorphic-flux-chat example though:

> nodemon server.bundle.js --watch server.bundle.js --watch client.bundle.js --watch index.html

19 Aug 21:55:38 - [nodemon] v1.4.1
19 Aug 21:55:38 - [nodemon] to restart at any time, enter `rs`
19 Aug 21:55:38 - [nodemon] watching: server.bundle.js client.bundle.js index.html
19 Aug 21:55:38 - [nodemon] starting `node server.bundle.js`
Listening on port 1337
Warning: React.addons.classSet will be deprecated in a future version. See http://fb.me/react-addons-classset
/Users/ivansmirnov/dev/forks/nuclear-js/examples/isomorphic-flux-chat/server.bundle.js:110
        var _state = JSON.stringify(reactor.__state.toJS());
                                                   ^
TypeError: Cannot read property 'toJS' of undefined
    at Server.<anonymous> (/Users/ivansmirnov/dev/forks/nuclear-js/examples/isomorphic-flux-chat/server.bundle.js:110:49)
    at Server.emit (events.js:110:17)
    at HTTPParser.parserOnIncoming [as onIncoming] (_http_server.js:491:12)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:111:23)
    at Socket.socketOnData (_http_server.js:343:22)
    at Socket.emit (events.js:107:17)
    at readableAddChunk (_stream_readable.js:163:16)
    at Socket.Readable.push (_stream_readable.js:126:10)
    at TCP.onread (net.js:538:20)
aldanor commented 9 years ago

Also, I'd suggest to remove *.bundle.js from examples and add them to .gitignore if you don't mind -- there's no point in keeping that in git.

bhamodi commented 9 years ago

LGTM. Thanks for doing this @aldanor.

I'll bring up the gitignore suggestion with @jordangarcia.

aldanor commented 9 years ago

@bhamodi Np. You may want to look at why the isomorphic example fails as well.

bhamodi commented 9 years ago

Yes, I think this might be the issue:

/**
 * Dehydrate reactor
 * @todo: refactor to use new nuclear methods when 1.1 lands ?
 */
 var _state = JSON.stringify(reactor.__state.toJS())
bhamodi commented 9 years ago

@aldanor - if you could open up a ticket with the stack trace that would be helpful! :) I'll look into it.

aldanor commented 9 years ago

@bhamodi #157