This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var socketio = require('socket.io'); | |
var EE = require('events').EventEmitter; | |
var react = require('gulp-react'); | |
var io = socketio.listen('3002', function (err, msg) { | |
if (err) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'socketio', | |
'#allCollections', | |
'#allCSS', | |
'#hotReload', | |
'app/js/cssAdder' | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//app/js/meta/allViews.js | |
define([ | |
"app/js/jsx/BaseView", | |
"app/js/jsx/reactComponents/FluxCart", | |
"app/js/jsx/reactComponents/FluxCartApp", | |
"app/js/jsx/reactComponents/FluxProduct", | |
"app/js/jsx/reactComponents/Item", | |
"app/js/jsx/reactComponents/Job", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define( | |
[ | |
'*windowPatches', | |
'*backbonePatches', | |
'*jsPatches', | |
'observe', | |
'backbone', | |
'jquery', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the # and @ notation is mine just to identify certain modules as my own and to make it easier to grep for things | |
// as you can see in the bottom of the file, RequireJS loads all dependencies in app/js/application before starting the app | |
// so if you put #allViews, #allCSS and #allTemplates as dependencies of your app/js/application module then this allows us to preload certain dependences so that we can later use *synchronous* require calls | |
// the synchronous require calls will allow us to do hot reloading with React and Backbone. We *could* make the render functions asynchronous, but there are two problems with that | |
// one problem is that Backbone conventions recommend returning 'this' from render(), the second is that React needs you return a valid React component from render, so render has to be synchronous | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function () { | |
var hotReloadSimple = function (item, callback) { | |
require.undef(item); //delete cache representing module; this means the next require call to the same module will then have to pull the module from filesystem | |
require([item], function (module) { //load the file asynchronously, because the cache has been deleted | |
callback(null, module); | |
}); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'react', | |
'app/js/jsx/reactComponents/Service' // this 'child view' needs to be loaded before calling render on ServiceChooser, so that we can require it synchronously in the render function | |
'require' | |
], | |
function (React, Service, require) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by amills001c on 6/15/15. | |
*/ | |
//logging | |
//config | |
var config = require('univ-config')('*SC-Admin*', 'config/conf'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by amills001c on 8/18/15. | |
*/ | |
function getAll(Model, modelName, filterObject, req, res, next, cb) { | |
if (!Model) { | |
Model = req.site.models[modelName]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
“Hot-reloading in 2015:” @the1mills https://medium.com/@the1mills/hot-reloading-with-react-requirejs-7b2aa6cb06e1 |
OlderNewer