Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
release: react-tv 0.3.0-alpha.1
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
raphamorim committed Nov 16, 2017
1 parent b73afdc commit 532a142
Show file tree
Hide file tree
Showing 12 changed files with 85 additions and 302 deletions.
10 changes: 10 additions & 0 deletions 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`
Expand Down
11 changes: 10 additions & 1 deletion README.md
Expand Up @@ -77,7 +77,16 @@ In addition: Unify the build for multiple TV platforms.
| 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 |
| Time of first render | ~298ms* | ~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

Expand Down
6 changes: 6 additions & 0 deletions examples/benchmark/.gitignore
@@ -0,0 +1,6 @@
.DS_Store
*.log

react-tv
node_modules
bundle.js
2 changes: 1 addition & 1 deletion examples/benchmark/package.json
Expand Up @@ -18,7 +18,7 @@
"dependencies": {
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-tv": "0.2.3"
"react-tv": "0.3.0-alpha.1"
},
"devDependencies": {
"babel-core": "^6.4.5",
Expand Down
6 changes: 6 additions & 0 deletions examples/clock-app-with-react-tv/.gitignore
@@ -0,0 +1,6 @@
.DS_Store
*.log

react-tv
node_modules
bundle.js
2 changes: 1 addition & 1 deletion examples/clock-app-with-react-tv/package.json
Expand Up @@ -17,7 +17,7 @@
},
"dependencies": {
"react": "^16.0.0",
"react-tv": "0.2.3"
"react-tv": "0.3.0-alpha.1"
},
"devDependencies": {
"babel-core": "^6.4.5",
Expand Down
6 changes: 6 additions & 0 deletions examples/keyboard-navigation/.gitignore
@@ -0,0 +1,6 @@
.DS_Store
*.log

react-tv
node_modules
bundle.js
2 changes: 1 addition & 1 deletion examples/keyboard-navigation/package.json
Expand Up @@ -17,7 +17,7 @@
},
"dependencies": {
"react": "^16.0.0",
"react-tv": "0.2.3"
"react-tv": "0.3.0-alpha.1"
},
"devDependencies": {
"babel-core": "^6.4.5",
Expand Down
5 changes: 3 additions & 2 deletions 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": {
Expand All @@ -16,7 +16,8 @@
"build": "node scripts/rollup/build.js",
"build-all": "NODE_ENV=PROD node scripts/rollup/build.js",
"prepublishOnly": "yarn test && yarn build-all",
"test": "node ./scripts/prettier/index && yarn flow && yarn jest",
"prettier-stat": "node ./scripts/prettier/index",
"test": "yarn prettier-stat && yarn flow && yarn jest",
"jest": "jest",
"jest-watch": "jest --watch",
"flow": "flow",
Expand Down
17 changes: 6 additions & 11 deletions scripts/rollup/build.js
Expand Up @@ -30,30 +30,25 @@ function createBundle({entryPath, bundleType, destName}) {

let plugins = [
flow(),
replace(stripEnvVariables()),
babel({
babelrc: false,
exclude: 'node_modules/**',
externalHelpers: true,
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,
Expand Down
12 changes: 6 additions & 6 deletions src/renderer/__tests__/ReactTVFiberEntry-test.js
Expand Up @@ -73,25 +73,25 @@ describe('[render] Behavior tests', () => {
it('should componentDidMount be called', () => {
class Clock extends React.Component {
constructor() {
super()
this.state = { value: 'my first value' }
super();
this.state = {value: 'my first value'};
}

componentDidMount() {
this.setState({value: 'my second value'})
this.setState({value: 'my second value'});
}

render() {
return (
<div class='container'>
<div class="container">
<p>{this.state.value}</p>
</div>
)
);
}
}

const root = document.createElement('div');
render(<Clock/>, root);
render(<Clock />, root);
expect(root.textContent).toEqual('my second value');
});
});

0 comments on commit 532a142

Please sign in to comment.