From 4a73ccbb00d6fa112bc8e0763dfceeade263033f Mon Sep 17 00:00:00 2001 From: Lukas Strassel Date: Wed, 8 Feb 2017 05:41:38 +0100 Subject: [PATCH] add react and react dom as peer (#1024) - tackles #997 - add ./idea to gitignore for webstorm users - update all the examples --- .gitignore | 5 +++++ examples/basic-css/package.json | 4 +++- examples/custom-server-express/package.json | 4 +++- examples/custom-server-hapi/package.json | 4 +++- examples/custom-server-koa/package.json | 4 +++- examples/custom-server/package.json | 4 +++- examples/data-fetch/package.json | 4 +++- examples/head-elements/package.json | 4 +++- examples/hello-world/package.json | 4 +++- examples/layout-component/package.json | 4 +++- examples/nested-components/package.json | 4 +++- examples/parameterized-routing/package.json | 4 +++- examples/progressive-render/package.json | 2 ++ examples/shared-modules/package.json | 4 +++- examples/ssr-caching/package.json | 4 +++- examples/using-inferno/package.json | 6 ++++-- examples/using-preact/package.json | 4 +++- examples/using-router/package.json | 4 +++- examples/with-amp/package.json | 4 +++- examples/with-aphrodite/package.json | 4 +++- examples/with-apollo/package.json | 2 ++ examples/with-custom-babel-config/package.json | 4 +++- examples/with-cxs/package.json | 4 +++- examples/with-fela/package.json | 4 +++- examples/with-flow/package.json | 12 +++++++----- examples/with-glamor/package.json | 4 +++- examples/with-jest/package.json | 4 +++- examples/with-loading/package.json | 4 +++- examples/with-mobx/package.json | 6 ++++-- examples/with-prefetching/package.json | 4 +++- examples/with-redux/package.json | 2 ++ examples/with-styled-components/package.json | 2 ++ examples/with-styled-jsx-postcss/package.json | 2 ++ examples/with-styletron/package.json | 2 ++ examples/with-universal-configuration/package.json | 4 +++- package.json | 10 +++++++--- server/build/babel/preset.js | 3 --- server/build/webpack.js | 3 --- 38 files changed, 114 insertions(+), 43 deletions(-) diff --git a/.gitignore b/.gitignore index 22a05c14..2b79f54c 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,8 @@ npm-debug.log # coverage .nyc_output coverage + +# editors +.idea/* +*.iml +*.sublime-* \ No newline at end of file diff --git a/examples/basic-css/package.json b/examples/basic-css/package.json index b24e6c71..59d0f89b 100644 --- a/examples/basic-css/package.json +++ b/examples/basic-css/package.json @@ -7,7 +7,9 @@ "start": "next start" }, "dependencies": { - "next": "^2.0.0-beta" + "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "author": "", "license": "ISC" diff --git a/examples/custom-server-express/package.json b/examples/custom-server-express/package.json index 77e3df45..03491bcb 100644 --- a/examples/custom-server-express/package.json +++ b/examples/custom-server-express/package.json @@ -6,6 +6,8 @@ }, "dependencies": { "express": "^4.14.0", - "next": "^2.0.0-beta" + "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2" } } diff --git a/examples/custom-server-hapi/package.json b/examples/custom-server-hapi/package.json index 19ffdd23..a3814be7 100644 --- a/examples/custom-server-hapi/package.json +++ b/examples/custom-server-hapi/package.json @@ -6,6 +6,8 @@ }, "dependencies": { "hapi": "^16.1.0", - "next": "^2.0.0-beta" + "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2" } } diff --git a/examples/custom-server-koa/package.json b/examples/custom-server-koa/package.json index 771717e9..652f8dc4 100644 --- a/examples/custom-server-koa/package.json +++ b/examples/custom-server-koa/package.json @@ -8,6 +8,8 @@ "dependencies": { "koa": "^1.2.4", "koa-router": "^5.4.0", - "next": "^2.0.0-beta" + "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2" } } diff --git a/examples/custom-server/package.json b/examples/custom-server/package.json index a22f7227..95271b1b 100644 --- a/examples/custom-server/package.json +++ b/examples/custom-server/package.json @@ -5,6 +5,8 @@ "start": "NODE_ENV=production node server.js" }, "dependencies": { - "next": "^2.0.0-beta" + "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2" } } diff --git a/examples/data-fetch/package.json b/examples/data-fetch/package.json index 359df917..fbe6c12f 100644 --- a/examples/data-fetch/package.json +++ b/examples/data-fetch/package.json @@ -8,7 +8,9 @@ }, "dependencies": { "isomorphic-fetch": "^2.2.1", - "next": "^2.0.0-beta" + "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "author": "", "license": "ISC" diff --git a/examples/head-elements/package.json b/examples/head-elements/package.json index c20935e5..3cb33e84 100644 --- a/examples/head-elements/package.json +++ b/examples/head-elements/package.json @@ -7,7 +7,9 @@ "start": "next start" }, "dependencies": { - "next": "*" + "next": "*", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "author": "", "license": "ISC" diff --git a/examples/hello-world/package.json b/examples/hello-world/package.json index 68eb6b41..a6b62c72 100644 --- a/examples/hello-world/package.json +++ b/examples/hello-world/package.json @@ -7,7 +7,9 @@ "start": "next start" }, "dependencies": { - "next": "*" + "next": "*", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "author": "", "license": "ISC" diff --git a/examples/layout-component/package.json b/examples/layout-component/package.json index 68eb6b41..a6b62c72 100644 --- a/examples/layout-component/package.json +++ b/examples/layout-component/package.json @@ -7,7 +7,9 @@ "start": "next start" }, "dependencies": { - "next": "*" + "next": "*", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "author": "", "license": "ISC" diff --git a/examples/nested-components/package.json b/examples/nested-components/package.json index 2cc5e80f..9169311b 100644 --- a/examples/nested-components/package.json +++ b/examples/nested-components/package.json @@ -7,7 +7,9 @@ "start": "next start" }, "dependencies": { - "next": "*" + "next": "*", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "author": "", "license": "ISC" diff --git a/examples/parameterized-routing/package.json b/examples/parameterized-routing/package.json index 1fdb797d..939a0361 100644 --- a/examples/parameterized-routing/package.json +++ b/examples/parameterized-routing/package.json @@ -6,6 +6,8 @@ }, "dependencies": { "next": "^2.0.0-beta", - "path-match": "1.2.4" + "path-match": "1.2.4", + "react": "^15.4.2", + "react-dom": "^15.4.2" } } diff --git a/examples/progressive-render/package.json b/examples/progressive-render/package.json index 7742195e..0163eb0c 100644 --- a/examples/progressive-render/package.json +++ b/examples/progressive-render/package.json @@ -7,6 +7,8 @@ }, "dependencies": { "next": "latest", + "react": "^15.4.2", + "react-dom": "^15.4.2", "react-no-ssr": "1.1.0" } } diff --git a/examples/shared-modules/package.json b/examples/shared-modules/package.json index 8d7c733d..5c0b6b7b 100644 --- a/examples/shared-modules/package.json +++ b/examples/shared-modules/package.json @@ -9,7 +9,9 @@ "start": "next start" }, "dependencies": { - "next": "*" + "next": "*", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "author": "", "license": "ISC" diff --git a/examples/ssr-caching/package.json b/examples/ssr-caching/package.json index 8b06c454..6928f6d7 100644 --- a/examples/ssr-caching/package.json +++ b/examples/ssr-caching/package.json @@ -7,6 +7,8 @@ "dependencies": { "express": "^4.14.0", "lru-cache": "^4.0.2", - "next": "^2.0.0-beta" + "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2" } } diff --git a/examples/using-inferno/package.json b/examples/using-inferno/package.json index 37ee7bfc..33cb11b9 100644 --- a/examples/using-inferno/package.json +++ b/examples/using-inferno/package.json @@ -7,9 +7,11 @@ "start": "next start" }, "dependencies": { - "next": "^2.0.0-beta", "inferno": "^1.0.7", - "inferno-compat": "^1.0.7" + "inferno-compat": "^1.0.7", + "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "author": "", "license": "MIT" diff --git a/examples/using-preact/package.json b/examples/using-preact/package.json index 7ffbdaf0..42201a4b 100644 --- a/examples/using-preact/package.json +++ b/examples/using-preact/package.json @@ -9,7 +9,9 @@ "dependencies": { "next": "^2.0.0-beta", "preact": "^7.1.0", - "preact-compat": "^3.9.4" + "preact-compat": "^3.9.4", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "author": "", "license": "ISC", diff --git a/examples/using-router/package.json b/examples/using-router/package.json index 1f7296cd..ae9636a4 100644 --- a/examples/using-router/package.json +++ b/examples/using-router/package.json @@ -9,7 +9,9 @@ "start": "next start" }, "dependencies": { - "next": "^2.0.0-beta" + "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "author": "", "license": "ISC" diff --git a/examples/with-amp/package.json b/examples/with-amp/package.json index 60382442..0403f735 100644 --- a/examples/with-amp/package.json +++ b/examples/with-amp/package.json @@ -7,7 +7,9 @@ "start": "next start" }, "dependencies": { - "next": "^2.0.0-beta" + "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "author": "", "license": "ISC" diff --git a/examples/with-aphrodite/package.json b/examples/with-aphrodite/package.json index 014e9759..aa0decb2 100644 --- a/examples/with-aphrodite/package.json +++ b/examples/with-aphrodite/package.json @@ -8,7 +8,9 @@ }, "dependencies": { "aphrodite": "^1.1.0", - "next": "^2.0.0-beta" + "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "author": "", "license": "ISC" diff --git a/examples/with-apollo/package.json b/examples/with-apollo/package.json index ddf439ff..4b42d210 100644 --- a/examples/with-apollo/package.json +++ b/examples/with-apollo/package.json @@ -11,7 +11,9 @@ "graphql": "^0.8.2", "graphql-tag": "^1.2.3", "next": "^2.0.0-beta", + "react": "^15.4.2", "react-apollo": "^0.8.1", + "react-dom": "^15.4.2", "react-redux": "^5.0.2", "redux": "^3.6.0", "redux-thunk": "^2.1.0" diff --git a/examples/with-custom-babel-config/package.json b/examples/with-custom-babel-config/package.json index 768618d0..a493a57f 100644 --- a/examples/with-custom-babel-config/package.json +++ b/examples/with-custom-babel-config/package.json @@ -9,7 +9,9 @@ "start": "next start" }, "dependencies": { - "next": "^2.0.0-beta" + "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "author": "", "license": "ISC", diff --git a/examples/with-cxs/package.json b/examples/with-cxs/package.json index 4e86cacb..ec995903 100644 --- a/examples/with-cxs/package.json +++ b/examples/with-cxs/package.json @@ -8,7 +8,9 @@ }, "dependencies": { "cxs": "^3.0.0", - "next": "^2.0.0-beta" + "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "author": "", "license": "ISC" diff --git a/examples/with-fela/package.json b/examples/with-fela/package.json index ff56591b..ddd6c97d 100644 --- a/examples/with-fela/package.json +++ b/examples/with-fela/package.json @@ -9,6 +9,8 @@ "dependencies": { "fela": "^4.1.2", "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2", "react-fela": "^4.1.2" } -} \ No newline at end of file +} diff --git a/examples/with-flow/package.json b/examples/with-flow/package.json index 3adf8c39..c3482a54 100644 --- a/examples/with-flow/package.json +++ b/examples/with-flow/package.json @@ -1,20 +1,22 @@ { "name": "with-flow", - "version": "1.0.0", + "version": "1.0.0", "license": "MIT", "author": "Jag Reehal", "scripts": { "dev": "next", "build": "next build", - "flow": "flow", + "flow": "flow", "start": "next start" }, "dependencies": { - "next": "^2.0.0-beta" + "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "devDependencies": { "babel-eslint": "^7.1.1", - "babel-plugin-transform-flow-strip-types": "^6.21.0", + "babel-plugin-transform-flow-strip-types": "^6.21.0", "flow-bin": "^0.37.4" } -} \ No newline at end of file +} diff --git a/examples/with-glamor/package.json b/examples/with-glamor/package.json index ebab099c..e82ad61f 100644 --- a/examples/with-glamor/package.json +++ b/examples/with-glamor/package.json @@ -8,7 +8,9 @@ }, "dependencies": { "glamor": "^2.20.12", - "next": "^2.0.0-beta" + "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "author": "", "license": "ISC" diff --git a/examples/with-jest/package.json b/examples/with-jest/package.json index 9d234ef9..8d709c11 100644 --- a/examples/with-jest/package.json +++ b/examples/with-jest/package.json @@ -1,7 +1,9 @@ { "name": "with-jest", "dependencies": { - "next": "^2.0.0-beta" + "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "scripts": { "test": "jest", diff --git a/examples/with-loading/package.json b/examples/with-loading/package.json index 0408a7b2..46768edb 100644 --- a/examples/with-loading/package.json +++ b/examples/with-loading/package.json @@ -10,7 +10,9 @@ }, "dependencies": { "next": "^2.0.0-beta", - "nprogress": "^0.2.0" + "nprogress": "^0.2.0", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "author": "", "license": "ISC" diff --git a/examples/with-mobx/package.json b/examples/with-mobx/package.json index b7fda296..034bbb3f 100644 --- a/examples/with-mobx/package.json +++ b/examples/with-mobx/package.json @@ -9,11 +9,13 @@ "dependencies": { "mobx": "^2.7.0", "mobx-react": "^4.0.4", - "next": "^2.0.0-beta" + "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "author": "", "license": "ISC", "devDependencies": { "babel-plugin-transform-decorators-legacy": "^1.3.4" } -} \ No newline at end of file +} diff --git a/examples/with-prefetching/package.json b/examples/with-prefetching/package.json index be4d27b3..ff4aff2f 100644 --- a/examples/with-prefetching/package.json +++ b/examples/with-prefetching/package.json @@ -7,7 +7,9 @@ "start": "next start" }, "dependencies": { - "next": "^2.0.0-beta" + "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "author": "", "license": "ISC" diff --git a/examples/with-redux/package.json b/examples/with-redux/package.json index 14ca195e..63e767f5 100644 --- a/examples/with-redux/package.json +++ b/examples/with-redux/package.json @@ -8,6 +8,8 @@ }, "dependencies": { "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2", "react-redux": "^5.0.1", "redux": "^3.6.0", "redux-thunk": "^2.1.0" diff --git a/examples/with-styled-components/package.json b/examples/with-styled-components/package.json index bf36188f..e639fbf2 100644 --- a/examples/with-styled-components/package.json +++ b/examples/with-styled-components/package.json @@ -8,6 +8,8 @@ }, "dependencies": { "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2", "styled-components": "1.2.1" }, "author": "", diff --git a/examples/with-styled-jsx-postcss/package.json b/examples/with-styled-jsx-postcss/package.json index 2cc6f51f..de7f8e72 100644 --- a/examples/with-styled-jsx-postcss/package.json +++ b/examples/with-styled-jsx-postcss/package.json @@ -9,6 +9,8 @@ "dependencies": { "next": "^2.0.0-beta", "postcss-cssnext": "^2.9.0", + "react": "^15.4.2", + "react-dom": "^15.4.2", "styled-jsx-postcss": "^0.1.5" }, "author": "Giuseppe Gurgone", diff --git a/examples/with-styletron/package.json b/examples/with-styletron/package.json index 4853f9f2..c606d30f 100644 --- a/examples/with-styletron/package.json +++ b/examples/with-styletron/package.json @@ -8,6 +8,8 @@ }, "dependencies": { "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2", "styletron-client": "^2.2.0", "styletron-react": "^2.2.1", "styletron-server": "^2.2.0" diff --git a/examples/with-universal-configuration/package.json b/examples/with-universal-configuration/package.json index 88e3be23..b0d3ca3b 100644 --- a/examples/with-universal-configuration/package.json +++ b/examples/with-universal-configuration/package.json @@ -7,7 +7,9 @@ "start": "next start" }, "dependencies": { - "next": "^2.0.0-beta" + "next": "^2.0.0-beta", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "devDependencies": { "babel-plugin-transform-define": "^1.2.0" diff --git a/package.json b/package.json index 4fccbd6f..9c334b3f 100644 --- a/package.json +++ b/package.json @@ -72,8 +72,6 @@ "mz": "2.6.0", "path-match": "1.2.4", "pkg-up": "1.0.0", - "react": "15.4.2", - "react-dom": "15.4.2", "react-hot-loader": "3.0.0-beta.6", "send": "0.14.1", "source-map-support": "0.4.11", @@ -110,7 +108,13 @@ "standard": "8.6.0", "wd": "^1.1.3", "webpack-stream": "3.2.0", - "cross-env": "^3.1.4" + "cross-env": "^3.1.4", + "react": "15.4.2", + "react-dom": "15.4.2" + }, + "peerDependencies": { + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "jest": { "testEnvironment": "node", diff --git a/server/build/babel/preset.js b/server/build/babel/preset.js index b0354dac..c1f2289b 100644 --- a/server/build/babel/preset.js +++ b/server/build/babel/preset.js @@ -18,9 +18,6 @@ module.exports = { { alias: { 'babel-runtime': babelRuntimePath, - react: require.resolve('react'), - 'react-dom': require.resolve('react-dom'), - 'react-dom/server': require.resolve('react-dom/server'), 'next/link': require.resolve('../../../lib/link'), 'next/prefetch': require.resolve('../../../lib/prefetch'), 'next/css': require.resolve('../../../lib/css'), diff --git a/server/build/webpack.js b/server/build/webpack.js index eb8c9297..4e2406a9 100644 --- a/server/build/webpack.js +++ b/server/build/webpack.js @@ -173,9 +173,6 @@ export default async function createCompiler (dir, { dev = false, quiet = false { alias: { 'babel-runtime': babelRuntimePath, - react: require.resolve('react'), - 'react-dom': require.resolve('react-dom'), - 'react-dom/server': require.resolve('react-dom/server'), 'next/link': require.resolve('../../lib/link'), 'next/prefetch': require.resolve('../../lib/prefetch'), 'next/css': require.resolve('../../lib/css'),