- Immutable persistent data collections for JavaScript which increase efficiency and simplicity.
- Immutable cannot be changed once created
- Changes your life
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
TestRailsApp::Application.configure do | |
# Settings specified here will take precedence over those in config/environment.rb | |
# In development send *wp-bundle.js to the webpack-dev-server running on 8080 | |
config.action_controller.asset_host = Proc.new { |source| | |
if source =~ /wp_bundle\.js$/i | |
"http://localhost:8080" | |
end | |
} |
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 webpack = require('webpack'); | |
module.exports = { | |
// Set 'context' for Rails Asset Pipeline | |
context: __dirname + '/app/assets/javascripts', | |
entry: { | |
App: [ | |
'webpack-dev-server/client?http://localhost:8080/assets/', |
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
entry: { | |
App: [ | |
'webpack-dev-server/client?http://localhost:8080/assets/', | |
'webpack/hot/only-dev-server', | |
'./app.js' | |
] | |
}, |
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
output: { | |
filename: '[name]_wp_bundle.js', // Will output App_wp_bundle.js | |
path: __dirname + '/app/assets/javascripts', // Save to Rails Asset Pipeline | |
publicPath: 'http://localhost:8080/assets' // Required for webpack-dev-server | |
}, |
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
// Require the webpack and react-hot-loader plugins | |
plugins: [ | |
new webpack.HotModuleReplacementPlugin(), | |
new webpack.NoErrorsPlugin() | |
], |
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
resolve: { | |
extensions: ['', '.js', '.jsx'] | |
}, | |
module: { | |
// Load the react-hot-loader | |
loaders: [ { test: /\.jsx?$/, loaders: ['react-hot', 'jsx-loader'] } ] | |
} |
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
function getCurrentID(rowIndex) { | |
return { | |
currentID: RptStore.getCurrentID(), | |
lineCount: RptStore.getLineCount(rowIndex) | |
}; | |
} | |
var Row = React.createClass({ | |
getInitialState: function() { | |
return getCurrentID(this.props.rowIndex); |
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
> eslint app/assets/javascripts | |
app/assets/javascripts/APIUtils-test.js | |
21:1 error Unexpected blank line at end of file eol-last | |
✖ 1 problem (1 error, 0 warnings) | |
npm ERR! Darwin 14.0.0 |
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
'use strict'; | |
// Adapted from https://github.com/ColCh/jest-webpack/blob/f8e02b7a51da48c55395392e61d9c03789e43911/preprocessor.js | |
// Packages these tests with deps with webpack https://github.com/ninjapanzer/Backbone-Flux-React-Webpack/tree/master/__tests__ | |
var webpack = require('webpack'); | |
var MemoryFileSystem = require('memory-fs'); | |
var fs = new MemoryFileSystem(); |