acdlite / flummox-isomorphic-demo Goto Github PK
View Code? Open in Web Editor NEWDemo of how to create isomorphic apps using Flummox and react-router
Demo of how to create isomorphic apps using Flummox and react-router
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...
Using a Makefile excludes (to a degree) windows users - any way to get a gulp / npm script / etc instead of make?
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.
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)
Great stuff! Is there a reason you are not using FluxComponent in this sample?
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
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
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.