diff --git a/.eslintrc b/.eslintrc index 78354d1e..a51454ef 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,7 +1,18 @@ { + "extends": [ + "fbjs" + ], "plugins": [ "prettier", "react" ], "parser": "babel-eslint", -} \ No newline at end of file + "rules": { + "relay/graphql-naming": 0, + "max-len": 0 + }, + "env": { + "node": true, + "browser": true + } +} diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 5930f2b8..00000000 --- a/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2013-present, Facebook, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index aa23cacf..b5c09a5c 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ This repo contains the source code and documentation powering [reactjs.org](http ### Installation 1. `cd reactjs.org` to go into the project root -1. `yarn` to install the website's NPM dependencies +1. `yarn` to install the website's npm dependencies ### Running locally diff --git a/content/blog/2017-04-07-react-v15.5.0.md b/content/blog/2017-04-07-react-v15.5.0.md index eea84664..7a61d6e8 100644 --- a/content/blog/2017-04-07-react-v15.5.0.md +++ b/content/blog/2017-04-07-react-v15.5.0.md @@ -113,8 +113,8 @@ We're discontinuing active maintenance of React Addons packages. In truth, most - **react-addons-create-fragment** – React 16 will have first-class support for fragments, at which point this package won't be necessary. We recommend using arrays of keyed elements instead. - **react-addons-css-transition-group** - Use [react-transition-group/CSSTransitionGroup](https://github.com/reactjs/react-transition-group) instead. Version 1.1.1 provides a drop-in replacement. - **react-addons-linked-state-mixin** - Explicitly set the `value` and `onChange` handler instead. -- **react-addons-pure-render-mixin** - Use [`React.PureComponent`](/docs/react-api.html#react.purecomponent) instead. -- **react-addons-shallow-compare** - Use [`React.PureComponent`](/docs/react-api.html#react.purecomponent) instead. +- **react-addons-pure-render-mixin** - Use [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) instead. +- **react-addons-shallow-compare** - Use [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) instead. - **react-addons-transition-group** - Use [react-transition-group/TransitionGroup](https://github.com/reactjs/react-transition-group) instead. Version 1.1.1 provides a drop-in replacement. - **react-addons-update** - Use [immutability-helper](https://github.com/kolodny/immutability-helper) instead, a drop-in replacement. - **react-linked-input** - Explicitly set the `value` and `onChange` handler instead. diff --git a/content/blog/2017-09-08-dom-attributes-in-react-16.md b/content/blog/2017-09-08-dom-attributes-in-react-16.md index a8ded510..b8953997 100644 --- a/content/blog/2017-09-08-dom-attributes-in-react-16.md +++ b/content/blog/2017-09-08-dom-attributes-in-react-16.md @@ -163,7 +163,7 @@ Below is a detailed list of them. ``` React 15: Converts `NaN`s to strings and passes them through. - React 16: Warns and ignores them. + React 16: Converts `NaN`s to strings and passes them through with a warning. While testing this release, we have also [created an automatically generated table](https://github.com/facebook/react/blob/master/fixtures/attribute-behavior/AttributeTableSnapshot.md) for all known attributes to track potential regressions. diff --git a/content/blog/2017-09-26-react-v16.0.md b/content/blog/2017-09-26-react-v16.0.md index 9636e8f3..a2416036 100644 --- a/content/blog/2017-09-26-react-v16.0.md +++ b/content/blog/2017-09-26-react-v16.0.md @@ -151,7 +151,7 @@ Refer to the previous announcement for [suggestions on how to migrate](/blog/201 React 16 includes a number of small breaking changes. These only affect uncommon use cases and we don't expect them to break most apps. * React 15 had limited, undocumented support for error boundaries using `unstable_handleError`. This method has been renamed to `componentDidCatch`. You can use a codemod to [automatically migrate to the new API](https://github.com/reactjs/react-codemod#error-boundaries). -* `ReactDOM.render` and `ReactDOM.unstable_renderIntoContainer` now return null if called from inside a lifecycle method. To work around this, you can use [portals](https://github.com/facebook/react/issues/10309#issuecomment-318433235) or [refs](https://github.com/facebook/react/issues/10309#issuecomment-318434635). +* `ReactDOM.render` and `ReactDOM.unstable_renderSubtreeIntoContainer` now return null if called from inside a lifecycle method. To work around this, you can use [portals](https://github.com/facebook/react/issues/10309#issuecomment-318433235) or [refs](https://github.com/facebook/react/issues/10309#issuecomment-318434635). * `setState`: * Calling `setState` with null no longer triggers an update. This allows you to decide in an updater function if you want to re-render. * Calling `setState` directly in render always causes an update. This was not previously the case. Regardless, you should not be calling setState from render. diff --git a/content/docs/accessibility.md b/content/docs/accessibility.md index 77cc52df..84578951 100644 --- a/content/docs/accessibility.md +++ b/content/docs/accessibility.md @@ -263,7 +263,7 @@ VoiceOver is an integrated screen reader on Apple devices. Refer to the following guides on how activate and use VoiceOver: - [WebAIM - Using VoiceOver to Evaluate Web Accessibility](http://webaim.org/articles/voiceover/) -- [Deque - VoiceOver for OSX Keyboard Shortcuts](https://dequeuniversity.com/screenreaders/voiceover-keyboard-shortcuts) +- [Deque - VoiceOver for OS X Keyboard Shortcuts](https://dequeuniversity.com/screenreaders/voiceover-keyboard-shortcuts) - [Deque - VoiceOver for iOS Shortcuts](https://dequeuniversity.com/screenreaders/voiceover-ios-shortcuts) #### JAWS in Internet Explorer diff --git a/content/docs/addons-pure-render-mixin.md b/content/docs/addons-pure-render-mixin.md index 03cd2e02..c6230586 100644 --- a/content/docs/addons-pure-render-mixin.md +++ b/content/docs/addons-pure-render-mixin.md @@ -8,7 +8,7 @@ category: Add-Ons > Note: > -> `PureRenderMixin` is a legacy add-on. Use [`React.PureComponent`](/docs/react-api.html#react.purecomponent) instead. +> `PureRenderMixin` is a legacy add-on. Use [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) instead. **Importing** diff --git a/content/docs/addons-shallow-compare.md b/content/docs/addons-shallow-compare.md index 8845d387..90f0c1d1 100644 --- a/content/docs/addons-shallow-compare.md +++ b/content/docs/addons-shallow-compare.md @@ -8,7 +8,7 @@ category: Reference > Note: > -> `shallowCompare` is a legacy add-on. Use [`React.PureComponent`](/docs/react-api.html#react.purecomponent) instead. +> `shallowCompare` is a legacy add-on. Use [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) instead. **Importing** @@ -19,7 +19,7 @@ var shallowCompare = require('react-addons-shallow-compare'); // ES5 with npm ## Overview -Before [`React.PureComponent`](/docs/react-api.html#react.purecomponent) was introduced, `shallowCompare` was commonly used to achieve the same functionality as [`PureRenderMixin`](pure-render-mixin.html) while using ES6 classes with React. +Before [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) was introduced, `shallowCompare` was commonly used to achieve the same functionality as [`PureRenderMixin`](pure-render-mixin.html) while using ES6 classes with React. If your React component's render function is "pure" (in other words, it renders the same result given the same props and state), you can use this helper function for a performance boost in some cases. diff --git a/content/docs/addons-test-utils.md b/content/docs/addons-test-utils.md index fc482e19..68bb48dc 100644 --- a/content/docs/addons-test-utils.md +++ b/content/docs/addons-test-utils.md @@ -112,6 +112,10 @@ mockComponent( Pass a mocked component module to this method to augment it with useful methods that allow it to be used as a dummy React component. Instead of rendering as usual, the component will become a simple `
` (or other tag if `mockTagName` is provided) containing any provided children. +> Note: +> +> `mockComponent()` is a legacy API. We recommend using [shallow rendering](/docs/test-utils.html#shallow-rendering) or [`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock) instead. + * * * ### `isElement()` diff --git a/content/docs/addons.md b/content/docs/addons.md index 374bedab..fdbce295 100644 --- a/content/docs/addons.md +++ b/content/docs/addons.md @@ -21,8 +21,8 @@ The add-ons below are in the development (unminified) version of React only: The add-ons below are considered legacy and their use is discouraged. They will keep working in observable future, but there is no further development. -- [`PureRenderMixin`](pure-render-mixin.html). Use [`React.PureComponent`](/docs/react-api.html#react.purecomponent) instead. -- [`shallowCompare`](shallow-compare.html), a helper function that performs a shallow comparison for props and state in a component to decide if a component should update. +- [`PureRenderMixin`](pure-render-mixin.html). Use [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) instead. +- [`shallowCompare`](shallow-compare.html), a helper function that performs a shallow comparison for props and state in a component to decide if a component should update. We recommend using [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) instead. - [`update`](update.html). Use [`kolodny/immutability-helper`](https://github.com/kolodny/immutability-helper) instead. - [`ReactDOMFactories`](dom-factories.html), pre-configured DOM factories to make React easier to use without JSX. diff --git a/content/docs/handling-events.md b/content/docs/handling-events.md index e1ea2d3c..4077e45d 100644 --- a/content/docs/handling-events.md +++ b/content/docs/handling-events.md @@ -139,3 +139,16 @@ class LoggingButton extends React.Component { ``` The problem with this syntax is that a different callback is created each time the `LoggingButton` renders. In most cases, this is fine. However, if this callback is passed as a prop to lower components, those components might do an extra re-rendering. We generally recommend binding in the constructor or using the class fields syntax, to avoid this sort of performance problem. + +## Passing Arguments to Event Handlers + +Inside a loop it is common to want to pass an extra parameter to an event handler. For example, if `id` is the row ID, either of the following would work: + +```js + + +``` + +The above two lines are equivalent, and use [arrow functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions) and [`Function.prototype.bind`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/Function/bind) respectively. + +In both cases, the `e` argument representing the React event will be passed as a second argument after the ID. With an arrow function, we have to pass it explicitly, but with `bind` any further arguments are automatically forwarded. diff --git a/content/docs/how-to-contribute.md b/content/docs/how-to-contribute.md index ff97aec5..e514a948 100644 --- a/content/docs/how-to-contribute.md +++ b/content/docs/how-to-contribute.md @@ -95,7 +95,7 @@ In order to accept your pull request, we need you to submit a CLA. You only need ### Contribution Prerequisites -* You have `node` installed at v4.0.0+ and `npm` at v2.0.0+. +* You have `node` installed at v6.0.0+ and `npm` at v3.0.0+. * You have `gcc` installed or are comfortable installing a compiler if needed. Some of our `npm` dependencies may require a compilation step. On OS X, the Xcode Command Line Tools will cover this. On Ubuntu, `apt-get install build-essential` will install the required packages. Similar commands should work on other Linux distros. Windows will require some additional steps, see the [`node-gyp` installation instructions](https://github.com/nodejs/node-gyp#installation) for details. * You are familiar with `npm` and know whether or not you need to use `sudo` when installing packages globally. * You are familiar with `git`. @@ -118,7 +118,7 @@ First, run `npm run build`. This will produce pre-built bundles in `build` folde The easiest way to try your changes is to run `npm run build` and then open `fixtures/packaging/babel-standalone/dev.html`. This file already uses `react.js` from the `build` folder so it will pick up your changes. -If you want to try your changes in your existing React project, you may copy `build/umd/react.development.js`, `build/umd/react-dom.development.js`, or any other build products into your app and use them instead of the stable version. If your project uses React from npm, you may delete `react` and `react-dom` in its dependencies and use `npm link` to point them to your local `build` folder: +If you want to try your changes in your existing React project, you may copy `build/dist/react.development.js`, `build/dist/react-dom.development.js`, or any other build products into your app and use them instead of the stable version. If your project uses React from npm, you may delete `react` and `react-dom` in its dependencies and use `npm link` to point them to your local `build` folder: ```sh cd your_project diff --git a/content/docs/jsx-in-depth.md b/content/docs/jsx-in-depth.md index 7acc3289..fafbe64d 100644 --- a/content/docs/jsx-in-depth.md +++ b/content/docs/jsx-in-depth.md @@ -308,7 +308,19 @@ You can mix together different types of children, so you can use string literals
``` -A React component can't return multiple React elements, but a single JSX expression can have multiple children, so if you want a component to render multiple things you can wrap it in a `div` like this. +A React component can also return an array of elements: + +```js +render() { + // No need to wrap list items in an extra element! + return [ + // Don't forget the keys :) +
  • First item
  • , +
  • Second item
  • , +
  • Third item
  • , + ]; +} +``` ### JavaScript Expressions as Children diff --git a/content/docs/lifting-state-up.md b/content/docs/lifting-state-up.md index e7beb98e..43cb7db8 100644 --- a/content/docs/lifting-state-up.md +++ b/content/docs/lifting-state-up.md @@ -166,6 +166,7 @@ class TemperatureInput extends React.Component { render() { const temperature = this.state.temperature; + // ... ``` However, we want these two inputs to be in sync with each other. When we update the Celsius input, the Fahrenheit input should reflect the converted temperature, and vice versa. @@ -182,6 +183,7 @@ First, we will replace `this.state.temperature` with `this.props.temperature` in render() { // Before: const temperature = this.state.temperature; const temperature = this.props.temperature; + // ... ``` We know that [props are read-only](/docs/components-and-props.html#props-are-read-only). When the `temperature` was in the local state, the `TemperatureInput` could just call `this.setState()` to change it. However, now that the `temperature` is coming from the parent as a prop, the `TemperatureInput` has no control over it. @@ -194,6 +196,7 @@ Now, when the `TemperatureInput` wants to update its temperature, it calls `this handleChange(e) { // Before: this.setState({temperature: e.target.value}); this.props.onTemperatureChange(e.target.value); + // ... ``` >Note: diff --git a/content/docs/reconciliation.md b/content/docs/reconciliation.md index ce0bfb26..6a23282c 100644 --- a/content/docs/reconciliation.md +++ b/content/docs/reconciliation.md @@ -142,9 +142,9 @@ As a last resort, you can pass item's index in the array as a key. This can work ## Tradeoffs -It is important to remember that the reconciliation algorithm is an implementation detail. React could rerender the whole app on every action; the end result would be the same. We are regularly refining the heuristics in order to make common use cases faster. +It is important to remember that the reconciliation algorithm is an implementation detail. React could rerender the whole app on every action; the end result would be the same. Just to be clear, rerender in this context means calling `render` for all components, it doesn't mean React will unmount and remount them. It will only apply the differences following the rules stated in the previous sections. -In the current implementation, you can express the fact that a subtree has been moved amongst its siblings, but you cannot tell that it has moved somewhere else. The algorithm will rerender that full subtree. +We are regularly refining the heuristics in order to make common use cases faster. In the current implementation, you can express the fact that a subtree has been moved amongst its siblings, but you cannot tell that it has moved somewhere else. The algorithm will rerender that full subtree. Because React relies on heuristics, if the assumptions behind them are not met, performance will suffer. diff --git a/content/docs/reference-dom-elements.md b/content/docs/reference-dom-elements.md index 025cf3dd..fb010ca6 100644 --- a/content/docs/reference-dom-elements.md +++ b/content/docs/reference-dom-elements.md @@ -88,6 +88,22 @@ function ComponentWithTransition() { Style keys are camelCased in order to be consistent with accessing the properties on DOM nodes from JS (e.g. `node.style.backgroundImage`). Vendor prefixes [other than `ms`](http://www.andismith.com/blog/2012/02/modernizr-prefixed/) should begin with a capital letter. This is why `WebkitTransition` has an uppercase "W". +React will automatically append a "px" suffix to certain inline style properties. For example: + +```js +// This: +
    + Hello World! +
    ; + +// Becomes: +
    + Hello World! +
    +``` + +Not all style properties are converted to pixel strings though. Certain ones remain unitless (eg `zoom`, `order`, `flex`). A complete list of unitless properties can be seen [here](https://github.com/facebook/react/blob/4131af3e4bf52f3a003537ec95a1655147c81270/src/renderers/dom/shared/CSSProperty.js#L15-L59). + ### suppressContentEditableWarning Normally, there is a warning when an element with children is also marked as `contentEditable`, because it won't work. This attribute suppresses that warning. Don't use this unless you are building a library like [Draft.js](https://facebook.github.io/draft-js/) that manages `contentEditable` manually. diff --git a/content/docs/reference-pure-render-mixin.md b/content/docs/reference-pure-render-mixin.md index a68357bc..6da08e31 100644 --- a/content/docs/reference-pure-render-mixin.md +++ b/content/docs/reference-pure-render-mixin.md @@ -8,7 +8,7 @@ permalink: docs/pure-render-mixin.html > Note -> The `PureRenderMixin` mixin predates `React.PureComponent`. This reference doc is provided for legacy purposes, and you should consider using [`React.PureComponent`](/docs/react-api.html#react.purecomponent) instead. +> The `PureRenderMixin` mixin predates `React.PureComponent`. This reference doc is provided for legacy purposes, and you should consider using [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) instead. If your React component's render function renders the same result given the same props and state, you can use this mixin for a performance boost in some cases. diff --git a/content/docs/reference-react-component.md b/content/docs/reference-react-component.md index 24d5f6ff..a91183da 100644 --- a/content/docs/reference-react-component.md +++ b/content/docs/reference-react-component.md @@ -204,7 +204,7 @@ Returning `false` does not prevent child components from re-rendering when *thei Currently, if `shouldComponentUpdate()` returns `false`, then [`componentWillUpdate()`](#componentwillupdate), [`render()`](#render), and [`componentDidUpdate()`](#componentdidupdate) will not be invoked. Note that in the future React may treat `shouldComponentUpdate()` as a hint rather than a strict directive, and returning `false` may still result in a re-rendering of the component. -If you determine a specific component is slow after profiling, you may change it to inherit from [`React.PureComponent`](/docs/react-api.html#react.purecomponent) which implements `shouldComponentUpdate()` with a shallow prop and state comparison. If you are confident you want to write it by hand, you may compare `this.props` with `nextProps` and `this.state` with `nextState` and return `false` to tell React the update can be skipped. +If you determine a specific component is slow after profiling, you may change it to inherit from [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) which implements `shouldComponentUpdate()` with a shallow prop and state comparison. If you are confident you want to write it by hand, you may compare `this.props` with `nextProps` and `this.state` with `nextState` and return `false` to tell React the update can be skipped. * * * diff --git a/content/docs/reference-react-dom-server.md b/content/docs/reference-react-dom-server.md index cf5ff2d3..cb88a7d5 100644 --- a/content/docs/reference-react-dom-server.md +++ b/content/docs/reference-react-dom-server.md @@ -49,7 +49,9 @@ If you call [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) on a node that ReactDOMServer.renderToStaticMarkup(element) ``` -Similar to [`renderToString`](#rendertostring), except this doesn't create extra DOM attributes such as `data-reactid`, that React uses internally. This is useful if you want to use React as a simple static page generator, as stripping away the extra attributes can save lots of bytes. +Similar to [`renderToString`](#rendertostring), except this doesn't create extra DOM attributes that React uses internally, such as `data-reactroot`. This is useful if you want to use React as a simple static page generator, as stripping away the extra attributes can save some bytes. + +If you plan to use React on the client to make the markup interactive, do not use this method. Instead, use [`renderToString`](#rendertostring) on the server and [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) on the client. * * * @@ -59,10 +61,12 @@ Similar to [`renderToString`](#rendertostring), except this doesn't create extra ReactDOMNodeStream.renderToNodeStream(element) ``` -Render a React element to its initial HTML. Returns a [Readable stream](https://nodejs.org/api/stream.html#stream_readable_streams) that outputs an HTML string. The HTML output by this stream is exactly equal to what [`ReactDOMServer.renderToString`](#rendertostring) would return. +Render a React element to its initial HTML. Returns a [Readable stream](https://nodejs.org/api/stream.html#stream_readable_streams) that outputs an HTML string. The HTML output by this stream is exactly equal to what [`ReactDOMServer.renderToString`](#rendertostring) would return. You can use this method to generate HTML on the server and send the markup down on the initial request for faster page loads and to allow search engines to crawl your pages for SEO purposes. + +If you call [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) on a node that already has this server-rendered markup, React will preserve it and only attach event handlers, allowing you to have a very performant first-load experience. > Note: -> +> > Server-only. This API is not available in the browser. > > The stream returned from this method will return a byte stream encoded in utf-8. If you need a stream in another encoding, take a look a project like [iconv-lite](https://www.npmjs.com/package/iconv-lite), which provides transform streams for transcoding text. @@ -75,10 +79,14 @@ Render a React element to its initial HTML. Returns a [Readable stream](https:// ReactDOMNodeStream.renderToStaticNodeStream(element) ``` -Similar to [`renderToNodeStream`](#rendertonodestream), except this doesn't create extra DOM attributes such as `data-reactid`, that React uses internally. The HTML output by this stream is exactly equal to what [`ReactDOMServer.renderToStaticMarkup`](#rendertostaticmarkup) would return. +Similar to [`renderToNodeStream`](#rendertonodestream), except this doesn't create extra DOM attributes that React uses internally, such as `data-reactroot`. This is useful if you want to use React as a simple static page generator, as stripping away the extra attributes can save some bytes. + +The HTML output by this stream is exactly equal to what [`ReactDOMServer.renderToStaticMarkup`](#rendertostaticmarkup) would return. + +If you plan to use React on the client to make the markup interactive, do not use this method. Instead, use [`renderToNodeStream`](#rendertonodestream) on the server and [`ReactDOM.hydrate()`](/docs/react-dom.html#hydrate) on the client. > Note: > > Server-only. This API is not available in the browser. -> +> > The stream returned from this method will return a byte stream encoded in utf-8. If you need a stream in another encoding, take a look a project like [iconv-lite](https://www.npmjs.com/package/iconv-lite), which provides transform streams for transcoding text. diff --git a/content/docs/reference-react.md b/content/docs/reference-react.md index f12dbdde..95a0ab49 100644 --- a/content/docs/reference-react.md +++ b/content/docs/reference-react.md @@ -176,7 +176,11 @@ Returns the total number of components in `children`, equal to the number of tim React.Children.only(children) ``` -Returns the only child in `children`. Throws otherwise. +Verifies that `children` has only one child (a React element) and returns it. Otherwise this method throws. + +> Note: +> +>`React.Children.only()` does not accept the return value of [`React.Children.map()`](#reactchildrenmap) because it is an array rather than a React element. #### `React.Children.toArray` diff --git a/content/docs/reference-test-renderer.md b/content/docs/reference-test-renderer.md index 75f75f01..4c6bcfc4 100644 --- a/content/docs/reference-test-renderer.md +++ b/content/docs/reference-test-renderer.md @@ -158,7 +158,7 @@ Returns the root "test instance" object that is useful for making assertions abo testInstance.find(test) ``` -Find the first descendant test instance for which `test(testInstance)` returns `true`. +Find a single descendant test instance for which `test(testInstance)` returns `true`. If `test(testInstance)` does not return `true` for exactly one test instance, it will throw an error. ### `testInstance.findByType()` @@ -166,7 +166,7 @@ Find the first descendant test instance for which `test(testInstance)` returns ` testInstance.findByType(type) ``` -Find the first descendant test instance with the provided `type`. +Find a single descendant test instance with the provided `type`. If there is not exactly one test instance with the provided `type`, it will throw an error. ### `testInstance.findByProps()` @@ -174,7 +174,7 @@ Find the first descendant test instance with the provided `type`. testInstance.findByProps(props) ``` -Find the first descendant test instance with the provided `props`. +Find a single descendant test instance with the provided `props`. If there is not exactly one test instance with the provided `props`, it will throw an error. ### `testInstance.findAll()` diff --git a/content/docs/thinking-in-react.md b/content/docs/thinking-in-react.md index 8f3786d8..53caa2b2 100644 --- a/content/docs/thinking-in-react.md +++ b/content/docs/thinking-in-react.md @@ -82,7 +82,7 @@ There are two types of "model" data in React: props and state. It's important to To make your UI interactive, you need to be able to trigger changes to your underlying data model. React makes this easy with **state**. -To build your app correctly, you first need to think of the minimal set of mutable state that your app needs. The key here is DRY: *Don't Repeat Yourself*. Figure out the absolute minimal representation of the state your application needs and compute everything else you need on-demand. For example, if you're building a TODO list, just keep an array of the TODO items around; don't keep a separate state variable for the count. Instead, when you want to render the TODO count, simply take the length of the TODO items array. +To build your app correctly, you first need to think of the minimal set of mutable state that your app needs. The key here is [DRY: *Don't Repeat Yourself*](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself). Figure out the absolute minimal representation of the state your application needs and compute everything else you need on-demand. For example, if you're building a TODO list, just keep an array of the TODO items around; don't keep a separate state variable for the count. Instead, when you want to render the TODO count, simply take the length of the TODO items array. Think of all of the pieces of data in our example application. We have: diff --git a/content/tutorial/tutorial.md b/content/tutorial/tutorial.md index c38344fd..16be5c8b 100644 --- a/content/tutorial/tutorial.md +++ b/content/tutorial/tutorial.md @@ -1090,7 +1090,7 @@ Check out the final result here: [Final Result](https://codepen.io/gaearon/pen/g If you have extra time or want to practice your new skills, here are some ideas for improvements you could make, listed in order of increasing difficulty: -1. Display the move locations in the format "(1, 3)" instead of "6". +1. Display the move locations in the format "(1, 3)" in the move list. 2. Bold the currently selected item in the move list. 3. Rewrite Board to use two loops to make the squares instead of hardcoding them. 4. Add a toggle button that lets you sort the moves in either ascending or descending order. diff --git a/content/warnings/refs-must-have-owner.md b/content/warnings/refs-must-have-owner.md index 2fca7ff9..2a03a57b 100644 --- a/content/warnings/refs-must-have-owner.md +++ b/content/warnings/refs-must-have-owner.md @@ -19,7 +19,7 @@ You are probably here because you got one of the following error messages: This usually means one of two things: - You are trying to add a `ref` to an element that is being created outside of a component's render() function. -- You have multiple (conflicting) copies of React loaded (eg. due to a misconfigured NPM dependency) +- You have multiple (conflicting) copies of React loaded (eg. due to a misconfigured npm dependency) ## Invalid Refs @@ -28,6 +28,6 @@ Only a ReactOwner can have refs. This usually means that you're trying to add a ## Multiple copies of React -Bower does a good job of deduplicating dependencies, but NPM does not. If you aren't doing anything (fancy) with refs, there is a good chance that the problem is not with your refs, but rather an issue with having multiple copies of React loaded into your project. Sometimes, when you pull in a third-party module via npm, you will get a duplicate copy of the dependency library, and this can create problems. +Bower does a good job of deduplicating dependencies, but npm does not. If you aren't doing anything (fancy) with refs, there is a good chance that the problem is not with your refs, but rather an issue with having multiple copies of React loaded into your project. Sometimes, when you pull in a third-party module via npm, you will get a duplicate copy of the dependency library, and this can create problems. If you are using npm... `npm ls` or `npm ls react` might help illuminate. diff --git a/gatsby-config.js b/gatsby-config.js index b1469a55..029197a3 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/gatsby-node.js b/gatsby-node.js index 56f83aed..0fc10c4f 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/package.json b/package.json index 13be6a02..1d214c9f 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,14 @@ "array-from": "^2.1.1", "babel-eslint": "^8.0.1", "eslint": "^4.8.0", + "eslint-config-fbjs": "^2.0.0", "eslint-config-react": "^1.1.7", - "eslint-plugin-flowtype": "^2.37.0", + "eslint-plugin-babel": "^4.1.2", + "eslint-plugin-flowtype": "^2.39.1", + "eslint-plugin-jsx-a11y": "^6.0.2", "eslint-plugin-prettier": "^2.3.1", "eslint-plugin-react": "^7.4.0", + "eslint-plugin-relay": "^0.0.19", "flow-bin": "^0.56.0", "gatsby": "^1.9.9", "gatsby-link": "^1.6.9", @@ -69,10 +73,12 @@ "scripts": { "build": "gatsby build", "check-all": "yarn prettier && yarn lint && yarn flow", + "ci-check": "yarn prettier:diff && yarn lint && yarn flow", "dev": "gatsby develop -H 0.0.0.0", "lint": "eslint .", "netlify": "yarn install && yarn build", "prettier": "prettier --config .prettierrc --write '{flow-typed,plugins,src}/**/*.js'", + "prettier:diff": "prettier --config .prettierrc --list-different '{flow-typed,plugins,src}/**/*.js'", "reset": "rimraf ./.cache" }, "devDependencies": { diff --git a/src/components/CodeEditor/CodeEditor.js b/src/components/CodeEditor/CodeEditor.js index 7a932f79..cfe88135 100644 --- a/src/components/CodeEditor/CodeEditor.js +++ b/src/components/CodeEditor/CodeEditor.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/CodeEditor/index.js b/src/components/CodeEditor/index.js index 4bc2ed71..74799777 100644 --- a/src/components/CodeEditor/index.js +++ b/src/components/CodeEditor/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/Container/Container.js b/src/components/Container/Container.js index 266fa066..7a458faf 100644 --- a/src/components/Container/Container.js +++ b/src/components/Container/Container.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core * @flow */ diff --git a/src/components/Container/index.js b/src/components/Container/index.js index d146cf6b..6a609558 100644 --- a/src/components/Container/index.js +++ b/src/components/Container/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/ErrorDecoder/ErrorDecoder.js b/src/components/ErrorDecoder/ErrorDecoder.js index da1f03c1..3e638d61 100644 --- a/src/components/ErrorDecoder/ErrorDecoder.js +++ b/src/components/ErrorDecoder/ErrorDecoder.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/ErrorDecoder/index.js b/src/components/ErrorDecoder/index.js index b034c178..68931622 100644 --- a/src/components/ErrorDecoder/index.js +++ b/src/components/ErrorDecoder/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/Flex/Flex.js b/src/components/Flex/Flex.js index 30d2d97e..6acc11e6 100644 --- a/src/components/Flex/Flex.js +++ b/src/components/Flex/Flex.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/Flex/index.js b/src/components/Flex/index.js index 5d9eaeab..1ec92e45 100644 --- a/src/components/Flex/index.js +++ b/src/components/Flex/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/Header/Header.js b/src/components/Header/Header.js index 0e69fff6..75ac9531 100644 --- a/src/components/Header/Header.js +++ b/src/components/Header/Header.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/Header/index.js b/src/components/Header/index.js index 787c1500..57114581 100644 --- a/src/components/Header/index.js +++ b/src/components/Header/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/LayoutFooter/ExternalFooterLink.js b/src/components/LayoutFooter/ExternalFooterLink.js index 876ab8a1..04632fda 100644 --- a/src/components/LayoutFooter/ExternalFooterLink.js +++ b/src/components/LayoutFooter/ExternalFooterLink.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/LayoutFooter/Footer.js b/src/components/LayoutFooter/Footer.js index 42d40d60..673534fe 100644 --- a/src/components/LayoutFooter/Footer.js +++ b/src/components/LayoutFooter/Footer.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/LayoutFooter/FooterLink.js b/src/components/LayoutFooter/FooterLink.js index ed676817..9969309e 100644 --- a/src/components/LayoutFooter/FooterLink.js +++ b/src/components/LayoutFooter/FooterLink.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/LayoutFooter/FooterNav.js b/src/components/LayoutFooter/FooterNav.js index 83049145..b3861b42 100644 --- a/src/components/LayoutFooter/FooterNav.js +++ b/src/components/LayoutFooter/FooterNav.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/LayoutFooter/index.js b/src/components/LayoutFooter/index.js index ebcf8ba8..42db340a 100644 --- a/src/components/LayoutFooter/index.js +++ b/src/components/LayoutFooter/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/LayoutHeader/Header.js b/src/components/LayoutHeader/Header.js index 467b956e..48037360 100644 --- a/src/components/LayoutHeader/Header.js +++ b/src/components/LayoutHeader/Header.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/LayoutHeader/HeaderLink.js b/src/components/LayoutHeader/HeaderLink.js index aa43c040..6ad92ca5 100644 --- a/src/components/LayoutHeader/HeaderLink.js +++ b/src/components/LayoutHeader/HeaderLink.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/LayoutHeader/SearchSvg.js b/src/components/LayoutHeader/SearchSvg.js index 2c388449..af88d5a6 100644 --- a/src/components/LayoutHeader/SearchSvg.js +++ b/src/components/LayoutHeader/SearchSvg.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/LayoutHeader/index.js b/src/components/LayoutHeader/index.js index 787c1500..57114581 100644 --- a/src/components/LayoutHeader/index.js +++ b/src/components/LayoutHeader/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/MarkdownHeader/MarkdownHeader.js b/src/components/MarkdownHeader/MarkdownHeader.js index d27e35bd..1b7a8da8 100644 --- a/src/components/MarkdownHeader/MarkdownHeader.js +++ b/src/components/MarkdownHeader/MarkdownHeader.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/MarkdownHeader/index.js b/src/components/MarkdownHeader/index.js index b0c79f19..c338ea60 100644 --- a/src/components/MarkdownHeader/index.js +++ b/src/components/MarkdownHeader/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/MarkdownPage/MarkdownPage.js b/src/components/MarkdownPage/MarkdownPage.js index 56f62b10..c71a90f4 100644 --- a/src/components/MarkdownPage/MarkdownPage.js +++ b/src/components/MarkdownPage/MarkdownPage.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/MarkdownPage/index.js b/src/components/MarkdownPage/index.js index 45b06413..589ca08e 100644 --- a/src/components/MarkdownPage/index.js +++ b/src/components/MarkdownPage/index.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js b/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js index d92e6ab9..13b2ec6c 100644 --- a/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js +++ b/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ @@ -126,7 +123,7 @@ class StickyResponsiveSidebar extends Component { }, [media.greaterThan('small')]: { - tranform: 'none !important', + transform: 'none !important', }, }}> @@ -147,7 +144,9 @@ class StickyResponsiveSidebar extends Component { boxShadow: '0 0 20px rgba(0, 0, 0, 0.3)', [media.lessThan('small')]: smallScreenBottomBarStyles, }} - onClick={this._openNavMenu}> + onClick={this._openNavMenu} + role="button" + tabIndex={0}>
    ( +const MetaTitle = ({children, title, cssProps = {}, onDark = false}) => (
    (
    - + - {section.title} - + {section.title} + - + [media.lessThan('small')]: { + display: 'none', + }, + }} + /> + +
      { } } else if (item.id.includes('html')) { return location.pathname.includes(item.id); - } else { - const slugId = location.pathname.split('/').slice(-1)[0]; - return slugId === slugify(item.id); } + const slugId = location.pathname.split('/').slice(-1)[0]; + return slugId === slugify(item.id); }; export default isItemActive; diff --git a/src/utils/mountCodeExample.js b/src/utils/mountCodeExample.js index 71914409..a7ebece8 100644 --- a/src/utils/mountCodeExample.js +++ b/src/utils/mountCodeExample.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/utils/sectionList.js b/src/utils/sectionList.js index 49106215..b7cb8ae4 100644 --- a/src/utils/sectionList.js +++ b/src/utils/sectionList.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/utils/slugify.js b/src/utils/slugify.js index f13ecc38..9b509ec8 100644 --- a/src/utils/slugify.js +++ b/src/utils/slugify.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/src/utils/toCommaSeparatedList.js b/src/utils/toCommaSeparatedList.js index 2f17e160..96c6d9f7 100644 --- a/src/utils/toCommaSeparatedList.js +++ b/src/utils/toCommaSeparatedList.js @@ -1,9 +1,6 @@ /** * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * * @emails react-core */ diff --git a/yarn.lock b/yarn.lock index 1dc83b4d..a86fa6c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -106,10 +106,6 @@ ammo@1.x.x: boom "2.x.x" hoek "2.x.x" -ansi-escapes@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-2.0.0.tgz#5bae52be424878dd9783e8910e3fc2922e83c81b" - ansi-escapes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92" @@ -191,6 +187,12 @@ argparse@~0.1.15: underscore "~1.7.0" underscore.string "~2.4.0" +aria-query@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-0.7.0.tgz#4af10a1e61573ddea0cf3b99b51c52c05b424d24" + dependencies: + ast-types-flow "0.0.7" + arr-diff@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" @@ -300,6 +302,10 @@ assert@^1.1.1: dependencies: util "0.10.3" +ast-types-flow@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" + async-each-series@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/async-each-series/-/async-each-series-1.1.0.tgz#f42fd8155d38f21a5b8ea07c28e063ed1700b138" @@ -357,6 +363,12 @@ aws4@^1.2.1: version "1.6.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" +axobject-query@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-0.1.0.tgz#62f59dbc59c9f9242759ca349960e7a2fe3c36c0" + dependencies: + ast-types-flow "0.0.7" + b64@2.x.x: version "2.0.1" resolved "https://registry.yarnpkg.com/b64/-/b64-2.0.1.tgz#d08c10719719ff1fe1b532ae49269409ce149ce9" @@ -2320,6 +2332,14 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: safe-buffer "^5.0.1" sha.js "^2.4.8" +create-react-class@^15.6.0: + version "15.6.2" + resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.2.tgz#cf1ed15f12aad7f14ef5f2dfe05e6c42f91ef02a" + dependencies: + fbjs "^0.8.9" + loose-envify "^1.3.1" + object-assign "^4.1.1" + cross-env@^3.1.1: version "3.2.4" resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-3.2.4.tgz#9e0585f277864ed421ce756f81a980ff0d698aba" @@ -2497,6 +2517,10 @@ d@1: dependencies: es5-ext "^0.10.9" +damerau-levenshtein@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.4.tgz#03191c432cb6eea168bb77f3a55ffdccb8978514" + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -2907,7 +2931,7 @@ elliptic@^6.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.0" -"emoji-regex@>=6.0.0 <=6.1.1": +"emoji-regex@>=6.0.0 <=6.1.1", emoji-regex@^6.1.0: version "6.1.1" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.1.1.tgz#c6cd0ec1b0642e2a3c67a1137efc5e796da4f88e" @@ -3076,6 +3100,10 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" +eslint-config-fbjs@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-fbjs/-/eslint-config-fbjs-2.0.0.tgz#9f6ed690f500c2d750bf651e0cf1c65cf10b1c14" + eslint-config-prettier@^2.6.0: version "2.6.0" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.6.0.tgz#f21db0ebb438ad678fb98946097c4bb198befccc" @@ -3086,12 +3114,28 @@ eslint-config-react@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/eslint-config-react/-/eslint-config-react-1.1.7.tgz#a0918d0fc47d0e9bd161a47308021da85d2585b3" -eslint-plugin-flowtype@^2.37.0: - version "2.37.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.37.0.tgz#2b09694deea6efdd8354eccd328db134b2d8b6d5" +eslint-plugin-babel@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-4.1.2.tgz#79202a0e35757dd92780919b2336f1fa2fe53c1e" + +eslint-plugin-flowtype@^2.39.1: + version "2.39.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.39.1.tgz#b5624622a0388bcd969f4351131232dcb9649cd5" dependencies: lodash "^4.15.0" +eslint-plugin-jsx-a11y@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.0.2.tgz#659277a758b036c305a7e4a13057c301cd3be73f" + dependencies: + aria-query "^0.7.0" + array-includes "^3.0.3" + ast-types-flow "0.0.7" + axobject-query "^0.1.0" + damerau-levenshtein "^1.0.0" + emoji-regex "^6.1.0" + jsx-ast-utils "^1.4.0" + eslint-plugin-prettier@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.3.1.tgz#e7a746c67e716f335274b88295a9ead9f544e44d" @@ -3108,6 +3152,12 @@ eslint-plugin-react@^7.4.0: jsx-ast-utils "^2.0.0" prop-types "^15.5.10" +eslint-plugin-relay@^0.0.19: + version "0.0.19" + resolved "https://registry.yarnpkg.com/eslint-plugin-relay/-/eslint-plugin-relay-0.0.19.tgz#68767f79f19bf81e2aa6a7ccf82fe30d65015efe" + dependencies: + graphql "^0.11.3" + eslint-scope@^3.7.1: version "3.7.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" @@ -3175,10 +3225,6 @@ esprima@^2.6.0: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" -esprima@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - esprima@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" @@ -3461,9 +3507,9 @@ fb-watchman@^2.0.0: dependencies: bser "^2.0.0" -fbjs@^0.8.1, fbjs@^0.8.16: - version "0.8.16" - resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" +fbjs@^0.8.1, fbjs@^0.8.12, fbjs@^0.8.9: + version "0.8.14" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.14.tgz#d1dbe2be254c35a91e09f31f9cd50a40b2a0ed1c" dependencies: core-js "^1.0.0" isomorphic-fetch "^2.1.1" @@ -3473,9 +3519,9 @@ fbjs@^0.8.1, fbjs@^0.8.16: setimmediate "^1.0.5" ua-parser-js "^0.7.9" -fbjs@^0.8.12, fbjs@^0.8.9: - version "0.8.14" - resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.14.tgz#d1dbe2be254c35a91e09f31f9cd50a40b2a0ed1c" +fbjs@^0.8.16: + version "0.8.16" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" dependencies: core-js "^1.0.0" isomorphic-fetch "^2.1.1" @@ -4392,12 +4438,18 @@ graphql-skip-limit@^1.0.5: dependencies: babel-runtime "^6.26.0" -graphql@0.10.5, graphql@^0.10.3, graphql@^0.10.5: +graphql@^0.10.3, graphql@^0.10.5: version "0.10.5" resolved "https://registry.yarnpkg.com/graphql/-/graphql-0.10.5.tgz#c9be17ca2bdfdbd134077ffd9bbaa48b8becd298" dependencies: iterall "^1.1.0" +graphql@^0.11.3: + version "0.11.7" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-0.11.7.tgz#e5abaa9cb7b7cccb84e9f0836bf4370d268750c6" + dependencies: + iterall "1.1.3" + gray-matter@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/gray-matter/-/gray-matter-2.1.1.tgz#3042d9adec2a1ded6a7707a9ed2380f8a17a430e" @@ -4869,26 +4921,7 @@ inline-style-prefixer@^3.0.6: bowser "^1.6.0" css-in-js-utils "^1.0.3" -inquirer@^3.0.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.1.1.tgz#87621c4fba4072f48a8dd71c9f9df6f100b2d534" - dependencies: - ansi-escapes "^2.0.0" - chalk "^1.0.0" - cli-cursor "^2.1.0" - cli-width "^2.0.0" - external-editor "^2.0.4" - figures "^2.0.0" - lodash "^4.3.0" - mute-stream "0.0.7" - run-async "^2.2.0" - rx-lite "^4.0.8" - rx-lite-aggregates "^4.0.8" - string-width "^2.0.0" - strip-ansi "^3.0.0" - through "^2.3.6" - -inquirer@^3.0.6: +inquirer@^3.0.1, inquirer@^3.0.6: version "3.3.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" dependencies: @@ -5341,6 +5374,10 @@ items@2.x.x: version "2.1.1" resolved "https://registry.yarnpkg.com/items/-/items-2.1.1.tgz#8bd16d9c83b19529de5aea321acaada78364a198" +iterall@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.1.3.tgz#1cbbff96204056dde6656e2ed2e2226d0e6d72c9" + iterall@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.1.1.tgz#f7f0af11e9a04ec6426260f5019d9fcca4d50214" @@ -5386,14 +5423,7 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -js-yaml@^3.4.6, js-yaml@^3.5.2, js-yaml@^3.8.1: - version "3.8.4" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" - dependencies: - argparse "^1.0.7" - esprima "^3.1.1" - -js-yaml@^3.9.1: +js-yaml@^3.4.6, js-yaml@^3.5.2, js-yaml@^3.8.1, js-yaml@^3.9.1: version "3.10.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" dependencies: @@ -5547,6 +5577,10 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.3.6" +jsx-ast-utils@^1.4.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz#3867213e8dd79bf1e8f2300c0cfc1efb182c0df1" + jsx-ast-utils@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz#e801b1b39985e20fffc87b40e3748080e2dcac7f" @@ -6189,13 +6223,13 @@ mime-db@~1.25.0: version "1.25.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.25.0.tgz#c18dbd7c73a5dbf6f44a024dc0d165a1e7b1c392" -mime-types@2.1.13: +mime-types@2.1.13, mime-types@~2.1.11: version "2.1.13" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.13.tgz#e07aaa9c6c6b9a7ca3012c69003ad25a39e92a88" dependencies: mime-db "~1.25.0" -mime-types@^2.1.12, mime-types@~2.1.11, mime-types@~2.1.15, mime-types@~2.1.7: +mime-types@^2.1.12, mime-types@~2.1.15, mime-types@~2.1.7: version "2.1.15" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed" dependencies: @@ -7513,11 +7547,7 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -prettier@^1.3.1: - version "1.5.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.5.2.tgz#7ea0751da27b93bfb6cecfcec509994f52d83bb3" - -prettier@^1.7.4: +prettier@^1.3.1, prettier@^1.7.4: version "1.7.4" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.7.4.tgz#5e8624ae9363c80f95ec644584ecdf55d74f93fa" @@ -7580,14 +7610,14 @@ promise@^7.1.1: dependencies: asap "~2.0.3" -prop-types@^15.5.10, prop-types@^15.5.8: +prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.8: version "15.5.10" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.10.tgz#2797dfc3126182e3a95e3dfbb2e893ddd7456154" dependencies: fbjs "^0.8.9" loose-envify "^1.3.1" -prop-types@^15.5.4, prop-types@^15.6.0: +prop-types@^15.6.0: version "15.6.0" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856" dependencies: @@ -7725,7 +7755,16 @@ react-deep-force-update@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-2.0.1.tgz#4f7f6c12c3e7de42f345992a3c518236fa1ecad3" -react-dom@16.0.0, react-dom@^15.6.0, react-dom@^16.0.0: +react-dom@^15.6.0: + version "15.6.2" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.6.2.tgz#41cfadf693b757faf2708443a1d1fd5a02bef730" + dependencies: + fbjs "^0.8.9" + loose-envify "^1.1.0" + object-assign "^4.1.0" + prop-types "^15.5.10" + +react-dom@^16.0.0: version "16.0.0" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.0.0.tgz#9cc3079c3dcd70d4c6e01b84aab2a7e34c303f58" dependencies: @@ -7788,7 +7827,17 @@ react-side-effect@^1.1.0: exenv "^1.2.1" shallowequal "^1.0.1" -react@16.0.0, react@^15.6.0, react@^16.0.0: +react@^15.6.0: + version "15.6.2" + resolved "https://registry.yarnpkg.com/react/-/react-15.6.2.tgz#dba0434ab439cfe82f108f0f511663908179aa72" + dependencies: + create-react-class "^15.6.0" + fbjs "^0.8.9" + loose-envify "^1.1.0" + object-assign "^4.1.0" + prop-types "^15.5.10" + +react@^16.0.0: version "16.0.0" resolved "https://registry.yarnpkg.com/react/-/react-16.0.0.tgz#ce7df8f1941b036f02b2cca9dbd0cb1f0e855e2d" dependencies: @@ -8974,13 +9023,6 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -string-width@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.0.tgz#030664561fc146c9423ec7d978fe2457437fe6d0" - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - string-width@^2.1.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" @@ -9363,18 +9405,12 @@ topo@2.x.x: dependencies: hoek "4.x.x" -tough-cookie@>=2.3.3: +tough-cookie@>=2.3.3, tough-cookie@~2.3.0: version "2.3.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561" dependencies: punycode "^1.4.1" -tough-cookie@~2.3.0: - version "2.3.2" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" - dependencies: - punycode "^1.4.1" - tracer@^0.8.9: version "0.8.11" resolved "https://registry.yarnpkg.com/tracer/-/tracer-0.8.11.tgz#5941c67404410d86665b75bba68bb1c9d2c3cacd"