Skip to content

Instantly share code, notes, and snippets.

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
}
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/',
entry: {
App: [
'webpack-dev-server/client?http://localhost:8080/assets/',
'webpack/hot/only-dev-server',
'./app.js'
]
},
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
},
// Require the webpack and react-hot-loader plugins
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
resolve: {
extensions: ['', '.js', '.jsx']
},
module: {
// Load the react-hot-loader
loaders: [ { test: /\.jsx?$/, loaders: ['react-hot', 'jsx-loader'] } ]
}
function getCurrentID(rowIndex) {
return {
currentID: RptStore.getCurrentID(),
lineCount: RptStore.getLineCount(rowIndex)
};
}
var Row = React.createClass({
getInitialState: function() {
return getCurrentID(this.props.rowIndex);
> 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
'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();
@kevinold
kevinold / talk.md
Last active August 29, 2015 14:21
Immutable.js talk for NashJS - May 2015

Immutable.js

Kevin Old - @kevinold

Elevator pitch

  • Immutable persistent data collections for JavaScript which increase efficiency and simplicity.
  • Immutable cannot be changed once created
  • Changes your life