GithubHelp home page GithubHelp logo

acdlite / flummox-isomorphic-demo Goto Github PK

View Code? Open in Web Editor NEW
89.0 89.0 19.0 757 KB

Demo of how to create isomorphic apps using Flummox and react-router

Makefile 6.94% JavaScript 89.38% HTML 3.68%

flummox-isomorphic-demo's Issues

Duplicate API requests

This is probably a more generic Flux question, but with getter actions how do you handle async race conditions?

E.g. an action is dispatched twice, both times the action contacts a (slow) REST API and you need to make sure that the last dispatched action supercedes the first so that a single
successHandler/failureHandler is invoked.

getting error running 'make watch'

I get the following running 'make watch' on a Ubuntu VirtualBox VM with io.js v1.6.1

...
webpack: bundle is now VALID.
Hash: 7a439141e7093b062723
Version: webpack 1.5.3
Time: 7111ms
Asset Size Chunks Chunk Names
app.min.js 316521 0 [emitted] main
+ 224 hidden modules
nodemon lib/server/app.js
26 Mar 15:28:22 - [nodemon] v1.3.7
26 Mar 15:28:22 - [nodemon] to restart at any time, enter rs
26 Mar 15:28:22 - [nodemon] watching: .
26 Mar 15:28:22 - [nodemon] starting node --harmony lib/server/app.js

/home/johnsz/shared/code/react/flummox-isomorphic-demo/node_modules/koa/lib/application.js:174
function *respond(next) {
^
SyntaxError: Unexpected token *
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (../../src/server/app.js:7:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
26 Mar 15:28:22 - [nodemon] app crashed - waiting for file changes before starting...

errors running demo

I had do to npm install -g nodemon to get 'make watch' to work.

Once I did that the demo app crashed because of a missing module: Error: Cannot find module 'source-map-support'

Once I installed source-map-support with npm that was solved butI got the following error

.../flummox-isomorphic-demo/node_modules/koa/lib/application.js:174
function *respond(next) {
^
SyntaxError: Unexpected token *
at Module._compile (module.js:439:25)

Action creators

Can you add an example of dispatching an action from a component? An usual user interaction, like clicking on a button or something. I didn't quite get it how you do that with flummox

Makefile ?

Using a Makefile excludes (to a degree) windows users - any way to get a gulp / npm script / etc instead of make?

FluxComponent

Great stuff! Is there a reason you are not using FluxComponent in this sample?

`performRouteHandlerStaticMethod` doesn't work with decorators

await performRouteHandlerStaticMethod(state.routes, 'routerWillRun', routeHandlerInfo)

export default async function performRouteHandlerStaticMethod(routes, methodName, ...args) {
  return Promise.all(routes
    .map(route => {route.handler[methodName]; console.log(route, route.handler)})
    .filter(method => typeof method === 'function')
    .map(method => method(...args))
  );
}

This doesn't work when you use decorators around your components. E.g. I wrapped my components when using react-dnd and route.handler is the DragAndDropContainer.

Is their a better approach?

make watch error

I cloned this repo and run make watch. Got the error below:

/test-project/node_modules/koa/lib/application.js:174
function *respond(next) {
^
SyntaxError: Unexpected token *
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (../../src/server/app.js:7:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
5 Apr 15:38:07 - [nodemon] app crashed - waiting for file changes before starting...

My node version is v0.12.2

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.