-
Notifications
You must be signed in to change notification settings - Fork 7
Complete Upgrade: Babel 6 / React 0.14.x / Node 5.4/ react-transform-hmr / all dependencies are up to date #46
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| { | ||
| "presets": [ | ||
| "es2015", | ||
| "react" | ||
| ], | ||
| "plugins": [ | ||
| "transform-object-rest-spread" | ||
| ], | ||
| "env": { | ||
| "development": { | ||
| "plugins": [ | ||
| [ | ||
| "react-transform", | ||
| { | ||
| "transforms": [ | ||
| { | ||
| "transform": "react-transform-hmr", | ||
| "imports": ["react"], | ||
| "locals": ["module"] | ||
| }, { | ||
| "transform": "react-transform-catch-errors", | ||
| "imports": ["react", "redbox-react"] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| ] | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,10 +5,11 @@ environment: | |
| # https://github.com/FormidableLabs/converter-react/issues/34 | ||
| ROWDY_SETTINGS: "local.firefox" | ||
| matrix: | ||
| - nodejs_version: 0.10 | ||
| - nodejs_version: 0.12 | ||
| - nodejs_version: 4.stable | ||
| - nodejs_version: 5.4 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's leave at least |
||
|
|
||
| # Get the latest stable version of Node 0.STABLE.latest | ||
| # Get the latest stable version of Node 5.STABLE.latest | ||
| install: | ||
| - ps: Install-Product node $env:nodejs_version | ||
| # Install and use local, modern NPM | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,13 +6,15 @@ import { connect } from "react-redux"; | |
| import Input from "react-bootstrap/lib/Input"; | ||
| import { setConversionValue, fetchConversions } from "../actions/"; | ||
|
|
||
| const magicNum = 13; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| class UserInput extends React.Component { | ||
| onChange(ev) { | ||
| this.props.dispatch(setConversionValue(ev.target.value)); | ||
| } | ||
|
|
||
| onKeyDown(ev) { | ||
| if (ev.which === 13 /* Enter key */) { | ||
| if (ev.which === magicNum /* Enter key */) { | ||
| const store = this.props; | ||
| store.dispatch(fetchConversions(store.types, store.value)); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,15 +4,17 @@ | |
| import Promise from "bluebird"; | ||
| import "isomorphic-fetch"; | ||
|
|
||
| const api = { | ||
| BASE_URL: "", | ||
| const badRequest = 400; | ||
| const BASE_URL = "http://"; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to keep |
||
| const COLON_URL = ":"; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do these really need to be constents above? |
||
|
|
||
| const api = { | ||
| // Statefully set the base port and host (for server-side). | ||
| setBase: (host, port) => { | ||
| if (host) { | ||
| api.BASE_URL = "http://" + host; | ||
| api.BASE_URL = BASE_URL + host; | ||
| if (port) { | ||
| api.BASE_URL = api.BASE_URL + ":" + port; | ||
| api.BASE_URL = api.BASE_URL + COLON_URL + port; | ||
| } | ||
| } | ||
| }, | ||
|
|
@@ -22,7 +24,7 @@ const api = { | |
| Promise.all(types.split(",").map((type) => | ||
| fetch(`${api.BASE_URL}/api/${type}?from=${encodeURIComponent(value)}`) | ||
| .then((res) => { | ||
| if (res.status >= 400) { | ||
| if (res.status >= badRequest) { | ||
| throw new Error("Bad server response"); | ||
| } | ||
| return res.json(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,79 @@ | |
| * the test files one-off for just a single run. This is appropriate for a | ||
| * CI environment or if you're not otherwise running `npm run dev|hot`. | ||
| */ | ||
| var webpackCfg = require("./webpack.config.test"); | ||
| var path = require("path"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GLOBAL: Please try and undo all this copy and paste stuff and refactor to reuse webpack configs and share across karma like it was before. Thanks! |
||
| var webpack = require("webpack"); | ||
| var ExtractTextPlugin = require("extract-text-webpack-plugin"); | ||
|
|
||
|
|
||
| var HOT = { | ||
| presets: ["stage-2", "es2015", "react"], | ||
| plugins: [ | ||
| ["transform-runtime"], | ||
| ["react-transform", | ||
| { | ||
| transforms: [ | ||
| { | ||
| transform: "react-transform-hmr", | ||
| imports: ["react"], | ||
| locals: ["module"] | ||
| }, { | ||
| "transform": "react-transform-catch-errors", | ||
| "imports": ["react", "redbox-react"] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| ] | ||
| }; | ||
|
|
||
| var NORMAL = { | ||
| presets: ["stage-2", "es2015", "react"], | ||
| plugins: ["transform-runtime"] | ||
| }; | ||
|
|
||
|
|
||
| var webpackCfg = { | ||
| cache: true, | ||
| devtool: "source-map", | ||
| context: path.join(__dirname, "test/client"), | ||
| entry: "./main", | ||
| output: { | ||
| path: __dirname, | ||
| filename: "main.js", | ||
| publicPath: "/assets/" | ||
| }, | ||
| resolve: { | ||
| extensions: ["", ".js", ".jsx"], | ||
| alias: { | ||
| // Allow root import of `client/FOO` from ROOT/client. | ||
| client: path.join(__dirname, "client") | ||
| } | ||
| }, | ||
| module: { | ||
| loaders: [ | ||
| { | ||
| test: /\.jsx?$/, | ||
| exclude: [/node_modules/], | ||
| loader: "babel", | ||
| query: NORMAL | ||
| }, | ||
| { | ||
| test: /\.css$/, | ||
| loader: ExtractTextPlugin.extract("style-loader", "css-loader") | ||
| }, | ||
| { | ||
| test: /\.(png|svg|woff|woff2|ttf|eot)$/i, | ||
| loader: "url-loader?limit=10000" | ||
| } | ||
| ] | ||
| }, | ||
| plugins: [ | ||
| new ExtractTextPlugin("style.css", { | ||
| allChunks: true | ||
| }) | ||
| ] | ||
| }; | ||
|
|
||
| module.exports = function (config) { | ||
| // Start with the "dev" (webpack-dev-server is already running) config | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this an actual version? (Sorry if I led you astray, I was giving pseudocode in earlier comment)