From 912fadb9af6207707a6132e64496a12260097c13 Mon Sep 17 00:00:00 2001 From: Steven Luscher Date: Fri, 4 Mar 2016 03:30:09 -0800 Subject: [PATCH] Update site builder Summary: Closes https://github.com/facebook/relay/pull/905 Differential Revision: D3011398 Pulled By: steveluscher fb-gh-sync-id: b096f497e09b829c612c08344e40755b4a037918 shipit-source-id: b096f497e09b829c612c08344e40755b4a037918 --- website-prototyping-tools/RelayPlayground.js | 9 +++++---- website-prototyping-tools/evalSchema.js | 4 ++-- website-prototyping-tools/graphiql.js | 2 +- website-prototyping-tools/package.json | 17 ++++++++++------- website-prototyping-tools/playground.js | 2 +- website-prototyping-tools/webpack.config.js | 5 +++++ 6 files changed, 24 insertions(+), 15 deletions(-) diff --git a/website-prototyping-tools/RelayPlayground.js b/website-prototyping-tools/RelayPlayground.js index b5303e9bade18..27b81d3c54e1e 100644 --- a/website-prototyping-tools/RelayPlayground.js +++ b/website-prototyping-tools/RelayPlayground.js @@ -14,11 +14,11 @@ import 'codemirror/mode/javascript/javascript'; import Codemirror from 'react-codemirror'; import React from 'react'; -import ReactDOM from 'react/lib/ReactDOM'; +import ReactChildren from 'react-children'; +import ReactDOM from 'react-dom'; import Relay from 'react-relay'; window.Relay = Relay; import RelayLocalSchema from 'relay-local-schema'; -import babel from 'babel-core/browser'; import babelRelayPlaygroundPlugin from './babelRelayPlaygroundPlugin'; import debounce from 'lodash.debounce'; import defer from 'lodash.defer'; @@ -26,6 +26,7 @@ import errorCatcher from 'babel-plugin-react-error-catcher/error-catcher'; import errorCatcherPlugin from 'babel-plugin-react-error-catcher'; import evalSchema from './evalSchema'; import getBabelRelayPlugin from 'babel-relay-plugin'; +import {transform} from 'babel-core'; import {introspectionQuery} from 'graphql/utilities'; import {graphql} from 'graphql'; @@ -96,7 +97,7 @@ class PlaygroundRenderer extends React.Component { } catch (e) {} } _update = () => { - ReactDOM.render(React.Children.only(this.props.children), this._container); + ReactDOM.render(ReactChildren.only(this.props.children), this._container); } render() { return
; @@ -216,7 +217,7 @@ export default class RelayPlayground extends React.Component { } }; try { - var {code} = babel.transform(appSource, { + var {code} = transform(appSource, { filename: 'RelayPlayground', plugins : [ babelRelayPlaygroundPlugin, diff --git a/website-prototyping-tools/evalSchema.js b/website-prototyping-tools/evalSchema.js index c8d4b812f2ae9..ba085f4983452 100644 --- a/website-prototyping-tools/evalSchema.js +++ b/website-prototyping-tools/evalSchema.js @@ -9,7 +9,7 @@ /* eslint-disable no-unused-vars, no-eval */ -import babel from 'babel-core/browser'; +import {transform} from 'babel-core'; var GraphQL = require('graphql'); var GraphQLRelay = require('graphql-relay'); @@ -24,6 +24,6 @@ export default function(source) { default: throw new Error(`Cannot find module "${path}"`); } } - var {code} = babel.transform(source, {code: true, ast: false}); + var {code} = transform(source, {ast: false, code: true}); return eval(code); } diff --git a/website-prototyping-tools/graphiql.js b/website-prototyping-tools/graphiql.js index b5854662cb792..bd1b6b133a7a0 100644 --- a/website-prototyping-tools/graphiql.js +++ b/website-prototyping-tools/graphiql.js @@ -12,7 +12,7 @@ import 'graphiql/graphiql.css'; import GraphiQL from 'graphiql'; import React from 'react'; window.React = React; -import ReactDOM from 'react/lib/ReactDOM'; +import ReactDOM from 'react-dom'; import evalSchema from './evalSchema'; import queryString from 'querystring'; diff --git a/website-prototyping-tools/package.json b/website-prototyping-tools/package.json index 5b176ddceedb6..6874d9ffd1d06 100644 --- a/website-prototyping-tools/package.json +++ b/website-prototyping-tools/package.json @@ -7,13 +7,13 @@ "license": "BSD-3-Clause", "dependencies": { "autoprefixer-loader": "3.1.0", - "babel": "5.8.23", - "babel-core": "5.8.25", - "babel-loader": "5.3.2", - "babel-plugin-react-error-catcher": "1.1.9", + "babel-core": "^5.8.35", + "babel-loader": "^5.4.0", + "babel-plugin-react-error-catcher": "^1.1.11", "babel-relay-plugin": "../scripts/babel-relay-plugin", "codemirror": "5.6.0", "css-loader": "0.16.0", + "fbjs": "^0.7.2", "file-loader": "0.8.4", "graphiql": "0.1.3", "graphql": "0.4.13", @@ -27,12 +27,15 @@ "normalize.css": "3.0.3", "querystring": "0.2.0", "raw-loader": "0.5.1", - "react": "^0.14.0-rc", + "react": "^0.14.7", + "react-children": "0.0.3", "react-codemirror": "0.1.5", - "relay-local-schema": "0.3.0", + "react-dom": "^0.14.7", "react-relay": "../", + "react-universal": "0.0.3", + "relay-local-schema": "0.3.0", "style-loader": "0.12.3", - "webpack": "1.12.0" + "webpack": "^1.12.14" }, "scripts": { "start": "webpack --watch --progress --colors", diff --git a/website-prototyping-tools/playground.js b/website-prototyping-tools/playground.js index dc080c0e09ca9..2ea5b27025114 100644 --- a/website-prototyping-tools/playground.js +++ b/website-prototyping-tools/playground.js @@ -10,7 +10,7 @@ import 'babel/polyfill'; import React from 'react'; window.React = React; -import ReactDOM from 'react/lib/ReactDOM'; +import ReactDOM from 'react-dom'; import RelayPlayground from './RelayPlayground'; import filterObject from 'fbjs/lib/filterObject'; diff --git a/website-prototyping-tools/webpack.config.js b/website-prototyping-tools/webpack.config.js index 8cd64ee115af8..786fa8b1a454e 100644 --- a/website-prototyping-tools/webpack.config.js +++ b/website-prototyping-tools/webpack.config.js @@ -42,6 +42,11 @@ module.exports = { }, ], }, + node: { + fs: 'empty', + module: 'empty', + net: 'empty', + }, output: { path: path.resolve(__dirname, '../website', BUILD_DIR, 'relay/prototyping'), filename: '[name].js',