diff --git a/CHANGELOG.md b/CHANGELOG.md
index 494491a..eafce38 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,13 @@
+# 0.3.0-alpha.1
+
+- migrate to react-reconciler 0.6.0
+- check if is need to format code on CI
+- add benchmark example
+- fix update render tor nodeText
+- update postinstall to prebublishOnly (newest npm)
+- remove: react-tv run-webos-dev
+- react-tv cli {init} breaking changes
+
# 0.2.3
- use ReactReconciler from `react-reconciler` instead from `react-dom`
diff --git a/README.md b/README.md
index b92b2ef..3b4e543 100644
--- a/README.md
+++ b/README.md
@@ -33,12 +33,15 @@ ReactTV.render( , document.getElementById('root'))
- [About React-TV](#about-react-tv)
- [Understanding the Problem](#understanding-the-problem)
+ - [Benchmark](#benchmark)
- [Getting Started](#getting-started)
- [Installing](#installing)
- - [Examples](#examples)
- - [Clock TV App rendering with React-TV](#clock-tv-app-rendering-with-react-tv)
- [Using CLI](#using-cli)
+ - [React-tv CLI for WebOS](#react-tv-cli-for-webos)
+ - [Setup WebOS Enviroment](#setup-webos-environment)
- [Using Module](#using-module)
+- [Examples](#examples)
+ - [Clock TV App rendering with React-TV](#clock-tv-app-rendering-with-react-tv)
- [Supported Televisions](#supported-televisions)
- [LG WebOS](#lg-webos)
- [References for Study](#references)
@@ -47,6 +50,7 @@ ReactTV.render( , document.getElementById('root'))
- [Essentials to beginner](#essentials-to-beginner)
- [React Basics and Renderer Architecture](#react-basics-and-renderer-architecture)
- [Roadmap](#roadmap)
+- [Credits](#credits)
## About React-TV
@@ -68,6 +72,22 @@ These restrictions make super responsive 60fps experiences especially tricky. Th
In addition: Unify the build for multiple TV platforms.
+### Benchmark
+
+| Operation | React-TV | React-DOM | Runned off |
+| ------------- | ------------- | ------------- | ------------- |
+| Time of first render | ~76ms | ~199ms | Firefox 57 (Quantum) |
+| Time of first render | ~364ms* | ~234ms | WebOS 3.0 Emulator |
+| Memory Footprint | ** | ** | ** |
+
+* This result will change a lot with `react-tv@0.3.0`.
+
+** Homework.
+
+Disclamer: Speed performance will compensate the memory loss. Having a sufficient amount of memory for all of your machines is important to achieving good performance. React-TV renderer focus on Memory usage, but if you want to Perfomance you can still use `react-dom` for renderer and `react-tv-cli` for builds.
+
+The good sides of React-TV, in a next release, is that will be using native TVs APIs, support for React.CanvasComponents, keys mapping[...]
+
## Getting Started
### Installing
@@ -88,82 +108,51 @@ $ npm install react-tv --save
$ yarn add react-tv
```
-## Examples
-
-### [Clock TV App Rendering with React-TV](https://github.com/raphamorim/react-tv/tree/master/examples/clock-app-with-react-tv)
-
-![clock-with-react-tv-as-renderer](examples/clock-app-with-react-tv/screenshot.png)
-
-```jsx
-import React from 'react'
-import ReactTV, { Platform } from 'react-tv'
-
-class Clock extends React.Component {
- constructor() {
- super()
- this.state = { date: new Date() }
- }
-
- componentDidMount() {
- setInterval(() => this.setState({date: new Date()}), 1000)
- }
-
- render() {
- let currentPlatform = 'Browser'
- if (Platform('webos'))
- currentPlatform = 'LG WebOS'
-
- return (
-
-
-
It's {this.state.date.toLocaleTimeString()}
-
You're in {currentPlatform}
-
- )
- }
-}
-
-ReactTV.render( , document.getElementById('root'))
-```
-
## Using CLI
-### Initalizing React-TV Apps:
+### React-TV CLI for WebOS
-Generate react-tv projects:
+#### 1: Install globally React-TV
```bash
-$ react-tv init
+$ yarn add --global react-tv
```
-If you want to specify app path on commnand:
+#### 2: Setup WebOS Environment
-```bash
-$ react-tv init
-```
+[Setup WebOS Enviroment](docs/setup-webos-environment.md)
+
+#### 3: Setting Up
-Open app folder:
+3.1: If you doesn't have a project and want to start from nothing. If is your situation: jump to topic 3 (Running It!).
```bash
-$ cd app-name
+$ react-tv init
```
-Run emulator and devices (should pack, build and run on emulator):
+3.2: If you already have some source code. Just run `react-tv init` on project root.
-```
-$ react-tv run-webos
-```
+3.3: Add the files related to app on a React-TV entry on `package.json`:
-Run only on devices and disable create/call Emulator instance:
-
-```
-$ react-tv run-webos --disable-emulator
+```json
+{
+ "name": "my-app-name",
+ "react-tv": {
+ "files": [
+ "index.html",
+ "bundle.js",
+ "style.css"
+ ]
+ }
+}
```
-Run webos app on browser (developer mode on browser). `run-webos-dev` is using `REACT_TV_PORT` environment variable or `8500` as port number.
+#### 4: Running It!
+
+Run emulator and devices (should pack, build and run on emulator):
```
-$ react-tv run-webos-dev
+$ react-tv run-webos
```
## Using Module
@@ -190,6 +179,48 @@ import { Keys } from 'react-tv'
```
+## Examples
+
+### [Clock TV App Rendering with React-TV](https://github.com/raphamorim/react-tv/tree/master/examples/clock-app-with-react-tv)
+
+![clock-with-react-tv-as-renderer](examples/clock-app-with-react-tv/screenshot.png)
+
+```jsx
+import React from 'react'
+import ReactTV, { Platform } from 'react-tv'
+
+class Clock extends React.Component {
+ constructor() {
+ super()
+ this.state = { date: new Date() }
+ }
+
+ componentDidMount() {
+ setInterval(() => this.setState({date: new Date()}), 1000)
+ }
+
+ render() {
+ let currentPlatform = 'Browser'
+ if (Platform('webos'))
+ currentPlatform = 'LG WebOS'
+
+ return (
+
+
+
It's {this.state.date.toLocaleTimeString()}
+
You're in {currentPlatform}
+
+ )
+ }
+}
+
+ReactTV.render( , document.getElementById('root'))
+```
+
+### [Benchmark: React-TV X React-DOM](https://github.com/raphamorim/react-tv/tree/master/examples/benchmark)
+
+![example](examples/benchmark/screenshot.png)
+
## Supported Televisions
### LG WebOS
@@ -246,16 +277,6 @@ WebOS, also known as Open WebOS or LG WebOS, (previously known as HP WebOS and P
- https://github.com/iamdustan/tiny-react-renderer
- https://facebook.github.io/react/blog/2015/12/18/react-components-elements-and-instances.html
-----------------------------------------------------
-
-See ReactTV's [Changelog](https://github.com/raphamorim/react-tv/blob/master/CHANGELOG.md).
-
-Currently ReactTV is licensed by [MIT License](https://github.com/raphamorim/react-tv/blob/master/LICENSE.md)
-
-## Credits
-
-Thanks [react-dom](https://github.com/facebook/react/tree/master/packages/react-dom) for be example and a inspiration code :)
-
## Roadmap
#### Stage 1
@@ -267,7 +288,7 @@ Initial proof-of-concept. [IN PROGRESS]
- [ ] Renderer ReactElements to simple DOM
- [x] Support HOF and HOC
- [x] Support State and Lifecycle
- - [ ] Change `className` to `class`
+ - [ ] Keyboard Navigation
- [ ] Optmizate DOMRenderer for TV
- [ ] Avoid memoize operations and use DOM Hash
- [x] Check `webos` Platform
@@ -295,3 +316,13 @@ Add additional features users expect from a Renderer. Then fix bugs and stabiliz
- [ ] Handle common errors
- [ ] Reactive Renderer
- [ ] Testing and stability
+
+----------------------------------------------------
+
+See ReactTV's [Changelog](https://github.com/raphamorim/react-tv/blob/master/CHANGELOG.md).
+
+Currently ReactTV is licensed by [MIT License](https://github.com/raphamorim/react-tv/blob/master/LICENSE.md)
+
+## Credits
+
+Thanks [react-dom](https://github.com/facebook/react/tree/master/packages/react-dom) for be example and a inspiration code :)
diff --git a/TODO.md b/TODO.md
new file mode 100644
index 0000000..86c88ac
--- /dev/null
+++ b/TODO.md
@@ -0,0 +1,19 @@
+# React-TV TODOLIST
+
+- Verify if I can map props before pass to ReactReconciler.
+- Reduce appendChilds (DOM Iteration) on appendInitialChild for textNodes (?)
+ - maybe not necessary: `appendChildToContainer` it's the only one to real append it. But still need to check benchmark results.
+ - ReactTV.CreateElement, solves it.
+- Create a benchmark about ReactDOM against ReactTV.
+ - simplest render case, based on only appendChildToContainer.
+ - with a lot of updateProperties (maybe focused on animations).
+ - memory usage of both.
+- Stop propagation of onClick (?)
+- Think about `AppIsReady` for TVS. It's about done/loaded events which WebOS and Tizen dispatch, start mapping it in a HOC?
+- Propagate handler for keyboard on React.Elements.
+- `ReactTV.CreateCanvasElement`
+- Simulator Component (`TVSimulator`).
+ - render children as app.
+ - `({children}) => {children} `
+ - share keyboard state with rendered container.
+- Write a guide for create your first application for WebOS using ReactTV.
diff --git a/cli/generators/app/index.js b/cli/generators/app/index.js
deleted file mode 100644
index 498e4c2..0000000
--- a/cli/generators/app/index.js
+++ /dev/null
@@ -1,11 +0,0 @@
-import React from 'react'
-
-export { Awesome } from './src'
-
-const App = () => (
-
-
{ console.log('Nice!')}/>
-
-)
-
-export default App
diff --git a/cli/generators/app/package.json b/cli/generators/app/package.json
deleted file mode 100644
index 86820a3..0000000
--- a/cli/generators/app/package.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "name": "react-tv-app",
- "version": "0.1.0",
- "description": "my awesome react-tv app",
- "main": "src/index.js",
- "scripts": {
- "webos": "react-tv run-webos",
- "webos-dev": "react-tv run-webos-dev"
- },
- "dependencies": {
- "react-tv": "^0.1.5"
- }
-}
diff --git a/cli/generators/app/react-tv/icon-large.png b/cli/generators/app/react-tv/icon-large.png
new file mode 100644
index 0000000..b3f5047
Binary files /dev/null and b/cli/generators/app/react-tv/icon-large.png differ
diff --git a/cli/generators/app/react-tv/icon.png b/cli/generators/app/react-tv/icon.png
new file mode 100644
index 0000000..8b7ca97
Binary files /dev/null and b/cli/generators/app/react-tv/icon.png differ
diff --git a/cli/generators/app/webos/appinfo.json b/cli/generators/app/react-tv/webos/appinfo.json
similarity index 61%
rename from cli/generators/app/webos/appinfo.json
rename to cli/generators/app/react-tv/webos/appinfo.json
index bf3f4c3..eddd429 100644
--- a/cli/generators/app/webos/appinfo.json
+++ b/cli/generators/app/react-tv/webos/appinfo.json
@@ -1,11 +1,11 @@
{
"id": "react.tv.app",
- "title": "react-tv-app",
+ "title": "{{REACTTVAPP}}",
"vendor": "my awesome react-tv app",
"version": "0.0.1",
"type": "web",
"main": "index.html",
- "icon": "assets/icon.png",
+ "icon": "icon.png",
"uiRevision": 2,
- "largeIcon": "assets/largeIcon.png"
+ "largeIcon": "icon-large.png"
}
diff --git a/cli/generators/app/src/components/awesome.js b/cli/generators/app/src/components/awesome.js
deleted file mode 100644
index bb91869..0000000
--- a/cli/generators/app/src/components/awesome.js
+++ /dev/null
@@ -1,12 +0,0 @@
-// @flow
-import React from 'react';
-
-import './styles/awesome.css';
-
-const Awesome = ({onClick}: {onClick?: Function}): React.Element => (
-
- Click on this Awesome Component
-
-);
-
-export default Awesome;
diff --git a/cli/generators/app/src/components/styles/awesome.css b/cli/generators/app/src/components/styles/awesome.css
deleted file mode 100644
index 7eabdc6..0000000
--- a/cli/generators/app/src/components/styles/awesome.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.awesome {
- background-color: blue;
- color: white;
-}
diff --git a/cli/generators/app/src/index.js b/cli/generators/app/src/index.js
deleted file mode 100644
index ee51560..0000000
--- a/cli/generators/app/src/index.js
+++ /dev/null
@@ -1 +0,0 @@
-export {default as Awesome} from './components/awesome';
diff --git a/cli/generators/app/webos/assets/icon.png b/cli/generators/app/webos/assets/icon.png
deleted file mode 100644
index 53fa818..0000000
Binary files a/cli/generators/app/webos/assets/icon.png and /dev/null differ
diff --git a/cli/generators/app/webos/assets/largeIcon.png b/cli/generators/app/webos/assets/largeIcon.png
deleted file mode 100644
index d2dbdc4..0000000
Binary files a/cli/generators/app/webos/assets/largeIcon.png and /dev/null differ
diff --git a/cli/generators/app/webos/index.html b/cli/generators/app/webos/index.html
deleted file mode 100644
index 568670c..0000000
--- a/cli/generators/app/webos/index.html
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
- react-tv-app
-
-
-
-
-
-
-
- react-tv-app
-
-
-
-
-
diff --git a/cli/generators/app/webos/stylesheet/base.css b/cli/generators/app/webos/stylesheet/base.css
deleted file mode 100644
index f79d5d7..0000000
--- a/cli/generators/app/webos/stylesheet/base.css
+++ /dev/null
@@ -1,49 +0,0 @@
-/* for apps */
-body {
- margin: 0;
- height: 100%;
- position: relative;
-}
-
-body.fallback {
- background-color: #249EA9;
- border-right: 10em #EF5E59 solid;
- border-left: 10em #249EA9 solid;
- border-top: 10em #249EA9 solid;
- color: #FFF;
- font-size: 1.8em;
- font-family: Helvetica, arial;
-}
-
-.no-touch-action {
- -ms-touch-action: none;
-}
-
-.untouchable {
- pointer-events: none;
-}
-.untouchable > * {
- pointer-events: auto;
-}
-
-/* user selection */
-.unselectable {
- cursor: default;
- -ms-user-select: none;
- -webkit-user-select: none;
- -moz-user-select: -moz-none;
- user-select: none;
-}
-
-.selectable {
- cursor: auto;
- -ms-user-select: element;
- -webkit-user-select: text;
- -moz-user-select: text;
- user-select: text;
-}
-
-.selectable::selection {
- background: #3297FD;
- color: #FFF;
-}
diff --git a/cli/index.js b/cli/index.js
index ce293bc..cead5de 100755
--- a/cli/index.js
+++ b/cli/index.js
@@ -1,29 +1,30 @@
#! /usr/bin/env node
const argv = process.argv;
+const path = require('path');
const {help, debug, createReactTVApp} = require('./shared');
const scripts = require('./scripts');
if (argv.length < 2) {
- help();
-} else {
- switch (argv[2]) {
- case 'init':
- if (argv.length < 4)
- return debug('app name is required, example: react-tv init ');
+ return help();
+}
+
+const command = argv[2];
+switch (command) {
+ case 'init':
+ let appName = false;
+ if (argv.length < 4) {
+ appName = argv[3];
+ }
+
+ let optPath = argv.length >= 5 ? argv[4] : process.cwd();
+ createReactTVApp(appName, optPath);
+ break;
+
+ case 'run-webos':
+ scripts.runWebOS(process.cwd());
+ break;
- let optPath = argv.length >= 5 ? argv[4] : process.cwd();
- debug('using "' + argv[3] + '" as app-name');
- debug('using "' + optPath + '" as app-path');
- createReactTVApp(argv[3], optPath);
- break;
- case 'run-webos':
- scripts.runWebOS(process.cwd());
- break;
- case 'run-webos-dev':
- scripts.runWebOSDev(process.cwd());
- break;
- default:
- help();
- }
+ default:
+ help();
}
diff --git a/cli/scripts/build/index.js b/cli/scripts/build/index.js
deleted file mode 100644
index dd1de76..0000000
--- a/cli/scripts/build/index.js
+++ /dev/null
@@ -1,22 +0,0 @@
-function Build(rootPath, pathWebOS) {
- const fs = require('fs');
- const path = require('path');
- const chalk = require('chalk');
- const {execSync} = require('child_process');
-
- let crowBinPath = path.resolve(
- __dirname,
- '../../../node_modules/crow-scripts/bin/crow-scripts.js'
- );
-
- console.info(chalk.dim('[react-tv]'), `bundling...`);
-
- execSync(
- `cd ${rootPath} && node ${crowBinPath} webpack --enable-loose --disable-css --disable-manifest --target-browsers webos/bundle/app src`
- );
- execSync(
- `cd ${pathWebOS}/bundle && mv app.*.js app.js && mv app.*.js.map app.js.map`
- );
-}
-
-module.exports = Build;
diff --git a/cli/scripts/index.js b/cli/scripts/index.js
index 7d3a3bc..9684334 100644
--- a/cli/scripts/index.js
+++ b/cli/scripts/index.js
@@ -1,4 +1,3 @@
module.exports = {
runWebOS: require('./webos/run'),
- runWebOSDev: require('./webos/run-dev'),
};
diff --git a/cli/scripts/webos/run-dev.js b/cli/scripts/webos/run-dev.js
deleted file mode 100644
index 820c42d..0000000
--- a/cli/scripts/webos/run-dev.js
+++ /dev/null
@@ -1,29 +0,0 @@
-const express = require('express'),
- path = require('path'),
- build = require('../build'),
- chalk = require('chalk'),
- app = express(),
- port = process.env['REACT_TV_PORT'] || 8500,
- hostname = '0.0.0.0';
-
-module.exports = function _runWebOSDev(pathArg) {
- const pathWebOS = path.resolve(pathArg, 'webos');
- const pathNodeModules = path.resolve(pathArg, 'node_modules');
-
- app.use('/', express.static(pathWebOS));
- app.use('/node_modules', express.static(pathNodeModules));
-
- app.listen(port, hostname, () => {
- console.info(
- chalk.dim('[react-tv]'),
- `using ${chalk.blue(pathNodeModules)} as ${chalk.blue(
- 'node_modules'
- )} alias`
- );
-
- console.info(
- chalk.dim('[react-tv]'),
- `running on ${chalk.yellow(`${hostname}:${port}`)}`
- );
- });
-};
diff --git a/cli/scripts/webos/run.js b/cli/scripts/webos/run.js
index 15b5233..5ffba70 100644
--- a/cli/scripts/webos/run.js
+++ b/cli/scripts/webos/run.js
@@ -1,28 +1,75 @@
const path = require('path');
+const fs = require('fs');
const chalk = require('chalk');
const execSync = require('child_process').execSync;
function defaultCLIEnv() {
- // if darwin
+ // default is Darwin
return '/opt/webOS_TV_SDK/CLI/bin';
}
-module.exports = function runWebOS(paramsPath) {
+function isReactTVWebOSProject(root) {
+ const appinfo = path.resolve(root, 'react-tv/webos/appinfo.json');
+ if (fs.existsSync(appinfo)) {
+ return true;
+ }
+ return false;
+}
+
+function runWebOS(root) {
let webOS_TV_SDK_ENV = process.env['WEBOS_CLI_TV'] || false;
- if (!webOS_TV_SDK_ENV) webOS_TV_SDK_ENV = defaultCLIEnv();
+ if (!webOS_TV_SDK_ENV) {
+ webOS_TV_SDK_ENV = defaultCLIEnv();
+ }
process.env['PATH'] = `${webOS_TV_SDK_ENV}:${process.env['PATH']}`;
+ if (!isReactTVWebOSProject(root)) {
+ const msg = `This project isn\'t a React-TV WebOS Project:
+ Just run "react-tv init"`;
+ return console.log(chalk.dim('[react-tv]'), msg);
+ }
+
+ const packageJson = require(path.resolve(root, 'package.json'));
+ const ReactTVConfig = packageJson['react-tv'];
+ if (!ReactTVConfig) {
+ return console.log(
+ chalk.dim('[react-tv]'),
+ 'You should set react-tv properties on package.json'
+ );
+ }
+
+ if (!ReactTVConfig.files || !ReactTVConfig.files.length) {
+ return console.log(chalk.dim('[react-tv]'), 'You should add files');
+ }
+
+ const webosPath = path.resolve(root, 'react-tv/webos');
+ try {
+ execSync(`ln -sf ${root}/react-tv/icon.png ${webosPath}/icon.png`);
+ execSync(
+ `ln -sf ${root}/react-tv/icon-large.png ${webosPath}/icon-large.png`
+ );
+
+ ReactTVConfig.files.forEach(file => {
+ const filePath = path.resolve(root, file);
+ execSync(`ln -sf ${filePath} ${webosPath}`);
+ });
+ } catch (e) {
+ return console.log('FAIL TO MOUNT', e.toString());
+ }
+
console.log('');
console.log(chalk.dim('Up Emulator...'));
execSync(
- `open ${webOS_TV_SDK_ENV}/../../Emulator/v3.0.0/LG_webOS_TV_Emulator_RCU.app`
+ `open ${
+ webOS_TV_SDK_ENV
+ }/../../Emulator/v3.0.0/LG_webOS_TV_Emulator_RCU.app`
);
console.log(chalk.yellow(' LG WebOS Emulator 3.0.0 succefull running'));
let attemps = 0;
- let task = setInterval(function _runWebOSDevTask() {
- let runningVMS = execSync(`vboxmanage list runningvms`).toString();
+ const task = setInterval(function() {
+ const runningVMS = execSync(`vboxmanage list runningvms`).toString();
if (attemps > 15) {
console.log('FAILED TO UP virtualbox emulator');
clearInterval(task);
@@ -36,24 +83,25 @@ module.exports = function runWebOS(paramsPath) {
clearInterval(task);
console.log(runningVMS);
- const webOSAPPPath = path.resolve(paramsPath, 'webos');
console.log(chalk.dim('Packing...'));
- execSync(`cd ${webOSAPPPath} && ares-package .`);
- console.log(chalk.yellow(` succefull pack from ${webOSAPPPath}`));
+ execSync(`cd ${webosPath} && ares-package .`);
+ console.log(chalk.yellow(` succefull pack from ${root}`));
console.log(chalk.dim('Installing...'));
const config = JSON.parse(
- execSync(`cat ${webOSAPPPath}/appinfo.json`).toString()
+ execSync(`cat ${webosPath}/appinfo.json`).toString()
);
const latestIPK = config.id + '_' + config.version + '_all.ipk';
console.log(chalk.blue(` installing ${latestIPK} as IPK`));
- execSync(`cd ${webOSAPPPath} && ares-install ${latestIPK}`);
+ execSync(`cd ${webosPath} && ares-install ${latestIPK}`);
console.log(chalk.yellow(` succefull install ${config.title}`));
console.log(chalk.dim('Launching...'));
- execSync(`cd ${webOSAPPPath} && ares-launch ${config.id}`);
+ execSync(`cd ${webosPath} && ares-launch ${config.id}`);
console.log(chalk.yellow(` launched`));
}, 500);
-};
+}
+
+module.exports = runWebOS;
diff --git a/cli/shared/index.js b/cli/shared/index.js
index 470fea5..130a038 100644
--- a/cli/shared/index.js
+++ b/cli/shared/index.js
@@ -3,11 +3,11 @@ const path = require('path');
const chalk = require('chalk');
const replace = require('node-replace');
-const debug = function _debug(msg) {
+const debug = function(msg) {
console.log(chalk.dim('[react-tv]'), msg);
};
-const help = function _help() {
+const help = function() {
console.log('');
console.log(
chalk.bgYellow(' init '),
@@ -17,40 +17,39 @@ const help = function _help() {
chalk.bgBlueBright(' run-webos '),
chalk.blueBright(' pack, build and runs webos simulator')
);
- console.log(
- chalk.bgGreenBright(' run-webos-dev '),
- chalk.greenBright(' run webos in developer mode on browser')
- );
console.log(
chalk.bgRed(' help '),
chalk.red(' output react-tv cli commands')
);
};
-const createReactTVApp = function _createReactTVApp(appName, appPath) {
- let projectPath = path.resolve(appPath, appName);
- let appTemplatePath = path.resolve(__dirname, '../generators/app');
+const createReactTVApp = function(appName, appPath) {
+ const packageJson = path.resolve(appPath, 'package.json');
+ if (fs.existsSync(packageJson)) {
+ existentProject = true;
+ appName = require(packageJson).name;
+ } else {
+ return debug('package.json not founded');
+ }
- return new Promise((fulfill, reject) => {
- if (!fs.existsSync(projectPath)) {
- fs.mkdirSync(projectPath);
- } else {
- debug(projectPath + ' already exists');
- return fulfill();
- }
+ if (!appName) {
+ return debug('package.json {name} property not exists');
+ }
+ let appTemplatePath = path.resolve(__dirname, '../generators/app');
+ return new Promise((fulfill, reject) => {
fs
- .copy(appTemplatePath, projectPath)
+ .copy(appTemplatePath, appPath)
.then(() => {
replace({
- regex: 'react-tv-app',
+ regex: '{{REACTTVAPP}}',
replacement: appName,
- paths: [projectPath],
+ paths: ['./react-tv'],
recursive: true,
silent: true,
});
- debug(appName + ' created');
+ debug('Done! 📺 ⭐');
})
.catch(err => reject(debug(err)));
});
diff --git a/docs/resources/webos/download-installer.png b/docs/resources/webos/download-installer.png
new file mode 100644
index 0000000..0e3f245
Binary files /dev/null and b/docs/resources/webos/download-installer.png differ
diff --git a/docs/setup-webos-environment.md b/docs/setup-webos-environment.md
new file mode 100644
index 0000000..c49aed4
--- /dev/null
+++ b/docs/setup-webos-environment.md
@@ -0,0 +1,8 @@
+# Setup WebOS Environment
+
+1. Go to [http://webostv.developer.lge.com/sdk/download/download-sdk/](http://webostv.developer.lge.com/sdk/download/download-sdk/)
+
+![download LG webos installer](resources/webos/download-installer.png)
+
+2. Download the installer based on your platform.
+3. Execute your Installer (If you're in Linux or Mac the Installer will ask for be executed with sudo).
diff --git a/examples/benchmark/.gitignore b/examples/benchmark/.gitignore
new file mode 100644
index 0000000..d4ee229
--- /dev/null
+++ b/examples/benchmark/.gitignore
@@ -0,0 +1,6 @@
+.DS_Store
+*.log
+
+react-tv
+node_modules
+bundle.js
diff --git a/examples/benchmark/README.md b/examples/benchmark/README.md
new file mode 100644
index 0000000..8c315a3
--- /dev/null
+++ b/examples/benchmark/README.md
@@ -0,0 +1,25 @@
+# Benchmark React-TV
+
+Clone the repository:
+
+```shell
+git clone https://github.com/raphamorim/react-tv.git
+```
+
+Open this folder:
+
+```shell
+cd examples/benchmark
+```
+
+To install:
+
+```shell
+yarn
+```
+
+To run it:
+
+```shell
+yarn start
+```
diff --git a/examples/benchmark/index.html b/examples/benchmark/index.html
new file mode 100644
index 0000000..95499fd
--- /dev/null
+++ b/examples/benchmark/index.html
@@ -0,0 +1,17 @@
+
+
+
+
+ Benchmark
+
+
+
+
Performed 10.000 times
+
+ React-TV average time of initial render :
+ React-DOM average time of initial render:
+
+
+
+
+
diff --git a/examples/benchmark/package.json b/examples/benchmark/package.json
new file mode 100644
index 0000000..956e556
--- /dev/null
+++ b/examples/benchmark/package.json
@@ -0,0 +1,31 @@
+{
+ "name": "benchmark-react-tv",
+ "version": "1.0.0",
+ "author": "Raphael Amorim",
+ "license": "MIT",
+ "react-tv": {
+ "files": [
+ "index.html",
+ "bundle.js",
+ "style.css"
+ ]
+ },
+ "scripts": {
+ "build": "webpack",
+ "start": "yarn build && react-tv run-webos",
+ "start-dev": "webpack-dev-server --progress --colors"
+ },
+ "dependencies": {
+ "react": "^16.0.0",
+ "react-dom": "^16.0.0",
+ "react-tv": "0.3.0-alpha.1"
+ },
+ "devDependencies": {
+ "babel-core": "^6.4.5",
+ "babel-loader": "^6.2.1",
+ "babel-preset-env": "^1.6.1",
+ "babel-preset-react": "^6.3.13",
+ "webpack": "^1.12.12",
+ "webpack-dev-server": "^1.12.1"
+ }
+}
diff --git a/examples/benchmark/screenshot.png b/examples/benchmark/screenshot.png
new file mode 100644
index 0000000..e4061ad
Binary files /dev/null and b/examples/benchmark/screenshot.png differ
diff --git a/examples/benchmark/src/Benchmark.js b/examples/benchmark/src/Benchmark.js
new file mode 100644
index 0000000..1e2b8ee
--- /dev/null
+++ b/examples/benchmark/src/Benchmark.js
@@ -0,0 +1,62 @@
+import React from 'react'
+import ReactTV from 'react-tv'
+import ReactDOM from 'react-dom'
+
+class Clock extends React.Component {
+ render() {
+ return (
+
+
20 leagues under the sea
+
+
+
+ Twenty Thousand Leagues Under the Sea: A Tour of the Underwater World (French: Vingt mille lieues sous les mers: Tour du monde sous-marin, "Twenty Thousand Leagues Under the Seas: A Tour of the Underwater World") is a classic science fiction novel by French writer Jules Verne published in 1870.
+ The novel was originally serialized from March 1869 through June 1870 in Pierre-Jules Hetzel's periodical, the Magasin d'Éducation et de Récréation. The deluxe illustrated edition, published by Hetzel in November 1871, included 111 illustrations by Alphonse de Neuville and Édouard Riou. The book was highly acclaimed when released and still is now; it is regarded as one of the premiere adventure novels and one of Verne's greatest works, along with Around the World in Eighty Days and Journey to the Center of the Earth. The description of Nemo's ship, called the Nautilus, was considered ahead of its time, as it accurately describes features on submarines, which at the time were very primitive vessels.
+
+
+
+ )
+ }
+}
+
+function testReactTV() {
+ const reactTVResults = document.querySelector('#react-tv');
+ const times = 10000;
+
+ let results = 0;
+ for (var i = 0; i <= times; i++) {
+ let start = window.performance.now();
+ ReactTV.render( , document.getElementById('root'))
+ let end = window.performance.now();
+ results += end - start;
+ }
+
+ var finalizeInitialChildren = document.createElement('p');
+ finalizeInitialChildren.textContent = results / times;
+ reactTVResults.appendChild(finalizeInitialChildren);
+}
+
+
+function testReactDOM() {
+ const reactDOMResults = document.querySelector('#react-dom');
+ const times = 10000;
+
+ let results = 0;
+ for (var i = 0; i <= times; i++) {
+ let start = window.performance.now();
+ ReactDOM.render( , document.createElement('root'));
+ let end = window.performance.now();
+ results += end - start;
+ }
+
+ var finalizeInitialChildren = document.createElement('p');
+ finalizeInitialChildren.textContent = results / times;
+ reactDOMResults.appendChild(finalizeInitialChildren);
+}
+
+setTimeout(() => {
+ testReactTV();
+ testReactDOM();
+}, 1000);
+
+
diff --git a/examples/benchmark/style.css b/examples/benchmark/style.css
new file mode 100644
index 0000000..d9f21f3
--- /dev/null
+++ b/examples/benchmark/style.css
@@ -0,0 +1,35 @@
+body {
+ background: #262626;
+ color: #4AD0EC;
+ font-family: Helvetica;
+ letter-spacing: 0.15em;
+ width: 600px;
+ margin: 0 auto;
+}
+
+h1 {
+ font-weight: 300;
+ color: #FFF;
+ margin: 0;
+ margin-top: 35px;
+ padding: 0;
+}
+
+p {
+ font-size: 1.4em;
+}
+
+.container {
+ display: flex;
+ justify-content: center;
+ align-content: center;
+ flex-wrap: wrap;
+ align-items: center;
+ text-align: center;
+ position: relative;
+ width: 100%;
+}
+
+.container p, .container h1 {
+ width: 100%
+}
diff --git a/examples/benchmark/webpack.config.js b/examples/benchmark/webpack.config.js
new file mode 100644
index 0000000..2f8c0be
--- /dev/null
+++ b/examples/benchmark/webpack.config.js
@@ -0,0 +1,29 @@
+var path = require('path');
+var webpack = require('webpack');
+
+module.exports = {
+ entry: './src/Benchmark.js',
+ output: { path: __dirname, filename: 'bundle.js' },
+ resolveLoader: {
+ root: path.join(__dirname, 'node_modules')
+ },
+ module: {
+ loaders: [
+ {
+ test: /.jsx?$/,
+ loader: 'babel-loader',
+ exclude: /node_modules/,
+ query: {
+ presets: ['env', 'react']
+ }
+ }
+ ]
+ },
+ plugins: [
+ new webpack.DefinePlugin({
+ 'process.env': {
+ 'NODE_ENV': JSON.stringify('production')
+ }
+ })
+ ],
+};
diff --git a/examples/clock-app-with-react-tv/.gitignore b/examples/clock-app-with-react-tv/.gitignore
new file mode 100644
index 0000000..d4ee229
--- /dev/null
+++ b/examples/clock-app-with-react-tv/.gitignore
@@ -0,0 +1,6 @@
+.DS_Store
+*.log
+
+react-tv
+node_modules
+bundle.js
diff --git a/examples/clock-app-with-react-tv/package.json b/examples/clock-app-with-react-tv/package.json
index 701d40b..d7b537c 100644
--- a/examples/clock-app-with-react-tv/package.json
+++ b/examples/clock-app-with-react-tv/package.json
@@ -3,13 +3,21 @@
"version": "1.0.0",
"author": "Raphael Amorim",
"license": "MIT",
+ "react-tv": {
+ "files": [
+ "index.html",
+ "bundle.js",
+ "style.css"
+ ]
+ },
"scripts": {
"build": "webpack",
- "start": "webpack-dev-server --progress --colors"
+ "start": "yarn build && react-tv run-webos",
+ "start-dev": "webpack-dev-server --progress --colors"
},
"dependencies": {
"react": "^16.0.0",
- "react-tv": "0.2.3"
+ "react-tv": "0.3.0-alpha.1"
},
"devDependencies": {
"babel-core": "^6.4.5",
diff --git a/examples/keyboard-navigation/.gitignore b/examples/keyboard-navigation/.gitignore
new file mode 100644
index 0000000..d4ee229
--- /dev/null
+++ b/examples/keyboard-navigation/.gitignore
@@ -0,0 +1,6 @@
+.DS_Store
+*.log
+
+react-tv
+node_modules
+bundle.js
diff --git a/examples/keyboard-navigation/README.md b/examples/keyboard-navigation/README.md
new file mode 100644
index 0000000..1963c4e
--- /dev/null
+++ b/examples/keyboard-navigation/README.md
@@ -0,0 +1,27 @@
+# Clock App with React-TV as Renderer
+
+Clone the repository:
+
+```shell
+git clone https://github.com/raphamorim/react-tv.git
+```
+
+Open this folder:
+
+```shell
+cd examples/clock-app-with-react-tv
+```
+
+To install:
+
+```shell
+yarn
+```
+
+To run it:
+
+```shell
+yarn start
+```
+
+![Screenshot](screenshot.png)
diff --git a/examples/keyboard-navigation/index.html b/examples/keyboard-navigation/index.html
new file mode 100644
index 0000000..ebe9441
--- /dev/null
+++ b/examples/keyboard-navigation/index.html
@@ -0,0 +1,12 @@
+
+
+
+
+ Keyboard Navigation
+
+
+
+
+
+
+
diff --git a/examples/keyboard-navigation/package.json b/examples/keyboard-navigation/package.json
new file mode 100644
index 0000000..ac10220
--- /dev/null
+++ b/examples/keyboard-navigation/package.json
@@ -0,0 +1,30 @@
+{
+ "name": "react-tv-keyboard-navigation",
+ "version": "1.0.0",
+ "author": "Raphael Amorim",
+ "license": "MIT",
+ "react-tv": {
+ "files": [
+ "index.html",
+ "bundle.js",
+ "style.css"
+ ]
+ },
+ "scripts": {
+ "build": "webpack",
+ "start": "yarn build && react-tv run-webos",
+ "start-dev": "webpack-dev-server --progress --colors"
+ },
+ "dependencies": {
+ "react": "^16.0.0",
+ "react-tv": "0.3.0-alpha.1"
+ },
+ "devDependencies": {
+ "babel-core": "^6.4.5",
+ "babel-loader": "^6.2.1",
+ "babel-preset-env": "^1.6.1",
+ "babel-preset-react": "^6.3.13",
+ "webpack": "^1.12.12",
+ "webpack-dev-server": "^1.12.1"
+ }
+}
diff --git a/examples/keyboard-navigation/screenshot.png b/examples/keyboard-navigation/screenshot.png
new file mode 100644
index 0000000..8175183
Binary files /dev/null and b/examples/keyboard-navigation/screenshot.png differ
diff --git a/examples/keyboard-navigation/src/Keyboard.js b/examples/keyboard-navigation/src/Keyboard.js
new file mode 100644
index 0000000..6fdb9db
--- /dev/null
+++ b/examples/keyboard-navigation/src/Keyboard.js
@@ -0,0 +1,29 @@
+import React from 'react'
+import ReactTV, { Platform } from 'react-tv'
+
+class Keyboard extends React.Component {
+ constructor() {
+ super()
+ this.state = {lastInput: null}
+ }
+
+ render() {
+ const { lastInput } = this.state;
+ const lastInputPressed = (lastInput) ?
+ `last input: ${lastInput}` :
+ 'input something!'
+
+ let component = (
+
+
React-TV
+
{this.setState({lastInput: input})}}>
+ {lastInputPressed}
+
+
+ )
+
+ return component
+ }
+}
+
+ReactTV.render( , document.getElementById('root'))
diff --git a/examples/keyboard-navigation/style.css b/examples/keyboard-navigation/style.css
new file mode 100644
index 0000000..d9f21f3
--- /dev/null
+++ b/examples/keyboard-navigation/style.css
@@ -0,0 +1,35 @@
+body {
+ background: #262626;
+ color: #4AD0EC;
+ font-family: Helvetica;
+ letter-spacing: 0.15em;
+ width: 600px;
+ margin: 0 auto;
+}
+
+h1 {
+ font-weight: 300;
+ color: #FFF;
+ margin: 0;
+ margin-top: 35px;
+ padding: 0;
+}
+
+p {
+ font-size: 1.4em;
+}
+
+.container {
+ display: flex;
+ justify-content: center;
+ align-content: center;
+ flex-wrap: wrap;
+ align-items: center;
+ text-align: center;
+ position: relative;
+ width: 100%;
+}
+
+.container p, .container h1 {
+ width: 100%
+}
diff --git a/examples/keyboard-navigation/webpack.config.js b/examples/keyboard-navigation/webpack.config.js
new file mode 100644
index 0000000..8e6ed67
--- /dev/null
+++ b/examples/keyboard-navigation/webpack.config.js
@@ -0,0 +1,22 @@
+var path = require('path');
+var webpack = require('webpack');
+
+module.exports = {
+ entry: './src/Keyboard.js',
+ output: { path: __dirname, filename: 'bundle.js' },
+ resolveLoader: {
+ root: path.join(__dirname, 'node_modules')
+ },
+ module: {
+ loaders: [
+ {
+ test: /.jsx?$/,
+ loader: 'babel-loader',
+ exclude: /node_modules/,
+ query: {
+ presets: ['env', 'react']
+ }
+ }
+ ]
+ },
+};
diff --git a/package.json b/package.json
index 1730872..180b1b7 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "react-tv",
- "version": "0.2.3",
+ "version": "0.3.0-alpha.1",
"description": "React Renderer for low memory applications and Packager for TVs (WebOS, Tizen, Orsay)",
"main": "dist/react-tv.umd.js",
"bin": {
@@ -15,8 +15,10 @@
"scripts": {
"build": "node scripts/rollup/build.js",
"build-all": "NODE_ENV=PROD node scripts/rollup/build.js",
- "prepublish": "yarn test && yarn build-all",
- "test": "yarn flow && jest",
+ "prepublishOnly": "yarn test && yarn build-all",
+ "prettier-stat": "node ./scripts/prettier/index",
+ "test": "yarn prettier-stat && yarn flow && yarn jest",
+ "jest": "jest",
"jest-watch": "jest --watch",
"flow": "flow",
"prettier": "node ./scripts/prettier/index.js write-changed",
@@ -24,7 +26,6 @@
},
"dependencies": {
"chalk": "^2.1.0",
- "express": "^4.15.4",
"fbjs": "^0.8.4",
"fs-extra": "^4.0.1",
"node-replace": "^0.3.1"
@@ -41,8 +42,8 @@
"jest": "20.1.0-delta.1",
"prettier": "^1.5.3",
"react": "^16.0.0",
- "react-reconciler": "^0.3.0-beta.1",
"react-fiber-types": "file:src/renderer/types",
+ "react-reconciler": "^0.6.0",
"rollup": "^0.50.0",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-commonjs": "^8.0.2",
diff --git a/scripts/rollup/build.js b/scripts/rollup/build.js
index 9dbae2b..73dce3f 100644
--- a/scripts/rollup/build.js
+++ b/scripts/rollup/build.js
@@ -30,6 +30,7 @@ function createBundle({entryPath, bundleType, destName}) {
let plugins = [
flow(),
+ replace(stripEnvVariables()),
babel({
babelrc: false,
exclude: 'node_modules/**',
@@ -37,28 +38,21 @@ function createBundle({entryPath, bundleType, destName}) {
presets: [['env', {modules: false}], 'react', 'stage-2'],
plugins: ['transform-flow-strip-types', 'external-helpers'],
}),
- ];
-
- if (bundleType.indexOf('PROD') >= 0)
- plugins = plugins.concat([
- uglify(),
- optimizeJs(),
- replace(stripEnvVariables()),
- ]);
-
- plugins = plugins.concat([
commonjs(),
resolve({
jsnext: true,
main: true,
browser: true,
}),
- ]);
+ ];
+
+ if (bundleType.indexOf('PROD') >= 0) {
+ plugins = plugins.concat([optimizeJs(), uglify()]);
+ }
rollup({
input: entryPath,
plugins: plugins,
- external: ['react'],
sourcemap: false,
}).then(bundle => {
tasks.push(
diff --git a/src/ReactTVEntry.js b/src/ReactTVEntry.js
index 443b948..16de12c 100644
--- a/src/ReactTVEntry.js
+++ b/src/ReactTVEntry.js
@@ -15,4 +15,5 @@ const ReactTV = {
};
export {default as Platform} from './modules/Platform';
+export {default as WebOSSimulator} from './modules/WebOSSimulator';
export default ReactTV;
diff --git a/src/__tests__/ReactTVEntry-test.js b/src/__tests__/ReactTVEntry-test.js
new file mode 100644
index 0000000..94ea84d
--- /dev/null
+++ b/src/__tests__/ReactTVEntry-test.js
@@ -0,0 +1,30 @@
+import React from 'react';
+import ReactTV, {Platform} from '../ReactTVEntry.js';
+
+const render = ReactTV.render;
+
+describe('[render] Integration between renderer and modules', () => {
+ it('should renderer to expected Element', () => {
+ const root = document.createElement('div');
+ function MyComponent() {
+ let currentPlatform = 'LG WebOS';
+ if (!Platform('webos')) currentPlatform = 'Browser';
+
+ return (
+
+ );
+ }
+
+ const renderedElement = render(MyComponent(), root);
+
+ const expectedElement = document.createElement('div');
+ expectedElement.setAttribute('class', 'container');
+ const paragraph = document.createElement('p');
+ paragraph.textContent = 'Browser';
+ expectedElement.appendChild(paragraph);
+
+ expect(renderedElement).toEqual(expectedElement);
+ });
+});
diff --git a/src/modules/WebOSSimulator.js b/src/modules/WebOSSimulator.js
new file mode 100644
index 0000000..4ba7283
--- /dev/null
+++ b/src/modules/WebOSSimulator.js
@@ -0,0 +1,16 @@
+/**
+ * Copyright (c) 2017-present, Raphael Amorim.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @flow
+ */
+
+import React from 'react';
+
+const WebOSSimulator = ({children}: {children?: any}) => (
+ {children}
+);
+
+export default WebOSSimulator;
diff --git a/src/renderer/ReactTVFiberComponent.js b/src/renderer/ReactTVFiberComponent.js
index 77d3969..d700aaf 100644
--- a/src/renderer/ReactTVFiberComponent.js
+++ b/src/renderer/ReactTVFiberComponent.js
@@ -54,18 +54,9 @@ function setInitialDOMProperties(
}
let nextProp = nextProps[propKey];
if (propKey === STYLE) {
- // Relies on `updateStylesByID` not mutating `styleUpdates`.
- // CSSPropertyOperations.setValueForStyles(domElement, nextProp);
+ // noop
} else if (propKey === CHILDREN) {
- if (typeof nextProp === 'string') {
- // Avoid setting initial textContent when the text is empty.
- var canSetTextContent = tag !== 'textarea' || nextProp !== '';
- if (canSetTextContent) {
- setTextContent(domElement, escapeTextContentForBrowser(nextProp));
- }
- } else if (typeof nextProp === 'number') {
- setTextContent(domElement, escapeTextContentForBrowser('' + nextProp));
- }
+ // noop
} else if (isCustomComponentTag) {
DOMPropertyOperations.setValueForAttribute(domElement, propKey, nextProp);
} else if (nextProp != null) {
diff --git a/src/renderer/__tests__/DOMPropertyConfig-test.js b/src/renderer/__tests__/DOMPropertyConfig-test.js
deleted file mode 100644
index e89fdd3..0000000
--- a/src/renderer/__tests__/DOMPropertyConfig-test.js
+++ /dev/null
@@ -1,21 +0,0 @@
-import React from 'react';
-import ReactTVRenderer from '../ReactTVFiberEntry';
-
-const render = ReactTVRenderer.render;
-
-describe('render', () => {
- it('should className props into class', () => {
- const root = document.createElement('div');
- const reactElement = React.createElement(
- 'div',
- {attr: 'custom'},
- 'cowboy bebop'
- );
-
- const expectedElement = document.createElement('div');
- expectedElement.setAttribute('attr', 'custom');
- expectedElement.textContent = 'cowboy bebop';
-
- expect(render(reactElement, root)).toEqual(expectedElement);
- });
-});
diff --git a/src/renderer/__tests__/ReactTVFiberEntry-test.js b/src/renderer/__tests__/ReactTVFiberEntry-test.js
index ce0638e..9bfaabd 100644
--- a/src/renderer/__tests__/ReactTVFiberEntry-test.js
+++ b/src/renderer/__tests__/ReactTVFiberEntry-test.js
@@ -3,40 +3,16 @@ import ReactTVRenderer from '../ReactTVFiberEntry';
const render = ReactTVRenderer.render;
-// mock stateless components
-const Base = () => React.createElement('div');
-const Page1 = () => React.createElement('div');
-const Page2 = () => React.createElement('div');
-
-// helper for {children}
-const Route = (path, component, children) =>
- React.createElement(
- 'Route',
- {path: path, component: component, key: path},
- children
- );
-
-const Rte = (path, component, children) =>
- React.createElement(
- 'Route',
- {path: path, component: component, key: path, toJSON: () => {}},
- children
- );
-
-describe('render', () => {
+describe('[render] Behavior tests', () => {
it('should transform props into attribute', () => {
const root = document.createElement('div');
- const reactElement = React.createElement(
- 'div',
- {attr: 'custom'},
- 'cowboy bebop'
- );
+ const ReactElement = cowboy bebop
;
const expectedElement = document.createElement('div');
expectedElement.setAttribute('attr', 'custom');
expectedElement.textContent = 'cowboy bebop';
- expect(render(reactElement, root)).toEqual(expectedElement);
+ expect(render(ReactElement, root)).toEqual(expectedElement);
});
it('should transform onClick into onclick attribute', () => {
@@ -45,90 +21,77 @@ describe('render', () => {
}
const textNode = 'uzumaki naruto!';
-
const root = document.createElement('div');
- const reactElement = React.createElement('div', {onClick: fn}, textNode);
const expectedElement = document.createElement('div');
expectedElement.setAttribute('onclick', fn);
expectedElement.textContent = textNode;
- expect(render(reactElement, root)).toEqual(expectedElement);
+ expect(render({textNode}
, root)).toEqual(
+ expectedElement
+ );
+ });
+
+ it('should render with the default toJSON behavior', () => {
+ const myIncremental = "it's base";
+ const Base = () =>
;
+ const Page1 = () =>
;
+ const Page2 = () =>
;
+
+ // helper for {children}
+ const Route = (path, component, children) =>
+ React.createElement(
+ 'Route',
+ {path: path, component: component, key: path},
+ children
+ );
+
+ const root = document.createElement('div');
+ const element = render(
+ Route('/', Base, [Route('/page/1', Page1), Route('/page/2', Page2)]),
+ root
+ );
+
+ const RouteElement = document.createElement('Route');
+ RouteElement.setAttribute('path', '/');
+ RouteElement.setAttribute('component', Base);
+
+ const Page1Element = document.createElement('route');
+ Page1Element.setAttribute('path', '/page/1');
+ Page1Element.setAttribute('component', Page1);
+
+ const Page2Element = document.createElement('route');
+ Page2Element.setAttribute('path', '/page/2');
+ Page2Element.setAttribute('component', Page2);
+
+ RouteElement.appendChild(Page1Element);
+ RouteElement.appendChild(Page2Element);
+
+ expect(element).toEqual(RouteElement);
});
- // it('should render with the default toJSON behavior', () => {
- // const rootDOM = document.createElement('div')
- // const element = render(
- // Route('/', Base, [
- // Route('/page/1', Page1),
- // Route('/page/2', Page2)
- // ]), rootDOM
- // );
-
- // expect(element).toEqual(
- // {
- // path: '/',
- // component: Base,
- // children: [
- // {
- // path: '/page/1',
- // component: Page1
- // },
- // {
- // path: '/page/2',
- // component: Page2
- // }
- // ]
- // }
- // );
- // });
-
- // it('should render children as string', () => {
- // const reactElement = React.createElement(
- // 'h1',
- // { babyComeBack: 'come back to me!' },
- // 'my-custom-text'
- // );
- // const element = render(reactElement);
-
- // expect(element).toEqual(
- // {'babyComeBack':'come back to me!','children': 'my-custom-text'}
- // );
- // });
-
- // it('should render nested children', () => {
- // const reactElement = React.createElement(
- // 'div',
- // {fatherProps: 123},
- // React.createElement(
- // 'h1',
- // {abc: 1},
- // React.createElement('p', {}, 'text')
- // )
- // );
- // const element = render(reactElement);
-
- // expect(element).toEqual(
- // {'fatherProps': 123, 'children': {'abc': 1,'children': {'children': 'text'}}}
- // );
- // });
-
- // it('should render with a custom toJSON method', () => {
- // const element = render(
- // Rte('/', Base, [
- // Rte('/page/1', Page1, [Rte('lol')]),
- // Rte('/page/2', Page2)
- // ])
- // );
-
- // expect(element).toEqual(
- // {
- // path: '/',
- // childRoutes: [
- // {path: '/page/1', childRoutes: [{path: 'lol'}]},
- // {path: '/page/2'}
- // ]
- // }
- // );
- // });
+ it('should componentDidMount be called', () => {
+ class Clock extends React.Component {
+ constructor() {
+ super();
+ this.state = {value: 'my first value'};
+ }
+
+ componentDidMount() {
+ this.setState({value: 'my second value'});
+ }
+
+ render() {
+ return (
+
+ );
+ }
+ }
+
+ const root = document.createElement('div');
+ render( , root);
+ expect(root.textContent).toEqual('my second value');
+ });
});
diff --git a/yarn.lock b/yarn.lock
index 6e5314b..d54094c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -10,13 +10,6 @@ abbrev@1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
-accepts@~1.3.4:
- version "1.3.4"
- resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.4.tgz#86246758c7dd6d21a6474ff084a4740ec05eb21f"
- dependencies:
- mime-types "~2.1.16"
- negotiator "0.6.1"
-
acorn-globals@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-3.1.0.tgz#fd8270f71fbb4996b004fa880ee5d46573a731bf"
@@ -31,9 +24,9 @@ acorn@^4.0.4:
version "4.0.13"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787"
-acorn@^5.1.2:
- version "5.1.2"
- resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.1.2.tgz#911cb53e036807cf0fa778dc5d370fbd864246d7"
+acorn@^5.2.1:
+ version "5.2.1"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.2.1.tgz#317ac7821826c22c702d66189ab8359675f135d7"
ajv@^4.9.1:
version "4.11.8"
@@ -133,10 +126,6 @@ array-equal@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93"
-array-flatten@1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2"
-
array-unique@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53"
@@ -166,8 +155,8 @@ async@^1.4.0:
resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
async@^2.1.4:
- version "2.5.0"
- resolved "https://registry.yarnpkg.com/async/-/async-2.5.0.tgz#843190fd6b7357a0b9e1c956edddd5ec8462b54d"
+ version "2.6.0"
+ resolved "https://registry.yarnpkg.com/async/-/async-2.6.0.tgz#61a29abb6fcc026fea77e56d1c6ec53a795951f4"
dependencies:
lodash "^4.14.0"
@@ -851,21 +840,6 @@ block-stream@*:
dependencies:
inherits "~2.0.0"
-body-parser@1.18.2:
- version "1.18.2"
- resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.2.tgz#87678a19d84b47d859b83199bd59bce222b10454"
- dependencies:
- bytes "3.0.0"
- content-type "~1.0.4"
- debug "2.6.9"
- depd "~1.1.1"
- http-errors "~1.6.2"
- iconv-lite "0.4.19"
- on-finished "~2.3.0"
- qs "6.5.1"
- raw-body "2.3.2"
- type-is "~1.6.15"
-
boom@2.x.x:
version "2.10.1"
resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f"
@@ -906,10 +880,10 @@ browser-resolve@^1.11.0, browser-resolve@^1.11.2:
resolve "1.1.7"
browserslist@^2.1.2:
- version "2.6.1"
- resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.6.1.tgz#cc65a05ad6131ebda26f076f2822ba1bc826376b"
+ version "2.9.0"
+ resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.9.0.tgz#706aca15c53be15610f466e348cbfa0c00a6a379"
dependencies:
- caniuse-lite "^1.0.30000755"
+ caniuse-lite "^1.0.30000760"
electron-to-chromium "^1.3.27"
bser@^2.0.0:
@@ -922,10 +896,6 @@ builtin-modules@^1.0.0, builtin-modules@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
-bytes@3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048"
-
callsites@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50"
@@ -938,9 +908,9 @@ camelcase@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a"
-caniuse-lite@^1.0.30000755:
- version "1.0.30000756"
- resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000756.tgz#3da701c1521b9fab87004c6de7c97fa47dbeaad2"
+caniuse-lite@^1.0.30000760:
+ version "1.0.30000765"
+ resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000765.tgz#aa1a75019276b48463c0fca2a5257fb9f26a7c9d"
caseless@~0.12.0:
version "0.12.0"
@@ -964,8 +934,8 @@ chalk@^1.1.1, chalk@^1.1.3:
supports-color "^2.0.0"
chalk@^2.0.1, chalk@^2.1.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.2.0.tgz#477b3bf2f9b8fd5ca9e429747e37f724ee7af240"
+ version "2.3.0"
+ resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba"
dependencies:
ansi-styles "^3.1.0"
escape-string-regexp "^1.0.5"
@@ -1008,8 +978,8 @@ code-point-at@^1.0.0:
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
color-convert@^1.9.0:
- version "1.9.0"
- resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a"
+ version "1.9.1"
+ resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed"
dependencies:
color-name "^1.1.1"
@@ -1056,30 +1026,14 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e"
-content-disposition@0.5.2:
- version "0.5.2"
- resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4"
-
content-type-parser@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.2.tgz#caabe80623e63638b2502fd4c7f12ff4ce2352e7"
-content-type@~1.0.4:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b"
-
convert-source-map@^1.4.0, 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"
-cookie-signature@1.0.6:
- version "1.0.6"
- resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c"
-
-cookie@0.3.1:
- version "0.3.1"
- resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb"
-
core-js@^1.0.0:
version "1.2.7"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
@@ -1120,7 +1074,7 @@ dashdash@^1.12.0:
dependencies:
assert-plus "^1.0.0"
-debug@2.6.9, debug@^2.2.0, debug@^2.6.8:
+debug@^2.2.0, debug@^2.6.8:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
dependencies:
@@ -1158,20 +1112,16 @@ delegates@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
-depd@1.1.1, depd@~1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359"
-
-destroy@~1.0.4:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80"
-
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"
+detect-libc@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.2.tgz#71ad5d204bf17a6a6ca8f450c61454066ef461e1"
+
diff@^3.2.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c"
@@ -1182,18 +1132,10 @@ ecc-jsbn@~0.1.1:
dependencies:
jsbn "~0.1.0"
-ee-first@1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
-
electron-to-chromium@^1.3.27:
version "1.3.27"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.27.tgz#78ecb8a399066187bb374eede35d9c70565a803d"
-encodeurl@~1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20"
-
encoding@^0.1.11:
version "0.1.12"
resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb"
@@ -1212,10 +1154,6 @@ error-ex@^1.2.0:
dependencies:
is-arrayish "^0.2.1"
-escape-html@~1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
-
escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
@@ -1259,10 +1197,6 @@ esutils@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
-etag@~1.8.1:
- version "1.8.1"
- resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887"
-
exec-sh@^0.2.0:
version "0.2.1"
resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.1.tgz#163b98a6e89e6b65b47c2a28d215bc1f63989c38"
@@ -1281,41 +1215,6 @@ expand-range@^1.8.1:
dependencies:
fill-range "^2.1.0"
-express@^4.15.4:
- version "4.16.2"
- resolved "https://registry.yarnpkg.com/express/-/express-4.16.2.tgz#e35c6dfe2d64b7dca0a5cd4f21781be3299e076c"
- dependencies:
- accepts "~1.3.4"
- array-flatten "1.1.1"
- body-parser "1.18.2"
- content-disposition "0.5.2"
- content-type "~1.0.4"
- cookie "0.3.1"
- cookie-signature "1.0.6"
- debug "2.6.9"
- depd "~1.1.1"
- encodeurl "~1.0.1"
- escape-html "~1.0.3"
- etag "~1.8.1"
- finalhandler "1.1.0"
- fresh "0.5.2"
- merge-descriptors "1.0.1"
- methods "~1.1.2"
- on-finished "~2.3.0"
- parseurl "~1.3.2"
- path-to-regexp "0.1.7"
- proxy-addr "~2.0.2"
- qs "6.5.1"
- range-parser "~1.2.0"
- safe-buffer "5.1.1"
- send "0.16.1"
- serve-static "1.13.1"
- setprototypeof "1.1.0"
- statuses "~1.3.1"
- type-is "~1.6.15"
- utils-merge "1.0.1"
- vary "~1.1.2"
-
extend@~3.0.0, extend@~3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444"
@@ -1381,18 +1280,6 @@ fill-range@^2.1.0:
repeat-element "^1.1.2"
repeat-string "^1.5.2"
-finalhandler@1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5"
- dependencies:
- debug "2.6.9"
- encodeurl "~1.0.1"
- escape-html "~1.0.3"
- on-finished "~2.3.0"
- parseurl "~1.3.2"
- statuses "~1.3.1"
- unpipe "~1.0.0"
-
find-up@^1.0.0:
version "1.1.2"
resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f"
@@ -1447,14 +1334,6 @@ form-data@~2.3.1:
combined-stream "^1.0.5"
mime-types "^2.1.12"
-forwarded@~0.1.2:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84"
-
-fresh@0.5.2:
- version "0.5.2"
- resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
-
fs-extra@^4.0.1:
version "4.0.2"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.2.tgz#f91704c53d1b461f893452b0c307d9997647ab6b"
@@ -1468,11 +1347,11 @@ fs.realpath@^1.0.0:
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
fsevents@^1.1.1:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.2.tgz#3282b713fb3ad80ede0e9fcf4611b5aa6fc033f4"
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.3.tgz#11f82318f5fe7bb2cd22965a108e9306208216d8"
dependencies:
nan "^2.3.0"
- node-pre-gyp "^0.6.36"
+ node-pre-gyp "^0.6.39"
fstream-ignore@^1.0.5:
version "1.0.5"
@@ -1653,15 +1532,6 @@ html-encoding-sniffer@^1.0.1:
dependencies:
whatwg-encoding "^1.0.1"
-http-errors@1.6.2, http-errors@~1.6.2:
- version "1.6.2"
- resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736"
- dependencies:
- depd "1.1.1"
- inherits "2.0.3"
- setprototypeof "1.0.3"
- statuses ">= 1.3.1 < 2"
-
http-signature@~1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf"
@@ -1689,7 +1559,7 @@ inflight@^1.0.4:
once "^1.3.0"
wrappy "1"
-inherits@2, inherits@2.0.3, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.3:
+inherits@2, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
@@ -1707,17 +1577,13 @@ invert-kv@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6"
-ipaddr.js@1.5.2:
- version "1.5.2"
- resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.5.2.tgz#d4b505bde9946987ccf0fc58d9010ff9607e3fa0"
-
is-arrayish@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
is-buffer@^1.1.5:
- version "1.1.5"
- resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc"
+ version "1.1.6"
+ resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
is-builtin-module@^1.0.0:
version "1.0.0"
@@ -2282,22 +2148,10 @@ makeerror@1.0.x:
dependencies:
tmpl "1.0.x"
-media-typer@0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
-
-merge-descriptors@1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61"
-
merge@^1.1.3:
version "1.2.0"
resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da"
-methods@~1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee"
-
micromatch@^2.1.5, micromatch@^2.3.11:
version "2.3.11"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565"
@@ -2320,16 +2174,12 @@ mime-db@~1.30.0:
version "1.30.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01"
-mime-types@^2.1.12, mime-types@~2.1.15, mime-types@~2.1.16, mime-types@~2.1.17, mime-types@~2.1.7:
+mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.7:
version "2.1.17"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a"
dependencies:
mime-db "~1.30.0"
-mime@1.4.1:
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6"
-
minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
@@ -2355,17 +2205,13 @@ ms@2.0.0:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
nan@^2.3.0:
- version "2.7.0"
- resolved "https://registry.yarnpkg.com/nan/-/nan-2.7.0.tgz#d95bf721ec877e08db276ed3fc6eb78f9083ad46"
+ version "2.8.0"
+ resolved "https://registry.yarnpkg.com/nan/-/nan-2.8.0.tgz#ed715f3fe9de02b57a5e6252d90a96675e1f085a"
natural-compare@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
-negotiator@0.6.1:
- version "0.6.1"
- resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9"
-
node-fetch@^1.0.1:
version "1.7.3"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef"
@@ -2386,10 +2232,11 @@ node-notifier@^5.0.2:
shellwords "^0.1.0"
which "^1.2.12"
-node-pre-gyp@^0.6.36:
- version "0.6.38"
- resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.38.tgz#e92a20f83416415bb4086f6d1fb78b3da73d113d"
+node-pre-gyp@^0.6.39:
+ version "0.6.39"
+ resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz#c00e96860b23c0e1420ac7befc5044e1d78d8649"
dependencies:
+ detect-libc "^1.0.2"
hawk "3.1.3"
mkdirp "^0.5.1"
nopt "^4.0.1"
@@ -2402,8 +2249,8 @@ node-pre-gyp@^0.6.36:
tar-pack "^3.4.0"
node-replace@^0.3.1:
- version "0.3.1"
- resolved "https://registry.yarnpkg.com/node-replace/-/node-replace-0.3.1.tgz#04ec7a3aedea4b0f8fd40c631c1758f21d5cbe13"
+ version "0.3.3"
+ resolved "https://registry.yarnpkg.com/node-replace/-/node-replace-0.3.3.tgz#f21f277554cd264935313f41d288bab628f85235"
dependencies:
colors "^1.1.2"
minimatch "^3.0.4"
@@ -2470,12 +2317,6 @@ object.omit@^2.0.0:
for-own "^0.1.4"
is-extendable "^0.1.1"
-on-finished@~2.3.0:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947"
- dependencies:
- ee-first "1.1.1"
-
once@^1.3.0, once@^1.3.3, once@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
@@ -2560,10 +2401,6 @@ parse5@^1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/parse5/-/parse5-1.5.1.tgz#9b7f3b0de32be78dc2401b17573ccaf0f6f59d94"
-parseurl@~1.3.2:
- version "1.3.2"
- resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3"
-
path-exists@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b"
@@ -2582,10 +2419,6 @@ path-parse@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
-path-to-regexp@0.1.7:
- version "0.1.7"
- resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
-
path-type@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441"
@@ -2625,8 +2458,8 @@ preserve@^0.2.0:
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
prettier@^1.5.3:
- version "1.7.4"
- resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.7.4.tgz#5e8624ae9363c80f95ec644584ecdf55d74f93fa"
+ version "1.8.2"
+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.8.2.tgz#bff83e7fd573933c607875e5ba3abbdffb96aeb8"
pretty-format@20.1.0-delta.1:
version "20.1.0-delta.1"
@@ -2657,13 +2490,6 @@ prop-types@^15.6.0:
loose-envify "^1.3.1"
object-assign "^4.1.1"
-proxy-addr@~2.0.2:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.2.tgz#6571504f47bb988ec8180253f85dd7e14952bdec"
- dependencies:
- forwarded "~0.1.2"
- ipaddr.js "1.5.2"
-
prr@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a"
@@ -2672,14 +2498,14 @@ punycode@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
-qs@6.5.1, qs@~6.5.1:
- version "6.5.1"
- resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8"
-
qs@~6.4.0:
version "6.4.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233"
+qs@~6.5.1:
+ version "6.5.1"
+ resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8"
+
randomatic@^1.1.3:
version "1.1.7"
resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c"
@@ -2687,19 +2513,6 @@ randomatic@^1.1.3:
is-number "^3.0.0"
kind-of "^4.0.0"
-range-parser@~1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e"
-
-raw-body@2.3.2:
- version "2.3.2"
- resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.2.tgz#bcd60c77d3eb93cde0050295c3f379389bc88f89"
- dependencies:
- bytes "3.0.0"
- http-errors "1.6.2"
- iconv-lite "0.4.19"
- unpipe "1.0.0"
-
rc@^1.1.7:
version "1.2.2"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.2.tgz#d8ce9cb57e8d64d9c7badd9876c7c34cbe3c7077"
@@ -2712,9 +2525,9 @@ rc@^1.1.7:
"react-fiber-types@file:src/renderer/types":
version "16.0.0-alpha.3"
-react-reconciler@^0.3.0-beta.1:
- version "0.3.0-beta.1"
- resolved "https://registry.yarnpkg.com/react-reconciler/-/react-reconciler-0.3.0-beta.1.tgz#035b2211bbdaff0e2b018b9197e88381abcb5b23"
+react-reconciler@^0.6.0:
+ version "0.6.0"
+ resolved "https://registry.yarnpkg.com/react-reconciler/-/react-reconciler-0.6.0.tgz#68ff32da2bc43f0b49bcaa645eaa9a06a53fd74f"
dependencies:
fbjs "^0.8.16"
loose-envify "^1.1.0"
@@ -2722,8 +2535,8 @@ react-reconciler@^0.3.0-beta.1:
prop-types "^15.6.0"
react@^16.0.0:
- version "16.0.0"
- resolved "https://registry.yarnpkg.com/react/-/react-16.0.0.tgz#ce7df8f1941b036f02b2cca9dbd0cb1f0e855e2d"
+ version "16.1.1"
+ resolved "https://registry.yarnpkg.com/react/-/react-16.1.1.tgz#d5c4ef795507e3012282dd51261ff9c0e824fe1f"
dependencies:
fbjs "^0.8.16"
loose-envify "^1.1.0"
@@ -2882,8 +2695,8 @@ resolve@1.1.7:
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
resolve@^1.1.6, resolve@^1.3.2, resolve@^1.4.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86"
+ version "1.5.0"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36"
dependencies:
path-parse "^1.0.5"
@@ -2909,10 +2722,10 @@ rollup-plugin-babel@^2.7.1:
rollup-pluginutils "^1.5.0"
rollup-plugin-commonjs@^8.0.2:
- version "8.2.4"
- resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.2.4.tgz#435b01fb591cb508dc740196cec8b60f10132e78"
+ version "8.2.6"
+ resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.2.6.tgz#27e5b9069ff94005bb01e01bb46a1e4873784677"
dependencies:
- acorn "^5.1.2"
+ acorn "^5.2.1"
estree-walker "^0.5.0"
magic-string "^0.22.4"
resolve "^1.4.0"
@@ -2968,10 +2781,10 @@ rollup-pluginutils@^2.0.1:
micromatch "^2.3.11"
rollup@^0.50.0:
- version "0.50.0"
- resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.50.0.tgz#4c158f4e780e6cb33ff0dbfc184a52cc58cd5f3b"
+ version "0.50.1"
+ resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.50.1.tgz#e4dafcbf8d2bb0d9f5589d0cc6f64d76b8815730"
-safe-buffer@5.1.1, safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
+safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
@@ -2997,33 +2810,6 @@ sax@^1.2.1:
version "5.4.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e"
-send@0.16.1:
- version "0.16.1"
- resolved "https://registry.yarnpkg.com/send/-/send-0.16.1.tgz#a70e1ca21d1382c11d0d9f6231deb281080d7ab3"
- dependencies:
- debug "2.6.9"
- depd "~1.1.1"
- destroy "~1.0.4"
- encodeurl "~1.0.1"
- escape-html "~1.0.3"
- etag "~1.8.1"
- fresh "0.5.2"
- http-errors "~1.6.2"
- mime "1.4.1"
- ms "2.0.0"
- on-finished "~2.3.0"
- range-parser "~1.2.0"
- statuses "~1.3.1"
-
-serve-static@1.13.1:
- version "1.13.1"
- resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.1.tgz#4c57d53404a761d8f2e7c1e8a18a47dbf278a719"
- dependencies:
- encodeurl "~1.0.1"
- escape-html "~1.0.3"
- parseurl "~1.3.2"
- send "0.16.1"
-
set-blocking@^2.0.0, set-blocking@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
@@ -3032,14 +2818,6 @@ setimmediate@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
-setprototypeof@1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04"
-
-setprototypeof@1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656"
-
shellwords@^0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
@@ -3120,10 +2898,6 @@ sshpk@^1.7.0:
jsbn "~0.1.0"
tweetnacl "~0.14.0"
-"statuses@>= 1.3.1 < 2", statuses@~1.3.1:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e"
-
string-length@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/string-length/-/string-length-1.0.1.tgz#56970fb1c38558e9e70b728bf3de269ac45adfac"
@@ -3275,13 +3049,6 @@ type-check@~0.3.2:
dependencies:
prelude-ls "~1.1.2"
-type-is@~1.6.15:
- version "1.6.15"
- resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.15.tgz#cab10fb4909e441c82842eafe1ad646c81804410"
- dependencies:
- media-typer "0.3.0"
- mime-types "~2.1.15"
-
typedarray@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
@@ -3300,8 +3067,8 @@ uglify-js@^2.6:
uglify-to-browserify "~1.0.0"
uglify-js@^3.0.9:
- version "3.1.6"
- resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.1.6.tgz#918832602036e95d2318e11f27ee8461a8592c5d"
+ version "3.1.9"
+ resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.1.9.tgz#dffca799308cf327ec3ac77eeacb8e196ce3b452"
dependencies:
commander "~2.11.0"
source-map "~0.6.1"
@@ -3322,18 +3089,10 @@ universalify@^0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7"
-unpipe@1.0.0, unpipe@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
-
util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
-utils-merge@1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
-
uuid@^3.0.0, uuid@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04"
@@ -3345,10 +3104,6 @@ validate-npm-package-license@^3.0.1:
spdx-correct "~1.0.0"
spdx-expression-parse "~1.0.0"
-vary@~1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
-
verror@1.10.0:
version "1.10.0"
resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
@@ -3423,21 +3178,17 @@ window-size@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075"
-wordwrap@0.0.2:
+wordwrap@0.0.2, wordwrap@~0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f"
-wordwrap@~0.0.2:
- version "0.0.3"
- resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107"
-
wordwrap@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
worker-farm@^1.3.1:
- version "1.5.1"
- resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.5.1.tgz#8e9f4a7da4f3c595aa600903051b969390423fa1"
+ version "1.5.2"
+ resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.5.2.tgz#32b312e5dc3d5d45d79ef44acc2587491cd729ae"
dependencies:
errno "^0.1.4"
xtend "^4.0.1"