diff --git a/.babelrc b/.babelrc new file mode 100644 index 000000000..ebd1c7cad --- /dev/null +++ b/.babelrc @@ -0,0 +1,5 @@ +{ + "presets": [ + "./scripts/babel/preset" + ] +} diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..66f736ade --- /dev/null +++ b/.eslintignore @@ -0,0 +1,4 @@ +coverage +dist +node_modules +packages/**/vendor/* diff --git a/.eslintrc b/.eslintrc index 31728b5a9..5127cd73a 100644 --- a/.eslintrc +++ b/.eslintrc @@ -56,6 +56,7 @@ "no-dupe-class-members": 2, "no-dupe-keys": 2, "no-duplicate-case": 2, + "no-duplicate-imports": 2, "no-empty-character-class": 2, "no-empty-pattern": 2, "no-eval": 2, diff --git a/.flowconfig b/.flowconfig index 9a733d855..a5a417012 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,14 +1,16 @@ +[version] +^0.63.0 + [ignore] -.*/__tests__/.* -.*/benchmarks/.* -.*/docs/.* -.*/node_modules/animated/* +/.*/__tests__/.* +/packages/.*/dist/.* +/website/.* .*/node_modules/babel-plugin-transform-react-remove-prop-types/* [include] [libs] -types +/types [options] -unsafe.enable_getters_and_setters=true + diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 40ac206d3..fe6a23cbe 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -17,7 +17,7 @@ Fork, then clone the repo: git clone https://github.com/your-username/react-native-web.git ``` -Install dependencies (requires [yarn](https://yarnpkg.com/en/docs/install): +Install dependencies (requires [yarn](https://yarnpkg.com/en/docs/install)): ``` yarn @@ -25,6 +25,12 @@ yarn ## Automated tests +To run the linter: + +``` +yarn lint +``` + To run flow: ``` @@ -40,62 +46,57 @@ yarn jest …in watch mode: ``` -yarn jest:watch +yarn jest --watch ``` -To run all automated tests: +To run all these automated tests: ``` yarn test ``` -## Visual tests - -To run the interactive storybook: - -``` -yarn docs:start -``` +## Compile and build -To generate a static build of the storybook: +To compile the `react-native-web` source code: ``` -yarn docs:build +yarn compile ``` -To run the performance benchmarks in a browser (opening `./benchmarks/index.html`): +…in watch mode: ``` -yarn benchmark +yarn compile --watch ``` -## Compile and build +## Website and visual tests -To compile the source code to `dist`: +To run the interactive storybook: ``` -yarn compile +yarn website ``` -To create a UMD bundle of the library: +When you're also making changes to the 'react-native-web' source files, run this command in another process: ``` -yarn build +yarn compile --watch ``` -### Pre-commit +## Benchmarks -To format and lint code before commit: +To run the benchmarks locally: ``` -yarn precommit +yarn benchmarks +open ./packages/benchmarks/dist/index.html ``` -To format and lint the entire project: +To develop against these benchmarks: ``` -yarn fmt -yarn lint +yarn compile --watch +yarn benchmarks --watch ``` ### New Features @@ -106,13 +107,12 @@ that we won't want to accept. ## Pull requests -**Before submitting a pull request,** please make sure the following is done: +**Before submitting a pull request**, please make sure the following is done: 1. Fork the repository and create your branch from `master`. 2. If you've added code that should be tested, add tests! 3. If you've changed APIs, update the documentation. 4. Ensure the tests pass (`yarn test`). -5. Lint and format your code (`yarn fmt && yarn lint`). You can now submit a pull request, referencing any issues it addresses. @@ -123,3 +123,18 @@ After you have submitted your pull request, we'll try to get back to you as soon as possible. We may suggest some changes or improvements. Thank you for contributing! + +## Releases + +To commit, publish, and push a final version: + +``` +yarn release +``` + +Release candidates or versions that you'd like to publish to npm, but do not +want to produce a commit and push it to GitHub: + +``` +yarn release --skip-git +``` diff --git a/.gitignore b/.gitignore index b512c09d4..62562b74a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -node_modules \ No newline at end of file +coverage +node_modules diff --git a/.travis.yml b/.travis.yml index 78d76298a..78b656153 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,17 @@ language: node_js + node_js: - - "6" -before_script: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start + - "8" + +before_install: + # Install Yarn + - curl -o- -L https://yarnpkg.com/install.sh | bash + - export PATH=$HOME/.yarn/bin:$PATH + +cache: + yarn: true + directories: + - node_modules + script: - - yarn lint + - yarn test diff --git a/LICENSE b/LICENSE index d6a83ef99..7ba8a3821 100644 --- a/LICENSE +++ b/LICENSE @@ -1,31 +1,22 @@ -BSD License +MIT License -For React Native software +Copyright (c) 2015-present, Nicolas Gallagher. +Copyright (c) 2015-present, Facebook, Inc. -Copyright (c) 2015-present, Nicolas Gallagher. All rights reserved. -Copyright (c) 2015-present, Facebook, Inc. All rights reserved. +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: -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name Facebook nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +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. diff --git a/README.md b/README.md index 7b6e1b917..6832e1475 100644 --- a/README.md +++ b/README.md @@ -1,127 +1,141 @@ # React Native for Web -[![Build Status][travis-image]][travis-url] -[![npm version][npm-image]][npm-url] +[![npm version][package-badge]][package-url] [![Build Status][ci-badge]][ci-url] [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://reactjs.org/docs/how-to-contribute.html#your-first-pull-request) "React Native for Web" brings the platform-agnostic Components and APIs of [React Native][react-native-url] to the Web. -Browse the [interactive -documentation](https://necolas.github.io/react-native-web/storybook/) or [try -it out](https://glitch.com/edit/#!/react-native-web-playground) on Glitch. +* **High-quality user interfaces**: React Native for Web makes it easy to +create [fast](https://github.com/necolas/react-native-web/blob/master/packages/benchmarks/README.md), +adaptive web UIs in JavaScript. It provides native-like interactions, support +for multiple input modes (touch, mouse, keyboard), optimized vendor-prefixed +styles, built-in support for RTL layout, built-in accessibility, and integrates +with React Dev Tools. -## Features +* **Write once, render anywhere**: React Native for Web interoperates with +existing React DOM components and is compatible with the majority of the +React Native API. You can develop new components for native and web without +rewriting existing code. React Native for Web can also render to HTML and +critical CSS on the server using Node.js. -* Interoperability with ReactDOM components. -* Native-like touch handling. -* Built-in integration with web accessibility APIs. -* Built-in support for LTR and RTL layouts. -* Built-in expressive and reliable subset of CSS. -* Optimized, vendor-prefixed CSS with [good runtime performance](benchmarks/README.md). -* Server-side rendering of HTML and critical CSS. -* Browser support: Chrome, Firefox, Safari >= 7, IE 10, Edge. +Who is using React Native for Web? [Twitter](https://mobile.twitter.com), +[Major League Soccer](https://matchcenter.mlssoccer.com), Playstation, Uber, [The +Times](https://github.com/newsuk/times-components), [React Native's +documentation](http://facebook.github.io/react-native/). + +Browser support: Chrome, Firefox, Safari >= 7, IE 10, Edge. ## Quick start -Install in your existing app using `yarn` or `npm`: +The easiest way to get started with React Native for Web is to use this +[ready-to-go project on Glitch](https://glitch.com/edit/#!/react-native-web-playground). +You don’t need to install anything to try it out. -``` -yarn add react react-dom react-native-web -``` +If you are unfamiliar with setting up a React web project, please follow the +recommendations in the [React documentation](https://reactjs.org/). -Add the `react-native-web/babel` plugin to your Babel configuration. This will -alias `react-native` to `react-native-web` and exclude any modules not required -by the app. - -```json -{ - "plugins": [ - "react-native-web/babel" - ], - "presets": [ - "react-native" - ] -} -``` +## Documentation -(For React/ReactDOM 15.4 – 15.6 support, install `react-native-web@<0.1.0`) +You can find the React Native for Web API documentation [on the +website][website-url]. -See the [Getting Started](docs/guides/getting-started.md) guide for more details. +Please refer to the [React Native documentation][react-native-url] for more +design details, and for information about the [Gesture Responder +system](https://facebook.github.io/react-native/docs/gesture-responder-system.html) +and [animations](https://facebook.github.io/react-native/docs/animations.html). -## Documentation +### Installation + +Install using `yarn` or `npm`: -The [interactive -documentation](https://necolas.github.io/react-native-web/storybook/) shows all -the supported APIs and Components. +``` +yarn add react react-dom react-native-web +yarn add --dev babel-plugin-react-native-web +``` -Guides: +### Guides -* [Getting started](docs/guides/getting-started.md) -* [Style](docs/guides/style.md) -* [Accessibility](docs/guides/accessibility.md) -* [Direct manipulation](docs/guides/direct-manipulation.md) -* [Internationalization](docs/guides/internationalization.md) -* [Advanced use](docs/guides/advanced.md) -* [Known issues](docs/guides/known-issues.md) +* [Getting started](https://github.com/necolas/react-native-web/blob/master/website/guides/getting-started.md) +* [Style](https://github.com/necolas/react-native-web/blob/master/website/guides/style.md) +* [Accessibility](https://github.com/necolas/react-native-web/blob/master/website/guides/accessibility.md) +* [Internationalization](https://github.com/necolas/react-native-web/blob/master/website/guides/internationalization.md) +* [Direct manipulation](https://github.com/necolas/react-native-web/blob/master/website/guides/direct-manipulation.md) +* [Advanced use](https://github.com/necolas/react-native-web/blob/master/website/guides/advanced.md) -## Example code +## Examples + +There are several examples [on the website][website-url] and in the [website's +source code](https://github.com/necolas/react-native-web/blob/master/website). +Here is an example to get you started: ```js -import React from 'react' -import { AppRegistry, Image, StyleSheet, Text, View } from 'react-native' - -// Components -const Card = ({ children }) => {children} -const Title = ({ children }) => {children} -const Photo = ({ uri }) => -const App = () => ( - - App Card - - -) - -// Styles -const styles = StyleSheet.create({ - card: { - flexGrow: 1, - justifyContent: 'center' - }, - title: { - fontSize: '1.25rem', - fontWeight: 'bold' - }, - image: { - height: 40, - marginVertical: 10, - width: 40 +import React from 'react'; +import { AppRegistry, StyleSheet, Text, View } from 'react-native'; + +class App extends React.Component { + render() { + return ( + + Hello, world! + + ); } -}) +} -// App registration and rendering -AppRegistry.registerComponent('MyApp', () => App) -AppRegistry.runApplication('MyApp', { rootTag: document.getElementById('react-root') }) +const styles = StyleSheet.create({ + box: { padding: 10 }, + text: { fontWeight: 'bold' } +}); + +AppRegistry.registerComponent('App', () => App); +AppRegistry.runApplication('App', { rootTag: document.getElementById('react-root') }); ``` -## Starter kits +This example will render the `App` into a container on the page. + +You'll notice that there is no reference to `react-dom`; the `App` component is +defined using the platform-agnostic APIs and Components introduced by React +Native. This allows the app to be rendered to web and native platforms. + +## Contributing + +The main purpose of this repository is to help evolve React web and native +development towards the platform-agnostic design of React Native, and in the +process make it faster and easier to build high-quality experiences for the web +with React. Development happens in the open on GitHub, and we are grateful for +contributing bugfixes and improvements. Read below to learn how you can take +part in improving React Native for Web. + +### Code of conduct + +Facebook has adopted a [Code of Conduct][code-of-conduct] that this project +expects all participants to adhere to. Please read the full text so that you +can understand what actions will and will not be tolerated. + +### Contributing guide -* [Glitch](https://glitch.com/edit/#!/react-native-web-playground) -* [create-react-app](https://github.com/facebookincubator/create-react-app) -* [re-start](https://github.com/react-everywhere/re-start) +Read the [contributing guide][contributing-url] to learn about the +development process, how to propose bugfixes and improvements, and how to build +and test your changes to React Native for Web. -## Related projects +### Good first issues -* [react-primitives](https://github.com/lelandrichardson/react-primitives/) -* [react-sketchapp](https://github.com/airbnb/react-sketchapp) -* [reactxp](https://github.com/microsoft/reactxp) -* [react-native-web-player](https://github.com/dabbott/react-native-web-player) +To help you get you familiar with the contribution process, there is a list of +[good first issues][good-first-issue-url] that contain bugs which have a +relatively limited scope. This is a great place to get started. ## License -React Native for Web is [BSD licensed](LICENSE). +React Native for Web is [MIT licensed](./LICENSE). By contributing to React +Native for Web, you agree that your contributions will be licensed under its +MIT license. -[npm-image]: https://badge.fury.io/js/react-native-web.svg -[npm-url]: https://npmjs.org/package/react-native-web +[package-badge]: https://img.shields.io/npm/v/react-native-web.svg?style=flat +[package-url]: https://yarnpkg.com/en/package/react-native-web +[ci-badge]: https://travis-ci.org/necolas/react-native-web.svg?branch=master +[ci-url]: https://travis-ci.org/necolas/react-native-web +[website-url]: https://necolas.github.io/react-native-web/storybook/ [react-native-url]: https://facebook.github.io/react-native/ -[travis-image]: https://travis-ci.org/necolas/react-native-web.svg?branch=master -[travis-url]: https://travis-ci.org/necolas/react-native-web +[contributing-url]: https://github.com/necolas/react-native-web/blob/master/.github/CONTRIBUTING.md +[good-first-issue-url]: https://github.com/necolas/react-native-web/labels/good%20first%20issue +[code-of-conduct]: https://code.facebook.com/codeofconduct diff --git a/babel/__tests__/__snapshots__/index-test.js.snap b/babel/__tests__/__snapshots__/index-test.js.snap deleted file mode 100644 index d600ad838..000000000 --- a/babel/__tests__/__snapshots__/index-test.js.snap +++ /dev/null @@ -1,161 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`1. Rewrite react-native paths for react-native-web 1`] = ` -" -import { View } from 'react-native'; - - ↓ ↓ ↓ ↓ ↓ ↓ - -import View from 'react-native-web/dist/components/View'; -" -`; - -exports[`2. Rewrite react-native paths for react-native-web 1`] = ` -" -import { Switch, Text, View as MyView, ViewPropTypes } from 'react-native'; - - ↓ ↓ ↓ ↓ ↓ ↓ - -import Switch from 'react-native-web/dist/components/Switch'; -import Text from 'react-native-web/dist/components/Text'; -import MyView from 'react-native-web/dist/components/View'; -import ViewPropTypes from 'react-native-web/dist/components/View/ViewPropTypes'; -" -`; - -exports[`3. Rewrite react-native paths for react-native-web 1`] = ` -" -import { createElement, Switch, StyleSheet } from 'react-native'; - - ↓ ↓ ↓ ↓ ↓ ↓ - -import createElement from 'react-native-web/dist/modules/createElement'; -import Switch from 'react-native-web/dist/components/Switch'; -import StyleSheet from 'react-native-web/dist/apis/StyleSheet'; -" -`; - -exports[`4. Rewrite react-native paths for react-native-web 1`] = ` -" -import { InvalidThing, TouchableOpacity } from 'react-native'; - - ↓ ↓ ↓ ↓ ↓ ↓ - -import { InvalidThing } from 'react-native-web'; -import TouchableOpacity from 'react-native-web/dist/components/Touchable/TouchableOpacity'; -" -`; - -exports[`5. Rewrite react-native paths for react-native-web 1`] = ` -" -import * as RNW from 'react-native'; - - ↓ ↓ ↓ ↓ ↓ ↓ - -import * as RNW from 'react-native-web'; -" -`; - -exports[`6. Rewrite react-native paths for react-native-web 1`] = ` -" -const { View } = require('react-native'); - - ↓ ↓ ↓ ↓ ↓ ↓ - -const View = require('react-native-web/dist/components/View'); -" -`; - -exports[`7. Rewrite react-native paths for react-native-web 1`] = ` -" -let { Switch, Text, View: MyView } = require('react-native'); - - ↓ ↓ ↓ ↓ ↓ ↓ - -let Switch = require('react-native-web/dist/components/Switch'); - -let Text = require('react-native-web/dist/components/Text'); - -let MyView = require('react-native-web/dist/components/View'); -" -`; - -exports[`8. Rewrite react-native paths for react-native-web 1`] = ` -" -var { createElement, Switch, StyleSheet } = require('react-native'); - - ↓ ↓ ↓ ↓ ↓ ↓ - -var createElement = require('react-native-web/dist/modules/createElement'); - -var Switch = require('react-native-web/dist/components/Switch'); - -var StyleSheet = require('react-native-web/dist/apis/StyleSheet'); -" -`; - -exports[`9. Rewrite react-native paths for react-native-web 1`] = ` -" -const { InvalidThing, TouchableOpacity } = require('react-native'); - - ↓ ↓ ↓ ↓ ↓ ↓ - -const TouchableOpacity = require('react-native-web/dist/components/Touchable/TouchableOpacity'); -" -`; - -exports[`10. Rewrite react-native paths for react-native-web 1`] = ` -" -export { View } from 'react-native'; - - ↓ ↓ ↓ ↓ ↓ ↓ - -export { default as View } from 'react-native-web/dist/components/View'; -" -`; - -exports[`11. Rewrite react-native paths for react-native-web 1`] = ` -" -export { Switch, Text, View as MyView, ViewPropTypes } from 'react-native'; - - ↓ ↓ ↓ ↓ ↓ ↓ - -export { default as Switch } from 'react-native-web/dist/components/Switch'; -export { default as Text } from 'react-native-web/dist/components/Text'; -export { default as MyView } from 'react-native-web/dist/components/View'; -export { default as ViewPropTypes } from 'react-native-web/dist/components/View/ViewPropTypes'; -" -`; - -exports[`12. Rewrite react-native paths for react-native-web 1`] = ` -" -export { createElement, Switch, StyleSheet } from 'react-native'; - - ↓ ↓ ↓ ↓ ↓ ↓ - -export { default as createElement } from 'react-native-web/dist/modules/createElement'; -export { default as Switch } from 'react-native-web/dist/components/Switch'; -export { default as StyleSheet } from 'react-native-web/dist/apis/StyleSheet'; -" -`; - -exports[`13. Rewrite react-native paths for react-native-web 1`] = ` -" -export { InvalidThing, TouchableOpacity } from 'react-native'; - - ↓ ↓ ↓ ↓ ↓ ↓ - -export { InvalidThing } from 'react-native-web'; -export { default as TouchableOpacity } from 'react-native-web/dist/components/Touchable/TouchableOpacity'; -" -`; - -exports[`14. Rewrite react-native paths for react-native-web 1`] = ` -" -export { default as RNW } from 'react-native'; - - ↓ ↓ ↓ ↓ ↓ ↓ - -export { default as RNW } from 'react-native-web'; -" -`; diff --git a/babel/__tests__/index-test.js b/babel/__tests__/index-test.js deleted file mode 100644 index 0d40a6e32..000000000 --- a/babel/__tests__/index-test.js +++ /dev/null @@ -1,46 +0,0 @@ -const plugin = require('..'); -const pluginTester = require('babel-plugin-tester'); - -pluginTester({ - plugin, - snapshot: true, - tests: [ - // import react-native - "import { View } from 'react-native';", - "import { Switch, Text, View as MyView, ViewPropTypes } from 'react-native';", - "import { createElement, Switch, StyleSheet } from 'react-native';", - "import { InvalidThing, TouchableOpacity } from 'react-native';", - "import * as RNW from 'react-native';", - - // import react-native-web - // "import { View } from 'react-native-web';", - // "import { Switch, Text, View as MyView } from 'react-native-web';", - // "import { createElement, Switch, StyleSheet } from 'react-native-web';", - // "import { InvalidThing, TouchableOpacity } from 'react-native-web';", - // "import * as RNW from 'react-native-web';", - - // require react-native - "const { View } = require('react-native');", - "let { Switch, Text, View: MyView } = require('react-native');", - "var { createElement, Switch, StyleSheet } = require('react-native');", - "const { InvalidThing, TouchableOpacity } = require('react-native');", - - // require react-native-web - // "const { View } = require('react-native-web');", - // "let { Switch, Text, View: MyView } = require('react-native-web');", - // "var { createElement, Switch, StyleSheet } = require('react-native-web');", - // "const { InvalidThing, TouchableOpacity } = require('react-native-web');", - - // export react-native - "export { View } from 'react-native';", - "export { Switch, Text, View as MyView, ViewPropTypes } from 'react-native';", - "export { createElement, Switch, StyleSheet } from 'react-native';", - "export { InvalidThing, TouchableOpacity } from 'react-native';", - "export { default as RNW } from 'react-native';", - { - code: "const RNW = require('react-native');", - output: "const RNW = require('react-native');", - snapshot: false - } - ] -}); diff --git a/babel/index.js b/babel/index.js deleted file mode 100644 index 2f16ed08d..000000000 --- a/babel/index.js +++ /dev/null @@ -1,181 +0,0 @@ -const getDistLocation = importName => { - const root = 'react-native-web/dist'; - - switch (importName) { - // apis - case 'Animated': - case 'AppRegistry': - case 'AppState': - case 'AsyncStorage': - case 'BackHandler': - case 'Clipboard': - case 'Dimensions': - case 'Easing': - case 'I18nManager': - case 'InteractionManager': - case 'Keyboard': - case 'Linking': - case 'NetInfo': - case 'PanResponder': - case 'PixelRatio': - case 'Platform': - case 'StyleSheet': - case 'UIManager': - case 'Vibration': { - return `${root}/apis/${importName}`; - } - - // components - case 'ActivityIndicator': - case 'Button': - case 'FlatList': - case 'Image': - case 'KeyboardAvoidingView': - case 'ListView': - case 'Modal': - case 'Picker': - case 'ProgressBar': - case 'RefreshControl': - case 'ScrollView': - case 'SectionList': - case 'Slider': - case 'StatusBar': - case 'Switch': - case 'Text': - case 'TextInput': - case 'View': - case 'VirtualizedList': { - return `${root}/components/${importName}`; - } - - case 'Touchable': - case 'TouchableHighlight': - case 'TouchableNativeFeedback': - case 'TouchableOpacity': - case 'TouchableWithoutFeedback': { - return `${root}/components/Touchable/${importName}`; - } - - // modules - case 'createElement': - case 'findNodeHandle': - case 'NativeModules': - case 'processColor': - case 'render': - case 'unmountComponentAtNode': { - return `${root}/modules/${importName}`; - } - - // propTypes - case 'ColorPropType': - case 'EdgeInsetsPropType': - case 'PointPropType': { - return `${root}/propTypes/${importName}`; - } - case 'TextPropTypes': { - return `${root}/components/Text/${importName}`; - } - case 'ViewPropTypes': { - return `${root}/components/View/${importName}`; - } - - default: - return; - } -}; - -const isReactNativeRequire = (t, node) => { - const { declarations } = node; - if (declarations.length > 1) { - return false; - } - const { id, init } = declarations[0]; - return ( - t.isObjectPattern(id) && - t.isCallExpression(init) && - t.isIdentifier(init.callee) && - init.callee.name === 'require' && - init.arguments.length === 1 && - init.arguments[0].value === 'react-native' - ); -}; - -module.exports = function({ types: t }) { - return { - name: 'Rewrite react-native paths for react-native-web', - visitor: { - ImportDeclaration(path) { - const { source, specifiers } = path.node; - if (source && source.value === 'react-native' && specifiers.length) { - const imports = specifiers - .map(specifier => { - if (t.isImportSpecifier(specifier)) { - const importName = specifier.imported.name; - const distLocation = getDistLocation(importName); - - if (distLocation) { - return t.importDeclaration( - [t.importDefaultSpecifier(t.identifier(specifier.local.name))], - t.stringLiteral(distLocation) - ); - } - } - return t.importDeclaration([specifier], t.stringLiteral('react-native-web')); - }) - .filter(Boolean); - - path.replaceWithMultiple(imports); - } - }, - ExportNamedDeclaration(path) { - const { source, specifiers } = path.node; - if (source && source.value === 'react-native' && specifiers.length) { - const exports = specifiers - .map(specifier => { - if (t.isExportSpecifier(specifier)) { - const exportName = specifier.exported.name; - const localName = specifier.local.name; - const distLocation = getDistLocation(localName); - - if (distLocation) { - return t.exportNamedDeclaration( - null, - [t.exportSpecifier(t.identifier('default'), t.identifier(exportName))], - t.stringLiteral(distLocation) - ); - } - return t.exportNamedDeclaration( - null, - [specifier], - t.stringLiteral('react-native-web') - ); - } - }) - .filter(Boolean); - - path.replaceWithMultiple(exports); - } - }, - VariableDeclaration(path) { - if (isReactNativeRequire(t, path.node)) { - const { id } = path.node.declarations[0]; - const imports = id.properties - .map(identifier => { - const distLocation = getDistLocation(identifier.key.name); - if (distLocation) { - return t.variableDeclaration(path.node.kind, [ - t.variableDeclarator( - t.identifier(identifier.value.name), - t.callExpression(t.identifier('require'), [t.stringLiteral(distLocation)]) - ) - ]); - } - }) - .filter(Boolean); - - path.replaceWithMultiple(imports); - } - } - } - }; -}; diff --git a/benchmarks/README.md b/benchmarks/README.md deleted file mode 100644 index 80e6bc7b4..000000000 --- a/benchmarks/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# Performance - -To run these benchmarks from the root of the project: - -``` -yarn benchmark -open ./benchmarks/index.html -``` - -Append `?fastest` to the URL to include the fastest "other libraries", and -`?all` to include all the "other libraries". - -## Notes - -The components used in the render benchmarks are simple enough to be -implemented by multiple UI or style libraries. The implementations are not -equivalent in functionality. For example, React Native for Web's stylesheet is -unique in that it also converts React Native styles to DOM styles, has -deterministic resolution, and supports RTL layout. - -`react-native-web/stylesheet` is a comparative baseline that implements a -simple `View` without much of React Native's functionality. - -## Benchmark results - -Typical render timings*: mean ± two standard deviations. - -| Implementation | Deep tree (ms) | Wide tree (ms) | Tweets (ms) | -| :--- | ---: | ---: | ---: | -| `css-modules` | `88.83` `±18.63` | `198.79` `±22.98` | | -| `react-native-web/stylesheet@0.0.121` | `91.17` `±19.29` | `209.67` `±32.38` | | -| `react-native-web@0.0.121` | `124.21` `±16.84` | `264.55` `±38.75` | `16.90` `±7.30ms` | - -Other libraries - -| Implementation | Deep tree (ms) | Wide tree (ms) | -| :--- | ---: | ---: | -| `aphrodite@1.2.3` | `91.73` `±41.63` | `197.72` `±44.90` | -| `styletron@2.5.1` | `94.73` `±37.58` | `201.81` `±57.93` | -| `glamor@2.20.40` | `146.60` `±26.73` | `277.46` `±29.17` | -| `emotion@7.2.2` | `150.79` `±38.29` | `282.18` `±41.79` | -| `react-jss@7.1.0` | `201.83` `±34.65` | `428.61` `±47.8` | -| `reactxp@0.42.1` | `262.69` `±24.14` | `595.20` `±66.17` | -| `styled-components@2.1.2` | `280.59` `±31.77` | `599.00` `±62.99` | -| `styled-components/primitives@2.1.2` | `291.74` `±48.96` | `606.57` `±78.18` | -| `radium@0.19.4` | `563.94` `±69.91` | `1139.18` `±152.59` | - -These results indicate that style render performance is not a significant -differentiating factor between `aphrodite`, `css-modules`, `react-native-web`, -and `styletron`. - -*MacBook Pro (13-inch, Early 2015); 3.1 GHz Intel Core i7; 16 GB 1867 MHz DDR3. Google Chrome 58 (2x CPU slowdown). diff --git a/benchmarks/benchmark.js b/benchmarks/benchmark.js deleted file mode 100644 index fc2e9368c..000000000 --- a/benchmarks/benchmark.js +++ /dev/null @@ -1,97 +0,0 @@ -import * as marky from 'marky'; - -const fmt = time => `${Math.round(time * 100) / 100}ms`; - -const measure = (name, fn) => { - marky.mark(name); - fn(); - const performanceMeasure = marky.stop(name); - return performanceMeasure.duration; -}; - -const mean = values => { - const sum = values.reduce((sum, value) => sum + value, 0); - return sum / values.length; -}; - -const median = values => { - if (!Array.isArray(values)) { - return 0; - } - if (values.length === 1) { - return values[0]; - } - - const numbers = [...values].sort((a, b) => a - b); - return (numbers[(numbers.length - 1) >> 1] + numbers[numbers.length >> 1]) / 2; -}; - -const standardDeviation = values => { - const avg = mean(values); - - const squareDiffs = values.map(value => { - const diff = value - avg; - return diff * diff; - }); - - const meanSquareDiff = mean(squareDiffs); - return Math.sqrt(meanSquareDiff); -}; - -const benchmark = ({ name, description, setup, teardown, task, runs }) => { - return new Promise(resolve => { - const durations = []; - let i = 0; - - setup(); - const first = measure('first', task); - teardown(); - - const done = () => { - const stdDev = standardDeviation(durations); - const formattedFirst = fmt(first); - const formattedMean = fmt(mean(durations)); - const formattedMedian = fmt(median(durations)); - const formattedStdDev = fmt(stdDev); - - console.groupCollapsed(`${name}\n${formattedMean} ±${fmt(2 * stdDev)}`); - description && console.log(description); - console.log(`First: ${formattedFirst}`); - console.log(`Median: ${formattedMedian}`); - console.log(`Mean: ${formattedMean}`); - console.log(`Standard deviation: ${formattedStdDev}`); - console.log(durations); - console.groupEnd(); - resolve(); - }; - - const a = () => { - setup(); - window.requestAnimationFrame(b); - }; - - const b = () => { - const duration = measure('mean', task); - durations.push(duration); - window.requestAnimationFrame(c); - }; - - const c = () => { - teardown(); - window.requestAnimationFrame(d); - }; - - const d = () => { - i += 1; - if (i < runs) { - window.requestAnimationFrame(a); - } else { - window.requestAnimationFrame(done); - } - }; - - window.requestAnimationFrame(a); - }); -}; - -export default benchmark; diff --git a/benchmarks/createRenderBenchmark.js b/benchmarks/createRenderBenchmark.js deleted file mode 100644 index 49205dad5..000000000 --- a/benchmarks/createRenderBenchmark.js +++ /dev/null @@ -1,24 +0,0 @@ -import benchmark from './benchmark'; -import ReactDOM from 'react-dom'; - -const node = document.querySelector('.root'); - -const createRenderBenchmark = ({ description, getElement, name, runs }) => () => { - const setup = () => {}; - const teardown = () => { - ReactDOM.unmountComponentAtNode(node); - }; - - return benchmark({ - name, - description, - runs, - setup, - teardown, - task: () => { - ReactDOM.render(getElement(), node); - } - }); -}; - -export default createRenderBenchmark; diff --git a/benchmarks/index.html b/benchmarks/index.html deleted file mode 100644 index 74abe613b..000000000 --- a/benchmarks/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Performance tests - - -
- - - diff --git a/benchmarks/index.js b/benchmarks/index.js deleted file mode 100644 index 738315de8..000000000 --- a/benchmarks/index.js +++ /dev/null @@ -1,66 +0,0 @@ -import aphrodite from './src/aphrodite'; -import cssModules from './src/css-modules'; -import emotion from './src/emotion'; -import glamor from './src/glamor'; -import jss from './src/jss'; -import radium from './src/radium'; -import reactNative from './src/react-native'; -import reactNativeStyleSheet from './src/react-native-stylesheet'; -import styledComponents from './src/styled-components'; -import styletron from './src/styletron'; -import xp from './src/reactxp'; - -import renderDeepTree from './tests/renderDeepTree'; -import renderTweet from './tests/renderTweet'; -import renderWideTree from './tests/renderWideTree'; - -const testAll = window.location.search === '?all'; -const testFastest = window.location.search === '?fastest'; - -const coreTests = [ - () => renderTweet('react-native-web', reactNative), - - () => renderDeepTree('css-modules', cssModules), - () => renderWideTree('css-modules', cssModules), - () => renderDeepTree('react-native-web/stylesheet', reactNativeStyleSheet), - () => renderWideTree('react-native-web/stylesheet', reactNativeStyleSheet), - () => renderDeepTree('react-native-web', reactNative), - () => renderWideTree('react-native-web', reactNative) -]; - -const fastestTests = [ - () => renderDeepTree('aphrodite', aphrodite), - () => renderWideTree('aphrodite', aphrodite), - () => renderDeepTree('styletron', styletron), - () => renderWideTree('styletron', styletron) -]; - -/** - * Optionally run tests using other libraries - */ -const restTests = [ - () => renderDeepTree('emotion', emotion), - () => renderWideTree('emotion', emotion), - () => renderDeepTree('glamor', glamor), - () => renderWideTree('glamor', glamor), - () => renderDeepTree('radium', radium), - () => renderWideTree('radium', radium), - () => renderDeepTree('reactxp', xp), - () => renderWideTree('reactxp', xp), - () => renderDeepTree('react-jss', jss), - () => renderWideTree('react-jss', jss), - () => renderDeepTree('styled-components', styledComponents), - () => renderWideTree('styled-components', styledComponents) -]; - -const tests = [...coreTests]; -if (testFastest) { - tests.push(...fastestTests); -} -if (testAll) { - tests.push(...fastestTests); - tests.push(...restTests); -} - -// run benchmarks -tests.reduce((promise, test) => promise.then(test()), Promise.resolve()); diff --git a/benchmarks/package.json b/benchmarks/package.json deleted file mode 100644 index ad16a8e00..000000000 --- a/benchmarks/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "benchmarks", - "private": true, - "dependencies": { - "aphrodite": "^1.2.5", - "classnames": "^2.2.5", - "emotion": "^8.0.9", - "glamor": "^2.20.40", - "marky": "^1.2.0", - "radium": "^0.19.6", - "react-jss": "^7.2.0", - "react-primitives": "^0.4.3", - "reactxp": "^0.42.11", - "styled-components": "^2.2.3", - "styletron-client": "^2.5.7", - "styletron-utils": "^2.5.4" - }, - "devDependencies": { - "css-loader": "^0.28.7", - "style-loader": "^0.19.0" - } -} diff --git a/benchmarks/src/aphrodite.js b/benchmarks/src/aphrodite.js deleted file mode 100644 index e09522ee2..000000000 --- a/benchmarks/src/aphrodite.js +++ /dev/null @@ -1,7 +0,0 @@ -import Box from './components/Box/aphrodite'; -import View from './components/View/aphrodite'; - -export default { - Box, - View -}; diff --git a/benchmarks/src/components/Box/react-native-stylesheet.js b/benchmarks/src/components/Box/react-native-stylesheet.js deleted file mode 100644 index 0723ecdee..000000000 --- a/benchmarks/src/components/Box/react-native-stylesheet.js +++ /dev/null @@ -1,49 +0,0 @@ -/* eslint-disable react/prop-types */ -import React from 'react'; -import StyleSheet from 'react-native/apis/StyleSheet'; -import View from '../View/react-native-stylesheet'; - -const Box = ({ color, fixed = false, layout = 'column', outer = false, ...other }) => ( - -); - -const styles = StyleSheet.create({ - outer: { - padding: 4 - }, - row: { - flexDirection: 'row' - }, - color0: { - backgroundColor: '#222' - }, - color1: { - backgroundColor: '#666' - }, - color2: { - backgroundColor: '#999' - }, - color3: { - backgroundColor: 'blue' - }, - color4: { - backgroundColor: 'orange' - }, - color5: { - backgroundColor: 'red' - }, - fixed: { - width: 20, - height: 20 - } -}); - -export default Box; diff --git a/benchmarks/src/components/Box/styled-components-primitives.js b/benchmarks/src/components/Box/styled-components-primitives.js deleted file mode 100644 index 63e0ac600..000000000 --- a/benchmarks/src/components/Box/styled-components-primitives.js +++ /dev/null @@ -1,30 +0,0 @@ -import styled from 'styled-components/primitives'; - -const getColor = color => { - switch (color) { - case 0: - return '#222'; - case 1: - return '#666'; - case 2: - return '#999'; - case 3: - return 'blue'; - case 4: - return 'orange'; - case 5: - return 'red'; - default: - return 'transparent'; - } -}; - -const Box = styled.View` - flex-direction: ${props => (props.layout === 'column' ? 'column' : 'row')}; - padding: ${props => (props.outer ? '4px' : '0')}; - height: ${props => (props.fixed ? '20px' : 'auto')}; - width: ${props => (props.fixed ? '20px' : 'auto')}; - background-color: ${props => getColor(props.color)}; -`; - -export default Box; diff --git a/benchmarks/src/components/Box/styles.css b/benchmarks/src/components/Box/styles.css deleted file mode 100644 index d5605b7fb..000000000 --- a/benchmarks/src/components/Box/styles.css +++ /dev/null @@ -1,36 +0,0 @@ -.outer { - padding: 4px; -} - -.row { - flex-direction: row; -} - -.color0 { - background-color: #222; -} - -.color1 { - background-color: #666; -} - -.color2 { - background-color: #999; -} - -.color3 { - background-color: blue; -} - -.color4 { - background-color: orange; -} - -.color5 { - background-color: red; -} - -.fixed { - width: 20px; - height: 20px; -} diff --git a/benchmarks/src/components/Box/styletron.js b/benchmarks/src/components/Box/styletron.js deleted file mode 100644 index 33f97e4e0..000000000 --- a/benchmarks/src/components/Box/styletron.js +++ /dev/null @@ -1,49 +0,0 @@ -/* eslint-disable react/prop-types */ -import { injectStylePrefixed } from 'styletron-utils'; -import React from 'react'; -import View, { styletron } from '../View/styletron'; - -const Box = ({ color, fixed = false, layout = 'column', outer = false, ...other }) => ( - -); - -const styles = { - outer: injectStylePrefixed(styletron, { - padding: '4px' - }), - row: injectStylePrefixed(styletron, { - flexDirection: 'row' - }), - color0: injectStylePrefixed(styletron, { - backgroundColor: '#222' - }), - color1: injectStylePrefixed(styletron, { - backgroundColor: '#666' - }), - color2: injectStylePrefixed(styletron, { - backgroundColor: '#999' - }), - color3: injectStylePrefixed(styletron, { - backgroundColor: 'blue' - }), - color4: injectStylePrefixed(styletron, { - backgroundColor: 'orange' - }), - color5: injectStylePrefixed(styletron, { - backgroundColor: 'red' - }), - fixed: injectStylePrefixed(styletron, { - width: '20px', - height: '20px' - }) -}; - -export default Box; diff --git a/benchmarks/src/components/NestedTree/index.js b/benchmarks/src/components/NestedTree/index.js deleted file mode 100644 index 6a321aace..000000000 --- a/benchmarks/src/components/NestedTree/index.js +++ /dev/null @@ -1,58 +0,0 @@ -import PropTypes from 'prop-types'; -import React, { Component } from 'react'; - -class DeepTree extends Component { - static propTypes = { - breadth: PropTypes.number.isRequired, - components: PropTypes.object, - depth: PropTypes.number.isRequired, - id: PropTypes.number.isRequired, - wrap: PropTypes.number.isRequired - }; - - /* necessary for reactxp to work without errors */ - static childContextTypes = { - focusManager: PropTypes.object - }; - - getChildContext() { - return { - focusManager: { - addFocusableComponent() {}, - removeFocusableComponent() {}, - restrictFocusWithin() {}, - removeFocusRestriction() {}, - limitFocusWithin() {}, - removeFocusLimitation() {} - } - }; - } - - render() { - const { breadth, components, depth, id, wrap } = this.props; - const { Box } = components; - - let result = ( - - {depth === 0 && } - {depth !== 0 && - Array.from({ length: breadth }).map((el, i) => ( - - ))} - - ); - for (let i = 0; i < wrap; i++) { - result = {result}; - } - return result; - } -} - -export default DeepTree; diff --git a/benchmarks/src/components/View/react-native-stylesheet.js b/benchmarks/src/components/View/react-native-stylesheet.js deleted file mode 100644 index 3ca327338..000000000 --- a/benchmarks/src/components/View/react-native-stylesheet.js +++ /dev/null @@ -1,35 +0,0 @@ -/* eslint-disable react/prop-types */ -import React from 'react'; -import StyleSheet from 'react-native/apis/StyleSheet'; -import registry from 'react-native/apis/StyleSheet/registry'; - -const emptyObject = {}; - -class View extends React.Component { - render() { - const { style, ...other } = this.props; - const styleProps = registry.resolve([styles.root, style]) || emptyObject; - return
; - } -} - -const styles = StyleSheet.create({ - root: { - alignItems: 'stretch', - borderWidth: 0, - borderStyle: 'solid', - boxSizing: 'border-box', - display: 'flex', - flexBasis: 'auto', - flexDirection: 'column', - flexShrink: 0, - margin: 0, - padding: 0, - position: 'relative', - // fix flexbox bugs - minHeight: 0, - minWidth: 0 - } -}); - -export default View; diff --git a/benchmarks/src/components/View/styletron.js b/benchmarks/src/components/View/styletron.js deleted file mode 100644 index acca91762..000000000 --- a/benchmarks/src/components/View/styletron.js +++ /dev/null @@ -1,33 +0,0 @@ -/* eslint-disable react/prop-types */ -import classnames from 'classnames'; -import Styletron from 'styletron-client'; -import { injectStylePrefixed } from 'styletron-utils'; -import React from 'react'; - -export const styletron = new Styletron(); - -class View extends React.Component { - render() { - const { style, ...other } = this.props; - return
; - } -} - -const viewStyle = injectStylePrefixed(styletron, { - alignItems: 'stretch', - borderWidth: '0px', - borderStyle: 'solid', - boxSizing: 'border-box', - display: 'flex', - flexBasis: 'auto', - flexDirection: 'column', - flexShrink: '0', - margin: '0px', - padding: '0px', - position: 'relative', - // fix flexbox bugs - minHeight: '0px', - minWidth: '0px' -}); - -export default View; diff --git a/benchmarks/src/css-modules.js b/benchmarks/src/css-modules.js deleted file mode 100644 index fc62f9ada..000000000 --- a/benchmarks/src/css-modules.js +++ /dev/null @@ -1,9 +0,0 @@ -import Box from './components/Box/css-modules'; -import View from './components/View/css-modules'; - -const api = { - Box, - View -}; - -export default api; diff --git a/benchmarks/src/emotion.js b/benchmarks/src/emotion.js deleted file mode 100644 index 1b4a6a333..000000000 --- a/benchmarks/src/emotion.js +++ /dev/null @@ -1,7 +0,0 @@ -import Box from './components/Box/emotion'; -import View from './components/View/emotion'; - -export default { - Box, - View -}; diff --git a/benchmarks/src/glamor.js b/benchmarks/src/glamor.js deleted file mode 100644 index bef27a117..000000000 --- a/benchmarks/src/glamor.js +++ /dev/null @@ -1,7 +0,0 @@ -import Box from './components/Box/glamor'; -import View from './components/View/glamor'; - -export default { - Box, - View -}; diff --git a/benchmarks/src/jss.js b/benchmarks/src/jss.js deleted file mode 100644 index 83867ad81..000000000 --- a/benchmarks/src/jss.js +++ /dev/null @@ -1,9 +0,0 @@ -import Box from './components/Box/jss'; -import View from './components/View/jss'; - -const api = { - Box, - View -}; - -export default api; diff --git a/benchmarks/src/radium.js b/benchmarks/src/radium.js deleted file mode 100644 index ecfe03069..000000000 --- a/benchmarks/src/radium.js +++ /dev/null @@ -1,9 +0,0 @@ -import Box from './components/Box/radium'; -import View from './components/View/radium'; - -const api = { - Box, - View -}; - -export default api; diff --git a/benchmarks/src/react-native-stylesheet.js b/benchmarks/src/react-native-stylesheet.js deleted file mode 100644 index f5da10992..000000000 --- a/benchmarks/src/react-native-stylesheet.js +++ /dev/null @@ -1,9 +0,0 @@ -import Box from './components/Box/react-native-stylesheet'; -import View from './components/View/react-native-stylesheet'; - -const api = { - Box, - View -}; - -export default api; diff --git a/benchmarks/src/react-native.js b/benchmarks/src/react-native.js deleted file mode 100644 index 94d87aff3..000000000 --- a/benchmarks/src/react-native.js +++ /dev/null @@ -1,9 +0,0 @@ -import Box from './components/Box/react-native'; -import Tweet from './components/Tweet'; -import { View } from 'react-native'; - -export default { - Box, - Tweet, - View -}; diff --git a/benchmarks/src/reactxp.js b/benchmarks/src/reactxp.js deleted file mode 100644 index 8e61561e1..000000000 --- a/benchmarks/src/reactxp.js +++ /dev/null @@ -1,7 +0,0 @@ -import Box from './components/Box/reactxp'; -import { View } from 'reactxp'; - -export default { - Box, - View -}; diff --git a/benchmarks/src/styled-components-primitives.js b/benchmarks/src/styled-components-primitives.js deleted file mode 100644 index 14e0e2980..000000000 --- a/benchmarks/src/styled-components-primitives.js +++ /dev/null @@ -1,7 +0,0 @@ -import Box from './components/Box/styled-components'; -import styled from 'styled-components/primitives'; - -export default { - Box, - View: styled.View -}; diff --git a/benchmarks/src/styled-components.js b/benchmarks/src/styled-components.js deleted file mode 100644 index 54272a8a1..000000000 --- a/benchmarks/src/styled-components.js +++ /dev/null @@ -1,7 +0,0 @@ -import Box from './components/Box/styled-components'; -import View from './components/View/styled-components'; - -export default { - Box, - View -}; diff --git a/benchmarks/src/styletron.js b/benchmarks/src/styletron.js deleted file mode 100644 index 645380d57..000000000 --- a/benchmarks/src/styletron.js +++ /dev/null @@ -1,7 +0,0 @@ -import Box from './components/Box/styletron'; -import View from './components/View/styletron'; - -export default { - Box, - View -}; diff --git a/benchmarks/tests/renderDeepTree.js b/benchmarks/tests/renderDeepTree.js deleted file mode 100644 index 60fdc8d19..000000000 --- a/benchmarks/tests/renderDeepTree.js +++ /dev/null @@ -1,14 +0,0 @@ -import createRenderBenchmark from '../createRenderBenchmark'; -import NestedTree from '../src/components/NestedTree'; -import React from 'react'; - -const renderDeepTree = (label, components) => - createRenderBenchmark({ - name: `Deep tree [${label}]`, - runs: 20, - getElement() { - return ; - } - }); - -export default renderDeepTree; diff --git a/benchmarks/tests/renderTweet.js b/benchmarks/tests/renderTweet.js deleted file mode 100644 index 3243430a8..000000000 --- a/benchmarks/tests/renderTweet.js +++ /dev/null @@ -1,113 +0,0 @@ -import createRenderBenchmark from '../createRenderBenchmark'; -import Tweet from '../src/components/Tweet'; -import React from 'react'; - -const tweet1 = { - favorite_count: 30, - favorited: true, - id: '834889712556875776', - lang: 'en', - retweet_count: 6, - retweeted: false, - textParts: [ - { - prefix: '', - text: 'Living burrito to burrito ' - }, - { - emoji: 'https://abs-0.twimg.com/emoji/v2/svg/1f32f.svg', - isEmoji: true, - prefix: '', - text: '🌯' - }, - { - emoji: 'https://abs-0.twimg.com/emoji/v2/svg/1f32f.svg', - isEmoji: true, - prefix: '', - text: '🌯' - }, - { - emoji: 'https://abs-0.twimg.com/emoji/v2/svg/1f32f.svg', - isEmoji: true, - prefix: '', - text: '🌯' - } - ], - timestamp: 'Feb 23', - user: { - fullName: 'Nicolas', - screenName: 'necolas', - profileImageUrl: 'https://pbs.twimg.com/profile_images/804365942360719360/dQnPejph_normal.jpg' - } -}; - -const tweet2 = { - favorite_count: 84, - favorited: false, - id: '730896800060579840', - lang: 'en', - media: { - source: { - uri: 'https://pbs.twimg.com/media/CiSqvsJVEAAtLZ1.jpg', - width: 600, - height: 338 - } - }, - retweet_count: 4, - retweeted: true, - textParts: [ - { - prefix: '', - text: 'Presenting ' - }, - { - displayUrl: 'mobile.twitter.com', - expandedUrl: 'https://mobile.twitter.com', - isEntity: true, - isUrl: true, - linkRelation: 'nofollow', - prefix: '', - text: '', - textDirection: 'ltr', - url: 'https://t.co/4hRCAxiUUG' - }, - { - prefix: '', - text: ' with ' - }, - { - isEntity: true, - isMention: true, - prefix: '@', - text: 'davidbellona', - textDirection: 'ltr', - url: '/davidbellona' - }, - { - prefix: '', - text: " at Twitter's all hands meeting " - } - ], - timestamp: 'May 12', - user: { - fullName: 'Nicolas', - screenName: 'necolas', - profileImageUrl: 'https://pbs.twimg.com/profile_images/804365942360719360/dQnPejph_normal.jpg' - } -}; - -const renderTweet = label => - createRenderBenchmark({ - name: `Tweet [${label}]`, - runs: 10, - getElement() { - return ( -
- - -
- ); - } - }); - -export default renderTweet; diff --git a/benchmarks/tests/renderWideTree.js b/benchmarks/tests/renderWideTree.js deleted file mode 100644 index 948585ca6..000000000 --- a/benchmarks/tests/renderWideTree.js +++ /dev/null @@ -1,14 +0,0 @@ -import createRenderBenchmark from '../createRenderBenchmark'; -import NestedTree from '../src/components/NestedTree'; -import React from 'react'; - -const renderWideTree = (label, components) => - createRenderBenchmark({ - name: `Wide tree [${label}]`, - runs: 20, - getElement() { - return ; - } - }); - -export default renderWideTree; diff --git a/benchmarks/yarn.lock b/benchmarks/yarn.lock deleted file mode 100644 index edab6e155..000000000 --- a/benchmarks/yarn.lock +++ /dev/null @@ -1,1536 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/lodash@4.14.66": - version "4.14.66" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.66.tgz#3dbb83477becf130611f8fac82a8fdb199805981" - -"@types/lodash@^4.14.64": - version "4.14.74" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.74.tgz#ac3bd8db988e7f7038e5d22bd76a7ba13f876168" - -abbrev@1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f" - -ajv@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.2.0.tgz#c1735024c5da2ef75cc190713073d44f098bf486" - dependencies: - co "^4.6.0" - fast-deep-equal "^0.1.0" - json-schema-traverse "^0.3.0" - json-stable-stringify "^1.0.1" - -alphanum-sort@^1.0.1, alphanum-sort@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" - -animated@^0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/animated/-/animated-0.1.5.tgz#83df8dc443d57abab7b0bb04818b0b655b31c9b9" - dependencies: - invariant "^2.2.0" - normalize-css-color "^1.0.1" - -animated@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/animated/-/animated-0.2.0.tgz#1a0e96f097b3fbc5b64d7eddc723bcc0a6f97633" - dependencies: - invariant "^2.2.0" - normalize-css-color "^1.0.1" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - -aphrodite@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/aphrodite/-/aphrodite-1.2.5.tgz#8358c36c80bb03aee9b97165aaa70186225b4983" - dependencies: - asap "^2.0.3" - inline-style-prefixer "^3.0.1" - string-hash "^1.1.3" - -argparse@^1.0.7: - version "1.0.9" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" - dependencies: - sprintf-js "~1.0.2" - -array-find-index@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" - -array-find@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-find/-/array-find-1.0.0.tgz#6c8e286d11ed768327f8e62ecee87353ca3e78b8" - -asap@^2.0.3, asap@^2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" - -asap@~2.0.3: - version "2.0.5" - resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.5.tgz#522765b50c3510490e52d7dcfe085ef9ba96958f" - -assert@^1.3.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" - dependencies: - util "0.10.3" - -autoprefixer@^6.3.1: - version "6.7.5" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-6.7.5.tgz#50848f39dc08730091d9495023487e7cc21f518d" - dependencies: - browserslist "^1.7.5" - caniuse-db "^1.0.30000624" - normalize-range "^0.1.2" - num2fraction "^1.2.2" - postcss "^5.2.15" - postcss-value-parser "^3.2.3" - -babel-code-frame@^6.11.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" - dependencies: - chalk "^1.1.0" - esutils "^2.0.2" - js-tokens "^3.0.0" - -babel-generator@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.0.tgz#ac1ae20070b79f6e3ca1d3269613053774f20dc5" - dependencies: - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - detect-indent "^4.0.0" - jsesc "^1.3.0" - lodash "^4.17.4" - source-map "^0.5.6" - trim-right "^1.0.1" - -babel-macros@^1.0.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/babel-macros/-/babel-macros-1.2.0.tgz#39e47ed6d286d4a98f1948d8bab45dac17e4e2d4" - dependencies: - cosmiconfig "3.1.0" - -babel-messages@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-emotion@^8.0.9: - version "8.0.9" - resolved "https://registry.yarnpkg.com/babel-plugin-emotion/-/babel-plugin-emotion-8.0.9.tgz#65a9ead1e9a574fa1b0390ebcea942739761713c" - dependencies: - babel-generator "^6.26.0" - babel-macros "^1.0.2" - babel-plugin-syntax-jsx "^6.18.0" - convert-source-map "^1.5.0" - emotion-utils "^8.0.9" - source-map "^0.5.7" - touch "^1.0.0" - -babel-plugin-syntax-jsx@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" - -babel-runtime@^6.22.0, babel-runtime@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" - dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.11.0" - -babel-runtime@^6.23.0: - version "6.25.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.25.0.tgz#33b98eaa5d482bb01a8d1aa6b437ad2b01aec41c" - dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.10.0" - -babel-types@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" - dependencies: - babel-runtime "^6.26.0" - esutils "^2.0.2" - lodash "^4.17.4" - to-fast-properties "^1.0.3" - -balanced-match@^0.4.2: - version "0.4.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" - -base64-js@^1.0.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.0.tgz#a39992d723584811982be5e290bb6a53d86700f1" - -big.js@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.1.3.tgz#4cada2193652eb3ca9ec8e55c9015669c9806978" - -bowser@^1.0.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/bowser/-/bowser-1.6.0.tgz#37fc387b616cb6aef370dab4d6bd402b74c5c54d" - -bowser@^1.6.0: - version "1.7.1" - resolved "https://registry.yarnpkg.com/bowser/-/bowser-1.7.1.tgz#a4de8f18a1a0dc9531eb2a92a1521fb6a9ba96a5" - -brcast@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/brcast/-/brcast-2.0.1.tgz#4311508f0634a6f5a2465b6cf2db27f06902aaca" - -browserslist@^1.0.1, browserslist@^1.5.2, browserslist@^1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.7.5.tgz#eca4713897b51e444283241facf3985de49a9e2b" - dependencies: - caniuse-db "^1.0.30000624" - electron-to-chromium "^1.2.3" - -buffer@^5.0.3: - version "5.0.5" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.0.5.tgz#35c9393244a90aff83581063d16f0882cecc9418" - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - -caniuse-api@^1.5.2: - version "1.5.3" - resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-1.5.3.tgz#5018e674b51c393e4d50614275dc017e27c4a2a2" - dependencies: - browserslist "^1.0.1" - caniuse-db "^1.0.30000346" - lodash.memoize "^4.1.0" - lodash.uniq "^4.3.0" - -caniuse-db@^1.0.30000346, caniuse-db@^1.0.30000624: - version "1.0.30000628" - resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000628.tgz#3d010e2a8e2537a8d135792e90e4f2ce0eb838cc" - -chalk@^1.1.0, chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -clap@^1.0.9: - version "1.1.2" - resolved "https://registry.yarnpkg.com/clap/-/clap-1.1.2.tgz#316545bf22229225a2cecaa6824cd2f56a9709ed" - dependencies: - chalk "^1.1.3" - -classnames@^2.2.5: - version "2.2.5" - resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.5.tgz#fb3801d453467649ef3603c7d61a02bd129bde6d" - -clone@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - -coa@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/coa/-/coa-1.0.1.tgz#7f959346cfc8719e3f7233cd6852854a7c67d8a3" - dependencies: - q "^1.1.2" - -color-convert@^1.3.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" - dependencies: - color-name "^1.1.1" - -color-name@^1.0.0, color-name@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" - -color-string@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/color-string/-/color-string-0.3.0.tgz#27d46fb67025c5c2fa25993bfbf579e47841b991" - dependencies: - color-name "^1.0.0" - -color@^0.11.0: - version "0.11.4" - resolved "https://registry.yarnpkg.com/color/-/color-0.11.4.tgz#6d7b5c74fb65e841cd48792ad1ed5e07b904d764" - dependencies: - clone "^1.0.2" - color-convert "^1.3.0" - color-string "^0.3.0" - -colormin@^1.0.5: - version "1.1.2" - resolved "https://registry.yarnpkg.com/colormin/-/colormin-1.1.2.tgz#ea2f7420a72b96881a38aae59ec124a6f7298133" - dependencies: - color "^0.11.0" - css-color-names "0.0.4" - has "^1.0.1" - -colors@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" - -convert-source-map@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" - -core-js@^1.0.0: - version "1.2.7" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" - -core-js@^2.4.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" - -cosmiconfig@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-3.1.0.tgz#640a94bf9847f321800403cd273af60665c73397" - dependencies: - is-directory "^0.3.1" - js-yaml "^3.9.0" - parse-json "^3.0.0" - require-from-string "^2.0.1" - -create-react-class@^15.6.0: - version "15.6.0" - resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.0.tgz#ab448497c26566e1e29413e883207d57cfe7bed4" - dependencies: - fbjs "^0.8.9" - loose-envify "^1.3.1" - object-assign "^4.1.1" - -css-color-keywords@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/css-color-keywords/-/css-color-keywords-1.0.0.tgz#fea2616dc676b2962686b3af8dbdbe180b244e05" - -css-color-names@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.4.tgz#808adc2e79cf84738069b646cb20ec27beb629e0" - -css-in-js-utils@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/css-in-js-utils/-/css-in-js-utils-1.0.3.tgz#9ac7e02f763cf85d94017666565ed68a5b5f3215" - dependencies: - hyphenate-style-name "^1.0.2" - -css-loader@^0.28.7: - version "0.28.7" - resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-0.28.7.tgz#5f2ee989dd32edd907717f953317656160999c1b" - dependencies: - babel-code-frame "^6.11.0" - css-selector-tokenizer "^0.7.0" - cssnano ">=2.6.1 <4" - icss-utils "^2.1.0" - loader-utils "^1.0.2" - lodash.camelcase "^4.3.0" - object-assign "^4.0.1" - postcss "^5.0.6" - postcss-modules-extract-imports "^1.0.0" - postcss-modules-local-by-default "^1.0.1" - postcss-modules-scope "^1.0.0" - postcss-modules-values "^1.1.0" - postcss-value-parser "^3.3.0" - source-list-map "^2.0.0" - -css-selector-tokenizer@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/css-selector-tokenizer/-/css-selector-tokenizer-0.6.0.tgz#6445f582c7930d241dcc5007a43d6fcb8f073152" - dependencies: - cssesc "^0.1.0" - fastparse "^1.1.1" - regexpu-core "^1.0.0" - -css-selector-tokenizer@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/css-selector-tokenizer/-/css-selector-tokenizer-0.7.0.tgz#e6988474ae8c953477bf5e7efecfceccd9cf4c86" - dependencies: - cssesc "^0.1.0" - fastparse "^1.1.1" - regexpu-core "^1.0.0" - -css-to-react-native@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/css-to-react-native/-/css-to-react-native-2.0.3.tgz#7d3a11409ac283acef447a13d3bbd09980c68a4f" - dependencies: - css-color-keywords "^1.0.0" - fbjs "^0.8.5" - postcss-value-parser "^3.3.0" - -css-vendor@^0.3.8: - version "0.3.8" - resolved "https://registry.yarnpkg.com/css-vendor/-/css-vendor-0.3.8.tgz#6421cfd3034ce664fe7673972fd0119fc28941fa" - dependencies: - is-in-browser "^1.0.2" - -cssesc@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-0.1.0.tgz#c814903e45623371a0477b40109aaafbeeaddbb4" - -"cssnano@>=2.6.1 <4": - version "3.10.0" - resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-3.10.0.tgz#4f38f6cea2b9b17fa01490f23f1dc68ea65c1c38" - dependencies: - autoprefixer "^6.3.1" - decamelize "^1.1.2" - defined "^1.0.0" - has "^1.0.1" - object-assign "^4.0.1" - postcss "^5.0.14" - postcss-calc "^5.2.0" - postcss-colormin "^2.1.8" - postcss-convert-values "^2.3.4" - postcss-discard-comments "^2.0.4" - postcss-discard-duplicates "^2.0.1" - postcss-discard-empty "^2.0.1" - postcss-discard-overridden "^0.1.1" - postcss-discard-unused "^2.2.1" - postcss-filter-plugins "^2.0.0" - postcss-merge-idents "^2.1.5" - postcss-merge-longhand "^2.0.1" - postcss-merge-rules "^2.0.3" - postcss-minify-font-values "^1.0.2" - postcss-minify-gradients "^1.0.1" - postcss-minify-params "^1.0.4" - postcss-minify-selectors "^2.0.4" - postcss-normalize-charset "^1.1.0" - postcss-normalize-url "^3.0.7" - postcss-ordered-values "^2.1.0" - postcss-reduce-idents "^2.2.2" - postcss-reduce-initial "^1.0.0" - postcss-reduce-transforms "^1.0.3" - postcss-svgo "^2.1.1" - postcss-unique-selectors "^2.0.2" - postcss-value-parser "^3.2.3" - postcss-zindex "^2.0.1" - -csso@~2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/csso/-/csso-2.3.1.tgz#4f8d91a156f2f1c2aebb40b8fb1b5eb83d94d3b9" - dependencies: - clap "^1.0.9" - source-map "^0.5.3" - -debounce@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.0.2.tgz#503cc674d8d7f737099664fb75ddbd36b9626dc6" - -decamelize@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - -deep-assign@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/deep-assign/-/deep-assign-2.0.0.tgz#ebe06b1f07f08dae597620e3dd1622f371a1c572" - dependencies: - is-obj "^1.0.0" - -defined@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" - -deline@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/deline/-/deline-1.0.4.tgz#6c05c87836926e1a1c63e47882f3d2eb2c6f14c9" - -detect-indent@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" - dependencies: - repeating "^2.0.0" - -electron-to-chromium@^1.2.3: - version "1.2.4" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.2.4.tgz#9751cbea89fa120bf88c226ba41eb8d0b6f1b597" - -emojis-list@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" - -emotion-utils@^8.0.9: - version "8.0.9" - resolved "https://registry.yarnpkg.com/emotion-utils/-/emotion-utils-8.0.9.tgz#458c7676de2f5206b0b796f7c96c53a5970ed9f2" - -emotion@^8.0.9: - version "8.0.9" - resolved "https://registry.yarnpkg.com/emotion/-/emotion-8.0.9.tgz#788cf2c3ccd59becbd3e78eb01bef22ff20cf381" - dependencies: - babel-plugin-emotion "^8.0.9" - emotion-utils "^8.0.9" - stylis "^3.3.2" - stylis-rule-sheet "^0.0.5" - -encoding@^0.1.11: - version "0.1.12" - resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" - dependencies: - iconv-lite "~0.4.13" - -error-ex@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" - dependencies: - is-arrayish "^0.2.1" - -escape-string-regexp@^1.0.2: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - -esprima@^2.6.0: - version "2.7.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" - -esprima@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" - -esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - -exenv@^1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/exenv/-/exenv-1.2.2.tgz#2ae78e85d9894158670b03d47bec1f03bd91bb9d" - -fast-deep-equal@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-0.1.0.tgz#5c6f4599aba6b333ee3342e2ed978672f1001f8d" - -fastparse@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.1.tgz#d1e2643b38a94d7583b479060e6c4affc94071f8" - -fbjs@^0.8.12: - 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" - loose-envify "^1.0.0" - object-assign "^4.1.0" - promise "^7.1.1" - setimmediate "^1.0.5" - ua-parser-js "^0.7.9" - -fbjs@^0.8.5, fbjs@^0.8.9: - version "0.8.12" - resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.12.tgz#10b5d92f76d45575fd63a217d4ea02bea2f8ed04" - dependencies: - core-js "^1.0.0" - isomorphic-fetch "^2.1.1" - loose-envify "^1.0.0" - object-assign "^4.1.0" - promise "^7.1.1" - setimmediate "^1.0.5" - ua-parser-js "^0.7.9" - -flatten@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782" - -flexibility@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/flexibility/-/flexibility-2.0.1.tgz#ad323aafc40f469ce624286518fc4d7cd72b7c77" - -function-bind@^1.0.2: - version "1.1.0" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" - -glamor@^2.20.40: - version "2.20.40" - resolved "https://registry.yarnpkg.com/glamor/-/glamor-2.20.40.tgz#f606660357b7cf18dface731ad1a2cfa93817f05" - dependencies: - fbjs "^0.8.12" - inline-style-prefixer "^3.0.6" - object-assign "^4.1.1" - prop-types "^15.5.10" - through "^2.3.8" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - dependencies: - ansi-regex "^2.0.0" - -has-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" - -has-flag@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" - -has@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" - dependencies: - function-bind "^1.0.2" - -hoist-non-react-statics@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb" - -html-comment-regex@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/html-comment-regex/-/html-comment-regex-1.1.1.tgz#668b93776eaae55ebde8f3ad464b307a4963625e" - -hyphenate-style-name@^1.0.1, hyphenate-style-name@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.2.tgz#31160a36930adaf1fc04c6074f7eb41465d4ec4b" - -iconv-lite@~0.4.13: - version "0.4.15" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb" - -icss-replace-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/icss-replace-symbols/-/icss-replace-symbols-1.0.2.tgz#cb0b6054eb3af6edc9ab1d62d01933e2d4c8bfa5" - -icss-utils@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-2.1.0.tgz#83f0a0ec378bf3246178b6c2ad9136f135b1c962" - dependencies: - postcss "^6.0.1" - -ieee754@^1.1.4: - version "1.1.8" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" - -ifvisible.js@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/ifvisible.js/-/ifvisible.js-1.0.6.tgz#52eb151ce89c56f15316226462e892d1f8451261" - -indexes-of@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" - -inherits@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" - -inline-style-prefixer@^2.0.1, inline-style-prefixer@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/inline-style-prefixer/-/inline-style-prefixer-2.0.5.tgz#c153c7e88fd84fef5c602e95a8168b2770671fe7" - dependencies: - bowser "^1.0.0" - hyphenate-style-name "^1.0.1" - -inline-style-prefixer@^3.0.1, inline-style-prefixer@^3.0.6: - version "3.0.6" - resolved "https://registry.yarnpkg.com/inline-style-prefixer/-/inline-style-prefixer-3.0.6.tgz#b27fe309b4168a31eaf38c8e8c60ab9e7c11731f" - dependencies: - bowser "^1.6.0" - css-in-js-utils "^1.0.3" - -invariant@^2.2.0, invariant@^2.2.1: - version "2.2.2" - resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" - dependencies: - loose-envify "^1.0.0" - -is-absolute-url@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-2.1.0.tgz#50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - -is-directory@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" - -is-finite@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" - dependencies: - number-is-nan "^1.0.0" - -is-function@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" - -is-in-browser@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-in-browser/-/is-in-browser-1.0.2.tgz#f688bea8f1e5aadc3244ebc870d188cfb9b613cf" - -is-obj@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" - -is-plain-obj@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - -is-plain-object@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.1.tgz#4d7ca539bc9db9b737b8acb612f2318ef92f294f" - dependencies: - isobject "^1.0.0" - -is-stream@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - -is-svg@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-svg/-/is-svg-2.1.0.tgz#cf61090da0d9efbcab8722deba6f032208dbb0e9" - dependencies: - html-comment-regex "^1.1.0" - -isobject@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-1.0.2.tgz#f0f9b8ce92dd540fa0740882e3835a2e022ec78a" - -isomorphic-fetch@^2.1.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" - dependencies: - node-fetch "^1.0.1" - whatwg-fetch ">=0.10.0" - -js-base64@^2.1.9: - version "2.1.9" - resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.1.9.tgz#f0e80ae039a4bd654b5f281fc93f04a914a7fcce" - -js-tokens@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" - -js-yaml@^3.9.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -js-yaml@~3.7.0: - version "3.7.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80" - dependencies: - argparse "^1.0.7" - esprima "^2.6.0" - -jsesc@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" - -jsesc@~0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" - -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" - -json-stable-stringify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - dependencies: - jsonify "~0.0.0" - -json5@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - -jsonify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - -jss-camel-case@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/jss-camel-case/-/jss-camel-case-5.0.0.tgz#886c1fe56a8a11577454d6a8b4133caa6c1f53a0" - -jss-compose@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jss-compose/-/jss-compose-4.0.0.tgz#f0109e8e8301a2678279301c24523dbc76115b9b" - dependencies: - warning "^3.0.0" - -jss-default-unit@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/jss-default-unit/-/jss-default-unit-7.0.0.tgz#176c1db91da870e3ad16301f6f4b4cfc6fe1e90a" - -jss-expand@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jss-expand/-/jss-expand-4.0.0.tgz#71ec15386d7839bb23892acf9dcaa40b7fe9c785" - -jss-extend@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/jss-extend/-/jss-extend-5.0.0.tgz#08a1d4015d05dfe011e3a281457d471226865387" - dependencies: - warning "^3.0.0" - -jss-global@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/jss-global/-/jss-global-2.0.0.tgz#a162f822f17e5d760151d908bdb41d7f2824c28f" - -jss-nested@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/jss-nested/-/jss-nested-5.0.0.tgz#c0752f31f2d465110d7de6ac83583dbed669faa0" - dependencies: - warning "^3.0.0" - -jss-preset-default@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/jss-preset-default/-/jss-preset-default-3.0.0.tgz#e43ee1ac526f689baf2bfd28ae95a6fdc3a02663" - dependencies: - jss-camel-case "^5.0.0" - jss-compose "^4.0.0" - jss-default-unit "^7.0.0" - jss-expand "^4.0.0" - jss-extend "^5.0.0" - jss-global "^2.0.0" - jss-nested "^5.0.0" - jss-props-sort "^5.0.0" - jss-vendor-prefixer "^6.0.0" - -jss-props-sort@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/jss-props-sort/-/jss-props-sort-5.0.0.tgz#8839c88433f64e8c1dab1a7068796f19b84f9195" - -jss-vendor-prefixer@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/jss-vendor-prefixer/-/jss-vendor-prefixer-6.0.0.tgz#be58124f0cbed76e98cc8eb5219dbb260f057d0b" - dependencies: - css-vendor "^0.3.8" - -jss@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/jss/-/jss-8.1.0.tgz#b32f15efcce22446dfda4c2be09a04f38431da0a" - dependencies: - is-in-browser "^1.0.2" - warning "^3.0.0" - -loader-utils@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.0.2.tgz#a9f923c865a974623391a8602d031137fad74830" - dependencies: - big.js "^3.1.3" - emojis-list "^2.0.0" - json5 "^0.5.0" - -lodash.camelcase@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" - -lodash.memoize@^4.1.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" - -lodash.uniq@^4.3.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" - -lodash@^4.17.1, lodash@^4.17.4: - version "4.17.4" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" - -loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" - dependencies: - js-tokens "^3.0.0" - -macaddress@^0.2.8: - version "0.2.8" - resolved "https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12" - -marky@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/marky/-/marky-1.2.0.tgz#9617ed647bbbea8f45d19526da33dec70606df42" - -math-expression-evaluator@^1.2.14: - version "1.2.16" - resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.16.tgz#b357fa1ca9faefb8e48d10c14ef2bcb2d9f0a7c9" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -mkdirp@~0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - -node-fetch@^1.0.1: - version "1.6.3" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.6.3.tgz#dc234edd6489982d58e8f0db4f695029abcd8c04" - dependencies: - encoding "^0.1.11" - is-stream "^1.0.1" - -nopt@~1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" - dependencies: - abbrev "1" - -normalize-css-color@^1.0.1, normalize-css-color@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/normalize-css-color/-/normalize-css-color-1.0.2.tgz#02991e97cccec6623fe573afbbf0de6a1f3e9f8d" - -normalize-range@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" - -normalize-url@^1.4.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-1.9.0.tgz#c2bb50035edee62cd81edb2d45da68dc25e3423e" - dependencies: - object-assign "^4.0.1" - prepend-http "^1.0.0" - query-string "^4.1.0" - sort-keys "^1.0.0" - -num2fraction@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - -object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - -parse-json@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-3.0.0.tgz#fa6f47b18e23826ead32f263e744d0e1e847fb13" - dependencies: - error-ex "^1.3.1" - -postcss-calc@^5.2.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-5.3.1.tgz#77bae7ca928ad85716e2fda42f261bf7c1d65b5e" - dependencies: - postcss "^5.0.2" - postcss-message-helpers "^2.0.0" - reduce-css-calc "^1.2.6" - -postcss-colormin@^2.1.8: - version "2.2.2" - resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-2.2.2.tgz#6631417d5f0e909a3d7ec26b24c8a8d1e4f96e4b" - dependencies: - colormin "^1.0.5" - postcss "^5.0.13" - postcss-value-parser "^3.2.3" - -postcss-convert-values@^2.3.4: - version "2.6.1" - resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-2.6.1.tgz#bbd8593c5c1fd2e3d1c322bb925dcae8dae4d62d" - dependencies: - postcss "^5.0.11" - postcss-value-parser "^3.1.2" - -postcss-discard-comments@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-2.0.4.tgz#befe89fafd5b3dace5ccce51b76b81514be00e3d" - dependencies: - postcss "^5.0.14" - -postcss-discard-duplicates@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-2.0.2.tgz#02be520e91571ffb10738766a981d5770989bb32" - dependencies: - postcss "^5.0.4" - -postcss-discard-empty@^2.0.1: - version "2.1.0" - resolved "https://registry.yarnpkg.com/postcss-discard-empty/-/postcss-discard-empty-2.1.0.tgz#d2b4bd9d5ced5ebd8dcade7640c7d7cd7f4f92b5" - dependencies: - postcss "^5.0.14" - -postcss-discard-overridden@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-0.1.1.tgz#8b1eaf554f686fb288cd874c55667b0aa3668d58" - dependencies: - postcss "^5.0.16" - -postcss-discard-unused@^2.2.1: - version "2.2.3" - resolved "https://registry.yarnpkg.com/postcss-discard-unused/-/postcss-discard-unused-2.2.3.tgz#bce30b2cc591ffc634322b5fb3464b6d934f4433" - dependencies: - postcss "^5.0.14" - uniqs "^2.0.0" - -postcss-filter-plugins@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/postcss-filter-plugins/-/postcss-filter-plugins-2.0.2.tgz#6d85862534d735ac420e4a85806e1f5d4286d84c" - dependencies: - postcss "^5.0.4" - uniqid "^4.0.0" - -postcss-merge-idents@^2.1.5: - version "2.1.7" - resolved "https://registry.yarnpkg.com/postcss-merge-idents/-/postcss-merge-idents-2.1.7.tgz#4c5530313c08e1d5b3bbf3d2bbc747e278eea270" - dependencies: - has "^1.0.1" - postcss "^5.0.10" - postcss-value-parser "^3.1.1" - -postcss-merge-longhand@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-2.0.2.tgz#23d90cd127b0a77994915332739034a1a4f3d658" - dependencies: - postcss "^5.0.4" - -postcss-merge-rules@^2.0.3: - version "2.1.2" - resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-2.1.2.tgz#d1df5dfaa7b1acc3be553f0e9e10e87c61b5f721" - dependencies: - browserslist "^1.5.2" - caniuse-api "^1.5.2" - postcss "^5.0.4" - postcss-selector-parser "^2.2.2" - vendors "^1.0.0" - -postcss-message-helpers@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/postcss-message-helpers/-/postcss-message-helpers-2.0.0.tgz#a4f2f4fab6e4fe002f0aed000478cdf52f9ba60e" - -postcss-minify-font-values@^1.0.2: - version "1.0.5" - resolved "https://registry.yarnpkg.com/postcss-minify-font-values/-/postcss-minify-font-values-1.0.5.tgz#4b58edb56641eba7c8474ab3526cafd7bbdecb69" - dependencies: - object-assign "^4.0.1" - postcss "^5.0.4" - postcss-value-parser "^3.0.2" - -postcss-minify-gradients@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-1.0.5.tgz#5dbda11373703f83cfb4a3ea3881d8d75ff5e6e1" - dependencies: - postcss "^5.0.12" - postcss-value-parser "^3.3.0" - -postcss-minify-params@^1.0.4: - version "1.2.2" - resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-1.2.2.tgz#ad2ce071373b943b3d930a3fa59a358c28d6f1f3" - dependencies: - alphanum-sort "^1.0.1" - postcss "^5.0.2" - postcss-value-parser "^3.0.2" - uniqs "^2.0.0" - -postcss-minify-selectors@^2.0.4: - version "2.1.1" - resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-2.1.1.tgz#b2c6a98c0072cf91b932d1a496508114311735bf" - dependencies: - alphanum-sort "^1.0.2" - has "^1.0.1" - postcss "^5.0.14" - postcss-selector-parser "^2.0.0" - -postcss-modules-extract-imports@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.0.1.tgz#8fb3fef9a6dd0420d3f6d4353cf1ff73f2b2a341" - dependencies: - postcss "^5.0.4" - -postcss-modules-local-by-default@^1.0.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-1.1.1.tgz#29a10673fa37d19251265ca2ba3150d9040eb4ce" - dependencies: - css-selector-tokenizer "^0.6.0" - postcss "^5.0.4" - -postcss-modules-scope@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-1.0.2.tgz#ff977395e5e06202d7362290b88b1e8cd049de29" - dependencies: - css-selector-tokenizer "^0.6.0" - postcss "^5.0.4" - -postcss-modules-values@^1.1.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-1.2.2.tgz#f0e7d476fe1ed88c5e4c7f97533a3e772ad94ca1" - dependencies: - icss-replace-symbols "^1.0.2" - postcss "^5.0.14" - -postcss-normalize-charset@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-charset/-/postcss-normalize-charset-1.1.1.tgz#ef9ee71212d7fe759c78ed162f61ed62b5cb93f1" - dependencies: - postcss "^5.0.5" - -postcss-normalize-url@^3.0.7: - version "3.0.8" - resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-3.0.8.tgz#108f74b3f2fcdaf891a2ffa3ea4592279fc78222" - dependencies: - is-absolute-url "^2.0.0" - normalize-url "^1.4.0" - postcss "^5.0.14" - postcss-value-parser "^3.2.3" - -postcss-ordered-values@^2.1.0: - version "2.2.3" - resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-2.2.3.tgz#eec6c2a67b6c412a8db2042e77fe8da43f95c11d" - dependencies: - postcss "^5.0.4" - postcss-value-parser "^3.0.1" - -postcss-reduce-idents@^2.2.2: - version "2.4.0" - resolved "https://registry.yarnpkg.com/postcss-reduce-idents/-/postcss-reduce-idents-2.4.0.tgz#c2c6d20cc958284f6abfbe63f7609bf409059ad3" - dependencies: - postcss "^5.0.4" - postcss-value-parser "^3.0.2" - -postcss-reduce-initial@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-1.0.1.tgz#68f80695f045d08263a879ad240df8dd64f644ea" - dependencies: - postcss "^5.0.4" - -postcss-reduce-transforms@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/postcss-reduce-transforms/-/postcss-reduce-transforms-1.0.4.tgz#ff76f4d8212437b31c298a42d2e1444025771ae1" - dependencies: - has "^1.0.1" - postcss "^5.0.8" - postcss-value-parser "^3.0.1" - -postcss-selector-parser@^2.0.0, postcss-selector-parser@^2.2.2: - version "2.2.3" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-2.2.3.tgz#f9437788606c3c9acee16ffe8d8b16297f27bb90" - dependencies: - flatten "^1.0.2" - indexes-of "^1.0.1" - uniq "^1.0.1" - -postcss-svgo@^2.1.1: - version "2.1.6" - resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-2.1.6.tgz#b6df18aa613b666e133f08adb5219c2684ac108d" - dependencies: - is-svg "^2.0.0" - postcss "^5.0.14" - postcss-value-parser "^3.2.3" - svgo "^0.7.0" - -postcss-unique-selectors@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-2.0.2.tgz#981d57d29ddcb33e7b1dfe1fd43b8649f933ca1d" - dependencies: - alphanum-sort "^1.0.1" - postcss "^5.0.4" - uniqs "^2.0.0" - -postcss-value-parser@^3.0.1, postcss-value-parser@^3.0.2, postcss-value-parser@^3.1.1, postcss-value-parser@^3.1.2, postcss-value-parser@^3.2.3, postcss-value-parser@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz#87f38f9f18f774a4ab4c8a232f5c5ce8872a9d15" - -postcss-zindex@^2.0.1: - version "2.2.0" - resolved "https://registry.yarnpkg.com/postcss-zindex/-/postcss-zindex-2.2.0.tgz#d2109ddc055b91af67fc4cb3b025946639d2af22" - dependencies: - has "^1.0.1" - postcss "^5.0.4" - uniqs "^2.0.0" - -postcss@^5.0.10, postcss@^5.0.11, postcss@^5.0.12, postcss@^5.0.13, postcss@^5.0.14, postcss@^5.0.16, postcss@^5.0.2, postcss@^5.0.4, postcss@^5.0.5, postcss@^5.0.6, postcss@^5.0.8, postcss@^5.2.15: - version "5.2.15" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-5.2.15.tgz#a9e8685e50e06cc5b3fdea5297273246c26f5b30" - dependencies: - chalk "^1.1.3" - js-base64 "^2.1.9" - source-map "^0.5.6" - supports-color "^3.2.3" - -postcss@^6.0.1: - version "6.0.3" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.3.tgz#b7f565b3d956fbb8565ca7c1e239d0506e427d8b" - dependencies: - chalk "^1.1.3" - source-map "^0.5.6" - supports-color "^4.0.0" - -prepend-http@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - -promise@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/promise/-/promise-7.1.1.tgz#489654c692616b8aa55b0724fa809bb7db49c5bf" - dependencies: - asap "~2.0.3" - -prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.8, prop-types@^15.5.9: - 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" - -q@^1.1.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e" - -query-string@^4.1.0: - version "4.3.2" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.3.2.tgz#ec0fd765f58a50031a3968c2431386f8947a5cdd" - dependencies: - object-assign "^4.1.0" - strict-uri-encode "^1.0.0" - -radium@^0.19.6: - version "0.19.6" - resolved "https://registry.yarnpkg.com/radium/-/radium-0.19.6.tgz#b86721d08dbd303b061a4ae2ebb06cc6e335ae72" - dependencies: - array-find "^1.0.0" - exenv "^1.2.1" - inline-style-prefixer "^2.0.5" - prop-types "^15.5.8" - -react-jss@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/react-jss/-/react-jss-7.2.0.tgz#30a5ed51d8388a33767c6d19790b222c1f33f48f" - dependencies: - hoist-non-react-statics "^1.2.0" - jss "^8.1.0" - jss-preset-default "^3.0.0" - prop-types "^15.5.8" - theming "^1.1.0" - -react-native-web@0.0.x: - version "0.0.116" - resolved "https://registry.yarnpkg.com/react-native-web/-/react-native-web-0.0.116.tgz#e05e376b34617a54d61826e4bc06b0bdbfd3f4b2" - dependencies: - animated "^0.2.0" - array-find-index "^1.0.2" - babel-runtime "^6.23.0" - create-react-class "^15.6.0" - debounce "1.0.2" - deep-assign "^2.0.0" - fbjs "^0.8.12" - hyphenate-style-name "^1.0.2" - inline-style-prefixer "^3.0.6" - normalize-css-color "^1.0.2" - prop-types "^15.5.10" - react-timer-mixin "^0.13.3" - -react-primitives@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/react-primitives/-/react-primitives-0.4.3.tgz#4970afda5a32dccf5ea180380e3a0e16192e4b83" - dependencies: - animated "^0.1.5" - asap "^2.0.5" - deline "^1.0.4" - flexibility "^2.0.1" - inline-style-prefixer "^2.0.5" - invariant "^2.2.1" - normalize-css-color "^1.0.1" - prop-types "^15.5.10" - react-native-web "0.0.x" - react-timer-mixin "^0.13.3" - string-hash "^1.1.3" - -react-timer-mixin@^0.13.3: - version "0.13.3" - resolved "https://registry.yarnpkg.com/react-timer-mixin/-/react-timer-mixin-0.13.3.tgz#0da8b9f807ec07dc3e854d082c737c65605b3d22" - -react@^15.5.4: - version "15.6.1" - resolved "https://registry.yarnpkg.com/react/-/react-15.6.1.tgz#baa8434ec6780bde997cdc380b79cd33b96393df" - 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" - -reactxp@^0.42.11: - version "0.42.11" - resolved "https://registry.yarnpkg.com/reactxp/-/reactxp-0.42.11.tgz#ec88014e354ddc627fea61ab6639e5970edb85ae" - dependencies: - "@types/lodash" "4.14.66" - assert "^1.3.0" - ifvisible.js "^1.0.6" - lodash "^4.17.1" - prop-types "^15.5.9" - rebound "^0.0.13" - subscribableevent "^1.0.0" - synctasks "^0.2.9" - -rebound@^0.0.13: - version "0.0.13" - resolved "https://registry.yarnpkg.com/rebound/-/rebound-0.0.13.tgz#4a225254caf7da756797b19c5817bf7a7941fac1" - -reduce-css-calc@^1.2.6: - version "1.3.0" - resolved "https://registry.yarnpkg.com/reduce-css-calc/-/reduce-css-calc-1.3.0.tgz#747c914e049614a4c9cfbba629871ad1d2927716" - dependencies: - balanced-match "^0.4.2" - math-expression-evaluator "^1.2.14" - reduce-function-call "^1.0.1" - -reduce-function-call@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/reduce-function-call/-/reduce-function-call-1.0.2.tgz#5a200bf92e0e37751752fe45b0ab330fd4b6be99" - dependencies: - balanced-match "^0.4.2" - -regenerate@^1.2.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260" - -regenerator-runtime@^0.10.0: - version "0.10.5" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" - -regenerator-runtime@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz#7e54fe5b5ccd5d6624ea6255c3473be090b802e1" - -regexpu-core@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-1.0.0.tgz#86a763f58ee4d7c2f6b102e4764050de7ed90c6b" - dependencies: - regenerate "^1.2.1" - regjsgen "^0.2.0" - regjsparser "^0.1.4" - -regjsgen@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" - -regjsparser@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" - dependencies: - jsesc "~0.5.0" - -repeating@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" - dependencies: - is-finite "^1.0.0" - -require-from-string@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.1.tgz#c545233e9d7da6616e9d59adfb39fc9f588676ff" - -sax@~1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.2.tgz#fd8631a23bc7826bef5d871bdb87378c95647828" - -schema-utils@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.3.0.tgz#f5877222ce3e931edae039f17eb3716e7137f8cf" - dependencies: - ajv "^5.0.0" - -setimmediate@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - -sort-keys@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" - dependencies: - is-plain-obj "^1.0.0" - -source-list-map@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085" - -source-map@^0.5.3, source-map@^0.5.6: - version "0.5.6" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" - -source-map@^0.5.7: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - -strict-uri-encode@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" - -string-hash@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/string-hash/-/string-hash-1.1.3.tgz#e8aafc0ac1855b4666929ed7dd1275df5d6c811b" - -strip-ansi@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -style-loader@^0.19.0: - version "0.19.0" - resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.19.0.tgz#7258e788f0fee6a42d710eaf7d6c2412a4c50759" - dependencies: - loader-utils "^1.0.2" - schema-utils "^0.3.0" - -styled-components@^2.2.3: - version "2.2.3" - resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-2.2.3.tgz#154575c269880c840f903f580287dab155cf684c" - dependencies: - buffer "^5.0.3" - css-to-react-native "^2.0.3" - fbjs "^0.8.9" - hoist-non-react-statics "^1.2.0" - is-function "^1.0.1" - is-plain-object "^2.0.1" - prop-types "^15.5.4" - stylis "3.x" - supports-color "^3.2.3" - -styletron-client@^2.5.7: - version "2.5.7" - resolved "https://registry.yarnpkg.com/styletron-client/-/styletron-client-2.5.7.tgz#104fa4dc564cd3fe78eb92488e5ef9039c9e242f" - dependencies: - styletron-core "^2.5.7" - -styletron-core@^2.5.7: - version "2.5.7" - resolved "https://registry.yarnpkg.com/styletron-core/-/styletron-core-2.5.7.tgz#2c4a1fae537b42235462e438c24ab619bbf8993e" - -styletron-utils@^2.5.4: - version "2.5.4" - resolved "https://registry.yarnpkg.com/styletron-utils/-/styletron-utils-2.5.4.tgz#f08cca7d58ee0338ce85e408cb32900e65620240" - dependencies: - inline-style-prefixer "^2.0.1" - -stylis-rule-sheet@^0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/stylis-rule-sheet/-/stylis-rule-sheet-0.0.5.tgz#ebae935cc1f6fb31b9b62dba47f2ea8b833dad9f" - -stylis@3.x, stylis@^3.3.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/stylis/-/stylis-3.4.0.tgz#55c6530ebceeca5976d54fb4adc67578afee828d" - -subscribableevent@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/subscribableevent/-/subscribableevent-1.0.0.tgz#bde9500fa9009c7740c924109bac6119cd9898e6" - dependencies: - "@types/lodash" "^4.14.64" - lodash "^4.17.4" - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - -supports-color@^3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" - dependencies: - has-flag "^1.0.0" - -supports-color@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.0.0.tgz#33a7c680aa512c9d03ef929cacbb974d203d2790" - dependencies: - has-flag "^2.0.0" - -svgo@^0.7.0: - version "0.7.2" - resolved "https://registry.yarnpkg.com/svgo/-/svgo-0.7.2.tgz#9f5772413952135c6fefbf40afe6a4faa88b4bb5" - dependencies: - coa "~1.0.1" - colors "~1.1.2" - csso "~2.3.1" - js-yaml "~3.7.0" - mkdirp "~0.5.1" - sax "~1.2.1" - whet.extend "~0.9.9" - -synctasks@^0.2.9: - version "0.2.17" - resolved "https://registry.yarnpkg.com/synctasks/-/synctasks-0.2.17.tgz#38852f008878de2e941b6e458ddf552245268da1" - -theming@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/theming/-/theming-1.1.0.tgz#0562760b55a1b919c2d5eeb94130351f8958e13a" - dependencies: - brcast "^2.0.0" - is-function "^1.0.1" - is-plain-object "^2.0.1" - prop-types "^15.5.8" - react "^15.5.4" - -through@^2.3.8: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - -to-fast-properties@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" - -touch@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/touch/-/touch-1.0.0.tgz#449cbe2dbae5a8c8038e30d71fa0ff464947c4de" - dependencies: - nopt "~1.0.10" - -trim-right@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - -ua-parser-js@^0.7.9: - version "0.7.12" - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.12.tgz#04c81a99bdd5dc52263ea29d24c6bf8d4818a4bb" - -uniq@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" - -uniqid@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/uniqid/-/uniqid-4.1.1.tgz#89220ddf6b751ae52b5f72484863528596bb84c1" - dependencies: - macaddress "^0.2.8" - -uniqs@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02" - -util@0.10.3: - version "0.10.3" - resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" - dependencies: - inherits "2.0.1" - -vendors@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/vendors/-/vendors-1.0.1.tgz#37ad73c8ee417fb3d580e785312307d274847f22" - -warning@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/warning/-/warning-3.0.0.tgz#32e5377cb572de4ab04753bdf8821c01ed605b7c" - dependencies: - loose-envify "^1.0.0" - -whatwg-fetch@>=0.10.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.2.tgz#fe294d1d89e36c5be8b3195057f2e4bc74fc980e" - -whet.extend@~0.9.9: - version "0.9.9" - resolved "https://registry.yarnpkg.com/whet.extend/-/whet.extend-0.9.9.tgz#f877d5bf648c97e5aa542fadc16d6a259b9c11a1" diff --git a/docs/guides/getting-started.md b/docs/guides/getting-started.md deleted file mode 100644 index 9f7c8644b..000000000 --- a/docs/guides/getting-started.md +++ /dev/null @@ -1,221 +0,0 @@ -# Getting started - -This guide will help you to correctly configure build and test tools to work -with React Native for Web. (Alternatively, you can quickly setup a local -project using the starter kits listed in the README.) - -It is recommended that your application provide a `Promise` and `Array.from` -polyfill. - -## Web packager - -[Webpack](https://webpack.js.org) is a popular build tool for web apps. Below is an -example of how to configure a build that uses [Babel](https://babeljs.io/) to -compile your JavaScript for the web. - -Create a `web/webpack.config.js` file: - -```js -// web/webpack.config.js - -// This is needed for webpack to compile JavaScript. -// Many OSS React Native packages are not compiled to ES5 before being -// published. If you depend on uncompiled packages they may cause webpack build -// errors. To fix this webpack can be configured to compile to the necessary -// `node_module`. -const babelLoaderConfiguration = { - test: /\.js$/, - // Add every directory that needs to be compiled by Babel during the build - include: [ - path.resolve(__dirname, 'src'), - path.resolve(__dirname, 'node_modules/react-native-uncompiled') - ], - use: { - loader: 'babel-loader', - options: { - cacheDirectory: true, - // This aliases 'react-native' to 'react-native-web' and includes only - // the modules needed by the app - plugins: ['react-native-web/babel'], - // The 'react-native' preset is recommended (or use your own .babelrc) - presets: ['react-native'] - } - } -}; - -// This is needed for webpack to import static images in JavaScript files -const imageLoaderConfiguration = { - test: /\.(gif|jpe?g|png|svg)$/, - use: { - loader: 'url-loader', - options: { - name: '[name].[ext]' - } - } -}; - -module.exports = { - // ...the rest of your config - - module: { - rules: [ - babelLoaderConfiguration, - imageLoaderConfiguration - ] - }, - - plugins: [ - // `process.env.NODE_ENV === 'production'` must be `true` for production - // builds to eliminate development checks and reduce build size. You may - // wish to include additional optimizations. - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify('production') - }) - ], - - resolve: { - // If you're working on a multi-platform React Native app, web-specific - // module implementations should be written in files using the extension - // `.web.js`. - extensions: [ '.web.js', '.js' ] - } -} -``` - -To run in development: - -``` -./node_modules/.bin/webpack-dev-server -d --config web/webpack.config.js --inline --hot --colors -``` - -To build for production: - -``` -./node_modules/.bin/webpack -p --config web/webpack.config.js -``` - -Please refer to the Webpack documentation for more information on configuration. - -## Web entry - -Create a `index.web.js` file (or simply `index.js` for web-only apps). - -### Client-side rendering - -Rendering using `AppRegistry`: - -```js -// index.web.js - -import App from './src/App'; -import React from 'react'; -import ReactNative, { AppRegistry } from 'react-native'; - -// register the app -AppRegistry.registerComponent('App', () => App); - -AppRegistry.runApplication('App', { - initialProps: {}, - rootTag: document.getElementById('react-app') -}); -``` - -Rendering within existing web apps is also possible using `ReactNative`: - -```js -import AppHeader from './src/AppHeader'; -import React from 'react'; -import ReactNative from 'react-native'; - -// use .hydrate if hydrating a SSR app -ReactNative.render(, document.getElementById('react-app-header')) -``` - -And finally, `react-native-web` components will also be rendering within a tree -produced by calling `ReactDOM.render` (i.e., an existing web app), but -otherwise it is not recommended. - -### Server-side rendering - -Server-side rendering is supported using the `AppRegistry`: - -```js -import App from './src/App'; -import ReactDOMServer from 'react-dom/server' -import ReactNative, { AppRegistry } from 'react-native' - -// register the app -AppRegistry.registerComponent('App', () => App) - -// prerender the app -const { element, stylesheets } = AppRegistry.getApplication('App', { initialProps }); -const initialHTML = ReactDOMServer.renderToString(element); -const initialStyles = stylesheets.map((sheet) => ReactDOMServer.renderToStaticMarkup(sheet)).join('\n'); - -// construct HTML document -const document = ` - - - -${initialStyles} - - -${initialHTML} -` -``` - -## Web-specific code - -Minor platform differences can use the `Platform` module. - -```js -import { Platform } from 'react-native'; - -const styles = StyleSheet.create({ - height: (Platform.OS === 'web') ? 200 : 100, -}); -``` - -More significant platform differences should use platform-specific files (see -the webpack configuration above for resolving `*.web.js` files): - -For example, with the following files in your project: - -``` -MyComponent.android.js -MyComponent.ios.js -MyComponent.web.js -``` - -And the following import: - -```js -import MyComponent from './MyComponent'; -``` - -React Native will automatically import the correct variant for each specific -target platform. - -## Testing with Jest - -[Jest](https://facebook.github.io/jest/) can be configured to improve snapshots -of `react-native-web` components. - -``` -{ - "snapshotSerializers": [ "enzyme-to-json/serializer", "react-native-web/jest/serializer" ] -} -``` - -Jest also needs to map `react-native` to `react-native-web` (unless you are -using Babel with the `react-native-web/babel` plugin). - -``` -{ - "moduleNameMapper": { - "react-native": "/node_modules/react-native-web" - } -} -``` - -Please refer to the Jest documentation for more information. diff --git a/docs/guides/known-issues.md b/docs/guides/known-issues.md deleted file mode 100644 index 48bcb32fd..000000000 --- a/docs/guides/known-issues.md +++ /dev/null @@ -1,31 +0,0 @@ -# Known issues - -## Safari flexbox performance - -Safari version prior to 10.1 can suffer from extremely [poor flexbox -performance](https://bugs.webkit.org/show_bug.cgi?id=150445). The recommended -way to work around this issue (as used on mobile.twitter.com) is to set -`display:block` on Views in your element hierarchy that you know don't need -flexbox layout. - -## Missing modules and components - -Not all of the views present on iOS/Android are currently available on Web. We -are very much interested in the community's feedback on the next set of modules -and views. - -Not all the modules or views for iOS/Android can be implemented on Web. In some -cases it will be necessary to use a Web counterpart or to guard the use of a -module with `Platform.OS` (e.g. `NativeModules`) - -## Missing component props - -There are properties that do not work across all platforms. All web-specific -props are annotated with `(web)` in the documentation. - -## Platform parity - -There are some known issues in React Native where APIs could be made more -consistent between platforms. For example, React Native for Web includes -`ActivityIndicator` and a horizontal `ProgressBar` for Web use, in anticipation -of the convergence between the iOS and Android components in React Native. diff --git a/docs/package.json b/docs/package.json deleted file mode 100644 index 6776dd056..000000000 --- a/docs/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "scripts": { - "build": "yarn && build-storybook -o ./dist -c ./storybook/.storybook", - "start": "start-storybook -p 9001 -c ./storybook/.storybook", - "release": "yarn build && git checkout gh-pages && rm -rf ../storybook && mv dist ../storybook && git add -A && git commit -m \"Storybook deploy\" && git push origin gh-pages && git checkout -" - }, - "dependencies": { - "@storybook/addon-options": "^3.1.6", - "@storybook/react": "^3.1.9" - } -} diff --git a/docs/storybook/1-components/View/examples/PropPointerEvents.js b/docs/storybook/1-components/View/examples/PropPointerEvents.js deleted file mode 100644 index 095e237ee..000000000 --- a/docs/storybook/1-components/View/examples/PropPointerEvents.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @flow - */ - -import { logger } from '../helpers'; -import React from 'react'; -import { Text, TouchableHighlight, View } from 'react-native'; - -const ViewStyleExample = () => ( - - - - none - - - auto - - - box-only - - - box-none - - - -); - -export default ViewStyleExample; diff --git a/package.json b/package.json index 252716420..1b836efa0 100644 --- a/package.json +++ b/package.json @@ -1,126 +1,76 @@ { - "name": "react-native-web", - "version": "0.1.14", - "description": "React Native for Web", - "main": "dist/index.js", - "files": [ - "babel", - "dist", - "jest", - "src", - "!**/__tests__" - ], + "private": true, + "version": "0.5.0", + "name": "react-native-web-monorepo", "scripts": { - "benchmark": "cd benchmarks && yarn && webpack && open index.html", - "build": "yarn clean-dist && yarn compile && webpack --config webpack.config.js --sort-assets-by --progress", - "clean-dist": "del ./dist && mkdir dist", - "compile": "babel src -d dist --ignore *-test.js", - "docs:build": "cd docs && yarn build", - "docs:start": "cd docs && yarn && yarn start", - "docs:release": "cd docs && yarn release", + "clean": "del ./packages/*/dist", + "compile": "yarn clean && cd packages/react-native-web && babel src --out-dir dist --ignore \"**/__tests__\"", + "benchmarks": "cd packages/benchmarks && yarn build", + "benchmarks:release": "cd packages/benchmarks && yarn release", + "website": "cd website && yarn start", + "website:release": "cd website && yarn release", "flow": "flow", - "fmt": "find babel benchmarks docs jest src -name '*.js' | grep -v -E '(node_modules|dist)' | xargs yarn fmt:cmd", - "fmt:cmd": "prettier --print-width=100 --single-quote --write", - "jest": "jest", - "jest:watch": "yarn test -- --watch", - "lint": "yarn lint:cmd -- babel benchmarks docs jest src", - "lint:cmd": "eslint --ignore-path .gitignore --fix", + "fmt": "find packages scripts types website -name '*.js' | grep -v -E '(node_modules|dist|vendor)' | xargs yarn fmt:cmd", + "fmt:cmd": "prettier --write", + "jest": "jest --config ./scripts/jest/config.js", + "lint": "yarn lint:check --fix", + "lint:check": "eslint packages scripts website", "precommit": "lint-staged", - "release": "yarn lint && yarn test && yarn build && npm publish", - "test": "flow && jest" - }, - "babel": { - "presets": [ - "react-native" - ], - "plugins": [ - [ - "transform-react-remove-prop-types", - { - "mode": "wrap" - } - ] - ] - }, - "jest": { - "testEnvironment": "jsdom", - "timers": "fake", - "setupFiles": [ - "raf/polyfill" - ], - "setupTestFrameworkScriptFile": "/jest-setup-framework.js", - "snapshotSerializers": [ - "enzyme-to-json/serializer" - ] - }, - "lint-staged": { - "**/*.js": [ - "fmt:cmd", - "git update-index --again", - "lint:cmd" - ] - }, - "dependencies": { - "animated": "^0.2.0", - "array-find-index": "^1.0.2", - "babel-runtime": "^6.26.0", - "create-react-class": "^15.6.2", - "debounce": "1.0.2", - "deep-assign": "^2.0.0", - "fbjs": "^0.8.16", - "hyphenate-style-name": "^1.0.2", - "inline-style-prefixer": "^3.0.8", - "normalize-css-color": "^1.0.2", - "prop-types": "^15.6.0", - "react-timer-mixin": "^0.13.3" + "prerelease": "yarn test && yarn compile", + "release": "node ./scripts/release/publish.js", + "postrelease": "yarn website:release && yarn benchmarks:release", + "test": "yarn flow && yarn lint:check && yarn jest --runInBand" }, "devDependencies": { "babel-cli": "^6.26.0", "babel-core": "^6.26.0", - "babel-eslint": "^7.2.3", + "babel-eslint": "^8.0.3", "babel-loader": "^7.1.2", - "babel-plugin-tester": "^4.0.0", - "babel-plugin-transform-react-remove-prop-types": "^0.4.9", + "babel-plugin-transform-class-properties": "^6.24.1", + "babel-plugin-transform-object-rest-spread": "^6.26.0", + "babel-plugin-transform-react-remove-prop-types": "^0.4.10", + "babel-preset-env": "^1.6.1", + "babel-preset-flow": "^6.23.0", + "babel-preset-react": "^6.24.1", "babel-preset-react-native": "^4.0.0", "caniuse-api": "^2.0.0", "del-cli": "^1.1.0", - "enzyme": "^3.1.0", - "enzyme-adapter-react-16": "^1.0.2", - "enzyme-to-json": "^3.1.4", - "eslint": "^4.6.1", - "eslint-config-prettier": "^2.6.0", - "eslint-plugin-promise": "^3.5.0", - "eslint-plugin-react": "^7.4.0", - "file-loader": "^1.1.4", - "flow-bin": "^0.49.1", + "enzyme": "^3.3.0", + "enzyme-adapter-react-16": "^1.1.0", + "enzyme-to-json": "^3.2.2", + "eslint": "^4.12.1", + "eslint-config-prettier": "^2.9.0", + "eslint-plugin-promise": "^3.6.0", + "eslint-plugin-react": "^7.5.1", + "flow-bin": "^0.63.1", + "glob": "^7.1.2", + "husky": "^0.14.3", "jest": "^21.2.1", - "lint-staged": "^4.1.3", - "prettier": "^1.7.3", - "raf": "^3.3.2", - "react": "^16.0.0", - "react-dom": "^16.0.0", - "react-test-renderer": "^16.0.0", - "url-loader": "^0.5.9", - "webpack": "^3.6.0", - "webpack-bundle-analyzer": "^2.9.0" + "lint-staged": "^6.0.0", + "prettier": "^1.8.2", + "raf": "^3.4.0", + "react": "^16.2.0", + "react-dom": "^16.2.0", + "react-test-renderer": "^16.2.0" + }, + "workspaces": [ + "packages/*", + "website" + ], + "lint-staged": { + "**/*.js": [ + "fmt:cmd", + "git update-index --again", + "eslint" + ], + "packages/react-native-web/src/index.js": [ + "node ./scripts/babel/createModuleMap.js" + ] }, - "peerDependencies": { - "react": "16.x.x", - "react-dom": "16.x.x" + "prettier": { + "printWidth": 100, + "singleQuote": true }, "author": "Nicolas Gallagher", - "license": "BSD-3-Clause", - "repository": { - "type": "git", - "url": "git://github.com/necolas/react-native-web.git" - }, - "tags": [ - "react" - ], - "keywords": [ - "react", - "react-component", - "react-native", - "web" - ] + "license": "MIT" } diff --git a/packages/babel-plugin-react-native-web/README.md b/packages/babel-plugin-react-native-web/README.md new file mode 100644 index 000000000..0147fe297 --- /dev/null +++ b/packages/babel-plugin-react-native-web/README.md @@ -0,0 +1,44 @@ +# babel-plugin-react-native-web + +[![npm version][package-badge]][package-url] [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://reactjs.org/docs/how-to-contribute.html#your-first-pull-request) + +A Babel plugin that will alias `react-native` to `react-native-web` and exclude +any modules not required by your app (keeping bundle size down). + +## Installation + +``` +yarn add --dev babel-plugin-react-native-web +``` + +## Usage + +**.babelrc** + +``` +{ + "plugins": ["react-native-web"] +} +``` + +## Example + +NOTE: `react-native-web` internal paths are _not stable_ and you must not rely +on them. Always use the Babel plugin to optimize your build. What follows is an +example of the rewrite performed by the plugin. + +**Before** + +```js +import { StyleSheet, View } from 'react-native'; +``` + +**After** + +```js +import StyleSheet from 'react-native-web/dist/exports/StyleSheet'; +import View from 'react-native-web/dist/exports/View'; +``` + +[package-badge]: https://img.shields.io/npm/v/babel-plugin-react-native-web.svg?style=flat +[package-url]: https://yarnpkg.com/en/package/babel-plugin-react-native-web diff --git a/packages/babel-plugin-react-native-web/index.js b/packages/babel-plugin-react-native-web/index.js new file mode 100644 index 000000000..3fc779821 --- /dev/null +++ b/packages/babel-plugin-react-native-web/index.js @@ -0,0 +1 @@ +module.exports = require('./src'); diff --git a/packages/babel-plugin-react-native-web/package.json b/packages/babel-plugin-react-native-web/package.json new file mode 100644 index 000000000..e919bcf2f --- /dev/null +++ b/packages/babel-plugin-react-native-web/package.json @@ -0,0 +1,15 @@ +{ + "name": "babel-plugin-react-native-web", + "version": "0.5.0", + "description": "Babel plugin for React Native for Web", + "main": "index.js", + "devDependencies": { + "babel-plugin-tester": "^5.0.0" + }, + "author": "Nicolas Gallagher", + "license": "MIT", + "repository": { + "type": "git", + "url": "git://github.com/necolas/react-native-web.git" + } +} diff --git a/packages/babel-plugin-react-native-web/src/__tests__/__snapshots__/index-test.js.snap b/packages/babel-plugin-react-native-web/src/__tests__/__snapshots__/index-test.js.snap new file mode 100644 index 000000000..8a6cc9077 --- /dev/null +++ b/packages/babel-plugin-react-native-web/src/__tests__/__snapshots__/index-test.js.snap @@ -0,0 +1,109 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`export from "react-native" 1`] = ` +" +export { View } from 'react-native'; +export { ColorPropType, StyleSheet, Text, createElement } from 'react-native'; + + ↓ ↓ ↓ ↓ ↓ ↓ + +export { default as View } from 'react-native-web/dist/exports/View'; +export { default as ColorPropType } from 'react-native-web/dist/exports/ColorPropType'; +export { default as StyleSheet } from 'react-native-web/dist/exports/StyleSheet'; +export { default as Text } from 'react-native-web/dist/exports/Text'; +export { default as createElement } from 'react-native-web/dist/exports/createElement'; +" +`; + +exports[`export from "react-native-web" 1`] = ` +" +export { View } from 'react-native-web'; +export { ColorPropType, StyleSheet, Text, createElement } from 'react-native-web'; + + ↓ ↓ ↓ ↓ ↓ ↓ + +export { default as View } from 'react-native-web/dist/exports/View'; +export { default as ColorPropType } from 'react-native-web/dist/exports/ColorPropType'; +export { default as StyleSheet } from 'react-native-web/dist/exports/StyleSheet'; +export { default as Text } from 'react-native-web/dist/exports/Text'; +export { default as createElement } from 'react-native-web/dist/exports/createElement'; +" +`; + +exports[`import from "native-native" 1`] = ` +" +import ReactNative from 'react-native'; +import { View } from 'react-native'; +import { Invalid, View as MyView, ViewPropTypes } from 'react-native'; +import * as ReactNativeModules from 'react-native'; + + ↓ ↓ ↓ ↓ ↓ ↓ + +import ReactNative from 'react-native-web/dist/index'; +import View from 'react-native-web/dist/exports/View'; +import { Invalid } from 'react-native-web/dist/index'; +import MyView from 'react-native-web/dist/exports/View'; +import ViewPropTypes from 'react-native-web/dist/exports/ViewPropTypes'; +import * as ReactNativeModules from 'react-native-web/dist/index'; +" +`; + +exports[`import from "react-native-web" 1`] = ` +" +import { createElement } from 'react-native-web'; +import { ColorPropType, StyleSheet, View, TouchableOpacity, processColor } from 'react-native-web'; +import * as ReactNativeModules from 'react-native-web'; + + ↓ ↓ ↓ ↓ ↓ ↓ + +import createElement from 'react-native-web/dist/exports/createElement'; +import ColorPropType from 'react-native-web/dist/exports/ColorPropType'; +import StyleSheet from 'react-native-web/dist/exports/StyleSheet'; +import View from 'react-native-web/dist/exports/View'; +import TouchableOpacity from 'react-native-web/dist/exports/TouchableOpacity'; +import processColor from 'react-native-web/dist/exports/processColor'; +import * as ReactNativeModules from 'react-native-web/dist/index'; +" +`; + +exports[`require "react-native" 1`] = ` +" +const ReactNative = require('react-native'); +const { View } = require('react-native'); +const { StyleSheet, TouchableOpacity } = require('react-native'); + + ↓ ↓ ↓ ↓ ↓ ↓ + +const ReactNative = require('react-native-web/dist/index').default; + +const View = require('react-native-web/dist/exports/View').default; + +const StyleSheet = require('react-native-web/dist/exports/StyleSheet').default; + +const TouchableOpacity = require('react-native-web/dist/exports/TouchableOpacity').default; +" +`; + +exports[`require "react-native-web" 1`] = ` +" +const ReactNative = require('react-native-web'); +const { createElement } = require('react-native-web'); +const { ColorPropType, StyleSheet, View, TouchableOpacity, processColor } = require('react-native-web'); + + ↓ ↓ ↓ ↓ ↓ ↓ + +const ReactNative = require('react-native-web/dist/index').default; + +const createElement = require('react-native-web/dist/exports/createElement').default; + +const ColorPropType = require('react-native-web/dist/exports/ColorPropType').default; + +const StyleSheet = require('react-native-web/dist/exports/StyleSheet').default; + +const View = require('react-native-web/dist/exports/View').default; + +const TouchableOpacity = require('react-native-web/dist/exports/TouchableOpacity').default; + +const processColor = require('react-native-web/dist/exports/processColor').default; +" +`; diff --git a/packages/babel-plugin-react-native-web/src/__tests__/index-test.js b/packages/babel-plugin-react-native-web/src/__tests__/index-test.js new file mode 100644 index 000000000..cf5605029 --- /dev/null +++ b/packages/babel-plugin-react-native-web/src/__tests__/index-test.js @@ -0,0 +1,52 @@ +const plugin = require('..'); +const pluginTester = require('babel-plugin-tester'); + +const tests = [ + // import react-native + { + title: 'import from "native-native"', + code: `import ReactNative from 'react-native'; +import { View } from 'react-native'; +import { Invalid, View as MyView, ViewPropTypes } from 'react-native'; +import * as ReactNativeModules from 'react-native';`, + snapshot: true + }, + { + title: 'import from "react-native-web"', + code: `import { createElement } from 'react-native-web'; +import { ColorPropType, StyleSheet, View, TouchableOpacity, processColor } from 'react-native-web'; +import * as ReactNativeModules from 'react-native-web';`, + snapshot: true + }, + { + title: 'export from "react-native"', + code: `export { View } from 'react-native'; +export { ColorPropType, StyleSheet, Text, createElement } from 'react-native';`, + snapshot: true + }, + { + title: 'export from "react-native-web"', + code: `export { View } from 'react-native-web'; +export { ColorPropType, StyleSheet, Text, createElement } from 'react-native-web';`, + snapshot: true + }, + { + title: 'require "react-native"', + code: `const ReactNative = require('react-native'); +const { View } = require('react-native'); +const { StyleSheet, TouchableOpacity } = require('react-native');`, + snapshot: true + }, + { + title: 'require "react-native-web"', + code: `const ReactNative = require('react-native-web'); +const { createElement } = require('react-native-web'); +const { ColorPropType, StyleSheet, View, TouchableOpacity, processColor } = require('react-native-web');`, + snapshot: true + } +]; + +pluginTester({ + plugin, + tests +}); diff --git a/packages/babel-plugin-react-native-web/src/index.js b/packages/babel-plugin-react-native-web/src/index.js new file mode 100644 index 000000000..bdd2606b8 --- /dev/null +++ b/packages/babel-plugin-react-native-web/src/index.js @@ -0,0 +1,128 @@ +const moduleMap = require('./moduleMap'); + +const getDistLocation = importName => + importName && moduleMap[importName] ? `react-native-web/dist/exports/${importName}` : undefined; + +const isReactNativeRequire = (t, node) => { + const { declarations } = node; + if (declarations.length > 1) { + return false; + } + const { id, init } = declarations[0]; + return ( + (t.isObjectPattern(id) || t.isIdentifier(id)) && + t.isCallExpression(init) && + t.isIdentifier(init.callee) && + init.callee.name === 'require' && + init.arguments.length === 1 && + (init.arguments[0].value === 'react-native' || init.arguments[0].value === 'react-native-web') + ); +}; + +const isReactNativeModule = ({ source, specifiers }) => + source && + (source.value === 'react-native' || source.value === 'react-native-web') && + specifiers.length; + +module.exports = function({ types: t }) { + return { + name: 'Rewrite react-native to react-native-web', + visitor: { + ImportDeclaration(path, state) { + const { specifiers } = path.node; + if (isReactNativeModule(path.node)) { + const imports = specifiers + .map(specifier => { + if (t.isImportSpecifier(specifier)) { + const importName = specifier.imported.name; + const distLocation = getDistLocation(importName); + + if (distLocation) { + return t.importDeclaration( + [t.importDefaultSpecifier(t.identifier(specifier.local.name))], + t.stringLiteral(distLocation) + ); + } + } + return t.importDeclaration( + [specifier], + t.stringLiteral('react-native-web/dist/index') + ); + }) + .filter(Boolean); + + path.replaceWithMultiple(imports); + } + }, + ExportNamedDeclaration(path, state) { + const { specifiers } = path.node; + if (isReactNativeModule(path.node)) { + const exports = specifiers + .map(specifier => { + if (t.isExportSpecifier(specifier)) { + const exportName = specifier.exported.name; + const localName = specifier.local.name; + const distLocation = getDistLocation(localName); + + if (distLocation) { + return t.exportNamedDeclaration( + null, + [t.exportSpecifier(t.identifier('default'), t.identifier(exportName))], + t.stringLiteral(distLocation) + ); + } + } + return t.exportNamedDeclaration( + null, + [specifier], + t.stringLiteral('react-native-web/dist/index') + ); + }) + .filter(Boolean); + + path.replaceWithMultiple(exports); + } + }, + VariableDeclaration(path, state) { + if (isReactNativeRequire(t, path.node)) { + const { id } = path.node.declarations[0]; + if (t.isObjectPattern(id)) { + const imports = id.properties + .map(identifier => { + const distLocation = getDistLocation(identifier.key.name); + if (distLocation) { + return t.variableDeclaration(path.node.kind, [ + t.variableDeclarator( + t.identifier(identifier.value.name), + t.memberExpression( + t.callExpression(t.identifier('require'), [t.stringLiteral(distLocation)]), + t.identifier('default') + ) + ) + ]); + } + }) + .filter(Boolean); + + path.replaceWithMultiple(imports); + } else if (t.isIdentifier(id)) { + const name = id.name; + const importIndex = t.variableDeclaration(path.node.kind, [ + t.variableDeclarator( + t.identifier(name), + t.memberExpression( + t.callExpression(t.identifier('require'), [ + t.stringLiteral('react-native-web/dist/index') + ]), + t.identifier('default') + ) + ) + ]); + + path.replaceWith(importIndex); + } + } + } + } + }; +}; diff --git a/packages/babel-plugin-react-native-web/src/moduleMap.js b/packages/babel-plugin-react-native-web/src/moduleMap.js new file mode 100644 index 000000000..6299c8dab --- /dev/null +++ b/packages/babel-plugin-react-native-web/src/moduleMap.js @@ -0,0 +1,61 @@ +// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. +module.exports = { + ART: true, + ActivityIndicator: true, + Animated: true, + AppRegistry: true, + AppState: true, + AsyncStorage: true, + BackHandler: true, + Button: true, + CheckBox: true, + Clipboard: true, + ColorPropType: true, + Dimensions: true, + Easing: true, + EdgeInsetsPropType: true, + FlatList: true, + I18nManager: true, + Image: true, + ImageBackground: true, + InteractionManager: true, + Keyboard: true, + KeyboardAvoidingView: true, + Linking: true, + ListView: true, + Modal: true, + NativeModules: true, + NetInfo: true, + PanResponder: true, + Picker: true, + PixelRatio: true, + Platform: true, + PointPropType: true, + ProgressBar: true, + RefreshControl: true, + SafeAreaView: true, + ScrollView: true, + SectionList: true, + Slider: true, + StatusBar: true, + StyleSheet: true, + Switch: true, + Text: true, + TextInput: true, + TextPropTypes: true, + Touchable: true, + TouchableHighlight: true, + TouchableNativeFeedback: true, + TouchableOpacity: true, + TouchableWithoutFeedback: true, + UIManager: true, + Vibration: true, + View: true, + ViewPropTypes: true, + VirtualizedList: true, + createElement: true, + findNodeHandle: true, + processColor: true, + render: true, + unmountComponentAtNode: true +}; diff --git a/packages/benchmarks/README.md b/packages/benchmarks/README.md new file mode 100644 index 000000000..95e5045a7 --- /dev/null +++ b/packages/benchmarks/README.md @@ -0,0 +1,70 @@ +# benchmarks + +Try the [benchmarks app](https://necolas.github.io/react-native-web/benchmarks) online. + +To run the benchmarks locally: + +``` +yarn benchmarks +open ./packages/benchmarks/dist/index.html +``` + +Develop against these benchmarks: + +``` +yarn compile --watch +yarn benchmarks --watch +``` + +## Notes + +These benchmarks are approximations of extreme cases that libraries may +encounter. Their purpose is to provide an early-warning signal for performance +regressions. Each test report includes the mean and standard deviation of the +timings, and approximations of the time spent in scripting (S) and layout (L). + +The components used in the render benchmarks are simple enough to be +implemented by multiple UI or style libraries. The benchmark implementations +and the features of the style libraries are _only approximately equivalent in +functionality_. + +No benchmark will run for more than 20 seconds. + +### Mount deep/wide tree + +These cases look at the performance of mounting and rendering large trees of +elements that use static styles. + +### Update dynamic styles + +This case looks at the performance of repeated style updates to a large mounted +tree. Some libraries choose to inject new styles for each "dynamic style", +whereas others choose to use inline styles. Libraries without built-in support +for dynamic styles (i.e., they rely on user-authored inline styles) are not +included. + +## Example results + +### MacBook Pro (2011) + +MacBook Pro (13-inch, Early 2011); 2.3 GHz Intel Core i5; 8 GB 1333 MHz DDR3 RAM. Google Chrome 63. + +Typical render timings: mean ± standard deviations. + +| Implementation | Mount deep tree (ms) | Mount wide tree (ms) | Dynamic update (ms) | +| :--- | ---: | ---: | ---: | +| `css-modules` | `30.19` `±04.84` | `38.25` `±04.85` | - | +| `react-native-web@0.4.0` | `36.40` `±04.98` | `51.28` `±05.58` | `19.36` `±02.56` | +| `inline-styles` | `64.12` `±07.69` | `94.49` `±11.34` | `09.84` `±02.36` | + +### Moto G4 + +Moto G4 (Android 7); Octa-core (4x1.5 GHz & 4x1.2 Ghz); 2 GB RAM. Google Chrome 63. + +Typical render timings: mean ± standard deviations. + +| Implementation | Mount deep tree (ms) | Mount wide tree (ms) | Dynamic update (ms) | +| :--- | ---: | ---: | ---: | +| `css-modules` | `98.24` `±20.26` | `143.75` `±25.50` | - | +| `react-native-web@0.4.0` | `131.46` `±18.96` | `174.70` `±14.88` | `60.87` `±06.32` | +| `inline-styles` | `184.58` `±26.23` | `273.86` `±26.23` | `30.28` `±07.44` | diff --git a/packages/benchmarks/index.html b/packages/benchmarks/index.html new file mode 100644 index 000000000..4d68cb72e --- /dev/null +++ b/packages/benchmarks/index.html @@ -0,0 +1,16 @@ + + + + + Performance tests + + + + +
+ + + diff --git a/packages/benchmarks/package.json b/packages/benchmarks/package.json new file mode 100644 index 000000000..5f58a7f39 --- /dev/null +++ b/packages/benchmarks/package.json @@ -0,0 +1,37 @@ +{ + "private": true, + "name": "benchmarks", + "version": "0.5.0", + "scripts": { + "build": "mkdir -p dist && cp -f index.html dist/index.html && webpack --config ./webpack.config.js", + "release": "yarn build && git checkout gh-pages && rm -rf ../../benchmarks && mv dist ../../benchmarks && git add -A && git commit -m \"Benchmarks deploy\" && git push origin gh-pages && git checkout -" + }, + "dependencies": { + "aphrodite": "1.2.5", + "classnames": "^2.2.5", + "d3-scale-chromatic": "^1.2.0", + "emotion": "^9.0.1", + "fela": "6.1.3", + "glamor": "2.20.40", + "radium": "^0.22.0", + "react": "^16.2.0", + "react-component-benchmark": "^0.0.4", + "react-dom": "^16.2.0", + "react-fela": "6.2.4", + "react-jss": "^8.3.3", + "react-native-web": "0.5.0", + "reactxp": "^0.51.8", + "style-loader": "0.20.1", + "styled-components": "^3.1.6", + "styled-jsx": "^2.2.4", + "styletron-client": "3.0.4", + "styletron-react": "3.0.4" + }, + "devDependencies": { + "babel-plugin-react-native-web": "0.5.0", + "css-loader": "^0.28.9", + "style-loader": "^0.20.2", + "webpack": "^3.10.0", + "webpack-bundle-analyzer": "^2.9.2" + } +} diff --git a/packages/benchmarks/src/app/App.js b/packages/benchmarks/src/app/App.js new file mode 100644 index 000000000..a56af497f --- /dev/null +++ b/packages/benchmarks/src/app/App.js @@ -0,0 +1,298 @@ +/* eslint-disable react/prop-types */ + +import Benchmark from './Benchmark'; +import { Picker, StyleSheet, ScrollView, TouchableOpacity, View } from 'react-native'; +import React, { Component } from 'react'; +import Button from './Button'; +import { IconClear, IconEye } from './Icons'; +import ReportCard from './ReportCard'; +import Text from './Text'; +import Layout from './Layout'; +import { colors } from './theme'; + +const Overlay = () => ; + +export default class App extends Component { + static displayName = '@app/App'; + + constructor(props, context) { + super(props, context); + const currentBenchmarkName = Object.keys(props.tests)[0]; + this.state = { + currentBenchmarkName, + currentLibraryName: 'react-native-web', + status: 'idle', + results: [] + }; + } + + render() { + const { tests } = this.props; + const { currentBenchmarkName, status, currentLibraryName, results } = this.state; + const currentImplementation = tests[currentBenchmarkName][currentLibraryName]; + const { Component, Provider, getComponentProps, sampleCount } = currentImplementation; + + return ( + + + + Library + {currentLibraryName} + + + {Object.keys(tests[currentBenchmarkName]).map(libraryName => ( + + ))} + + + + + Benchmark + {currentBenchmarkName} + + {Object.keys(tests).map(test => ( + + ))} + + + + + + +