From 072672339f08cbdd31e8d41f809f5aafbf33132c Mon Sep 17 00:00:00 2001 From: A-gambit Date: Fri, 25 Oct 2019 17:32:31 +0300 Subject: [PATCH 1/5] wrap in fragment render many list --- packages/examples/todomvc/webpack/dev_server.js | 2 +- packages/focal/src/react/react.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/examples/todomvc/webpack/dev_server.js b/packages/examples/todomvc/webpack/dev_server.js index daa6299..a5c64de 100644 --- a/packages/examples/todomvc/webpack/dev_server.js +++ b/packages/examples/todomvc/webpack/dev_server.js @@ -16,7 +16,7 @@ app.use(require('webpack-hot-middleware')(compiler)); app.get('/node_modules/todomvc-app-css/index.css', (req, res) => { res.sendFile(path.join( - __dirname, '../node_modules/todomvc-app-css/index.css')); + __dirname, '../../../../node_modules/todomvc-app-css/index.css')); }); app.get('/', (req, res) => { diff --git a/packages/focal/src/react/react.ts b/packages/focal/src/react/react.ts index 1552979..38c58c5 100644 --- a/packages/focal/src/react/react.ts +++ b/packages/focal/src/react/react.ts @@ -256,7 +256,11 @@ function render

( for (let j = 0; j < i; ++j) newChildren[j] = propValue[j] } - newChildren[i] = observedValues[++k] + newChildren[i] = React.createElement( + React.Fragment, + { key: i }, + observedValues[++k] + ) } else if (newChildren) { newChildren[i] = propValue[i] } From 17c286ed528d5fe41dcead5c59cec2b8e845c03a Mon Sep 17 00:00:00 2001 From: A-gambit Date: Mon, 28 Oct 2019 11:27:08 +0200 Subject: [PATCH 2/5] optimize children wrap (add check key condition) --- packages/focal/src/react/react.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/focal/src/react/react.ts b/packages/focal/src/react/react.ts index 38c58c5..7de8f48 100644 --- a/packages/focal/src/react/react.ts +++ b/packages/focal/src/react/react.ts @@ -256,11 +256,10 @@ function render

( for (let j = 0; j < i; ++j) newChildren[j] = propValue[j] } - newChildren[i] = React.createElement( - React.Fragment, - { key: i }, - observedValues[++k] - ) + const child = observedValues[++k] + newChildren[i] = !child || child.key + ? child + : React.createElement(React.Fragment, { key: i }, child) } else if (newChildren) { newChildren[i] = propValue[i] } From 8a15d0bb81d69d6b6e8cfb9dd4065b0d27c25d6a Mon Sep 17 00:00:00 2001 From: A-gambit Date: Mon, 28 Oct 2019 18:01:43 +0200 Subject: [PATCH 3/5] update react & react metods --- package.json | 6 +- packages/examples/all/package.json | 13 +- packages/examples/all/src/app.tsx | 2 - packages/examples/all/src/color-box/index.tsx | 40 --- .../all/src/styled-components/index.tsx | 42 --- packages/examples/todomvc/package.json | 12 +- packages/focal/package.json | 14 +- packages/focal/src/react/intrinsic.ts | 2 +- packages/focal/src/react/react.ts | 4 +- packages/test/package.json | 12 +- yarn.lock | 285 ++++++++---------- 11 files changed, 162 insertions(+), 270 deletions(-) delete mode 100644 packages/examples/all/src/color-box/index.tsx delete mode 100644 packages/examples/all/src/styled-components/index.tsx diff --git a/package.json b/package.json index 564ddde..2a90f52 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ }, "devDependencies": { "@grammarly/tslint-config": "0.5.1", - "tslint": "5.2.0", - "typescript": "3.3.3" + "tslint": "5.20.0", + "typescript": "3.6.4" }, "workspaces": [ "packages/focal", @@ -19,6 +19,6 @@ "packages/examples/*" ], "resolutions": { - "@types/react": "16.0.33" + "@types/react": "16.9.11" } } diff --git a/packages/examples/all/package.json b/packages/examples/all/package.json index e6b845d..a45c8ea 100644 --- a/packages/examples/all/package.json +++ b/packages/examples/all/package.json @@ -21,23 +21,22 @@ "devDependencies": { "@grammarly/focal": "0.8.0-alpha.0", "@grammarly/tslint-config": "0.5.1", - "@types/react": "16.0.33", - "@types/react-dom": "16.0.3", + "@types/react": "16.9.11", + "@types/react-dom": "16.9.3", "css-loader": "^0.26.1", "express": "^4.14.0", - "react": "16.2.0", - "react-dom": "16.2.0", + "react": "16.11.0", + "react-dom": "16.11.0", "react-transform-catch-errors": "^1.0.2", "react-transform-hmr": "^1.0.4", "redbox-react": "^1.3.0", "rxjs": "6.3.3", "style-loader": "^0.13.1", - "styled-components": "1.4.4", "todomvc-app-css": "^2.0.6", "ts-loader": "^2.3.0", - "tslint": "5.2.0", + "tslint": "5.20.0", "tslint-loader": "^3.3.0", - "typescript": "3.3.3", + "typescript": "3.6.4", "webpack": "^1.13.2", "webpack-dev-middleware": "^1.6.1", "webpack-fail-plugin": "2.0.0", diff --git a/packages/examples/all/src/app.tsx b/packages/examples/all/src/app.tsx index adb935f..c5b2c4f 100644 --- a/packages/examples/all/src/app.tsx +++ b/packages/examples/all/src/app.tsx @@ -26,8 +26,6 @@ const examples: { name: string, example: ExampleComponent }[] = [ 'todos', 'todos-with-undo', 'http-search-github', - 'styled-components', - 'color-box', 'increment-number', 'update-number', 'timer', diff --git a/packages/examples/all/src/color-box/index.tsx b/packages/examples/all/src/color-box/index.tsx deleted file mode 100644 index d9e9736..0000000 --- a/packages/examples/all/src/color-box/index.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import * as React from 'react' -import styled from 'styled-components' -import { Atom, F, bind, lift } from '@grammarly/focal' - -interface AppState { - color: string, - width: string -} - -namespace AppState { - export const defaultState: AppState = { - color: 'red', - width: '250' - } -} - -const Box = lift(styled.div` - padding: 20px; - width: ${(props: AppState) => props.width}px; - background: ${(props: AppState) => props.color}; -`) - -const App = (props: { state: Atom }) => { - const color = props.state.lens('color') - const width = props.state.lens('width') - return ( - - Color: -
- -
- {width} -
- ) -} - -export default { - Component: App, - defaultState: AppState.defaultState -} diff --git a/packages/examples/all/src/styled-components/index.tsx b/packages/examples/all/src/styled-components/index.tsx deleted file mode 100644 index 365e54d..0000000 --- a/packages/examples/all/src/styled-components/index.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import * as React from 'react' -import styled from 'styled-components' -import { Atom, bind, lift } from '@grammarly/focal' - -interface AppState { - entry: string -} - -namespace AppState { - export const defaultState: AppState = { - entry: 'Hello World' - } -} - -const Input = lift(styled.input` - width: 100%; - height: 20px; - padding: 2px 0px; - font-size: 15px; - text-align: center; -`) - -const Text = lift(styled.p` - width: 100%; - height: 20px; - font-size: 15px; - text-align: center; -`) - -const App = (props: { state: Atom }) => -

- - {props.state.view('entry')} -
- -export default { - Component: App, - defaultState: AppState.defaultState -} diff --git a/packages/examples/todomvc/package.json b/packages/examples/todomvc/package.json index 20e209b..01e37a3 100644 --- a/packages/examples/todomvc/package.json +++ b/packages/examples/todomvc/package.json @@ -21,20 +21,20 @@ "devDependencies": { "@grammarly/focal": "0.8.0-alpha.0", "@grammarly/tslint-config": "0.5.1", - "@types/react": "16.0.33", - "@types/react-dom": "16.0.3", + "@types/react": "16.9.11", + "@types/react-dom": "16.9.3", "express": "^4.14.0", - "react": "16.2.0", - "react-dom": "16.2.0", + "react": "16.11.0", + "react-dom": "16.11.0", "react-transform-catch-errors": "^1.0.2", "react-transform-hmr": "^1.0.4", "redbox-react": "^1.3.0", "rxjs": "6.3.3", "todomvc-app-css": "^2.0.6", "ts-loader": "^2.3.0", - "tslint": "5.2.0", + "tslint": "5.20.0", "tslint-loader": "^3.3.0", - "typescript": "3.3.3", + "typescript": "3.6.4", "webpack": "^1.13.2", "webpack-dev-middleware": "^1.6.1", "webpack-fail-plugin": "2.0.0", diff --git a/packages/focal/package.json b/packages/focal/package.json index 52826aa..28bd37e 100644 --- a/packages/focal/package.json +++ b/packages/focal/package.json @@ -80,17 +80,17 @@ "dependencies": {}, "devDependencies": { "@grammarly/tslint-config": "0.5.1", - "@types/jest": "^24.0.0", + "@types/jest": "24.0.20", "@types/node": "^6.0.34", - "@types/react": "16.0.33", - "@types/react-dom": "16.0.3", + "@types/react": "16.9.11", + "@types/react-dom": "16.9.3", "jest": "^24.1.0", - "react": "16.2.0", - "react-dom": "16.2.0", + "react": "16.11.0", + "react-dom": "16.11.0", "rxjs": "6.3.3", "ts-jest": "^23.10.5", - "tslint": "5.2.0", - "typescript": "3.3.3" + "tslint": "5.20.0", + "typescript": "3.6.4" }, "peerDependencies": { "@types/react": ">= 16.0.33 < 17.0.0-0", diff --git a/packages/focal/src/react/intrinsic.ts b/packages/focal/src/react/intrinsic.ts index 22e37e1..6471f3a 100644 --- a/packages/focal/src/react/intrinsic.ts +++ b/packages/focal/src/react/intrinsic.ts @@ -69,7 +69,7 @@ export function createLiftedIntrinsics(): LiftedIntrinsics { -readonly [P in keyof LiftedIntrinsics]?: LiftedIntrinsics[P]; } = {} - html.forEach(e => r[e] = liftIntrinsic(e)) + html.forEach(e => (r as any)[e] = liftIntrinsic(e)) r.Fragment = (props: LiftedFragmentAttributes) => React.createElement(LiftWrapper, { component: React.Fragment, props }) diff --git a/packages/focal/src/react/react.ts b/packages/focal/src/react/react.ts index 7de8f48..59a964a 100644 --- a/packages/focal/src/react/react.ts +++ b/packages/focal/src/react/react.ts @@ -89,12 +89,12 @@ export class LiftWrapper subscription.unsubscribe() } - componentWillReceiveProps(newProps: LiftWrapperProps) { + componentDidReceiveProps(newProps: LiftWrapperProps) { this._unsubscribe() this._subscribe(newProps) } - componentWillMount() { + componentDidMount() { this._unsubscribe() this._subscribe(this.props) } diff --git a/packages/test/package.json b/packages/test/package.json index fec47fa..2bcbbc0 100644 --- a/packages/test/package.json +++ b/packages/test/package.json @@ -18,20 +18,20 @@ "@grammarly/focal": "0.8.0-alpha.0", "@grammarly/tslint-config": "0.5.1", "@types/node": "^9.6.0", - "@types/react": "16.0.33", - "@types/react-dom": "16.0.3", + "@types/react": "16.9.11", + "@types/react-dom": "16.9.3", "express": "^4.14.0", - "react": "16.2.0", - "react-dom": "16.2.0", + "react": "16.11.0", + "react-dom": "16.11.0", "react-transform-catch-errors": "^1.0.2", "react-transform-hmr": "^1.0.4", "redbox-react": "^1.3.0", "rxjs": "6.3.3", "todomvc-app-css": "^2.0.6", "ts-loader": "^2.3.0", - "tslint": "5.2.0", "tslint-loader": "^3.3.0", - "typescript": "3.3.3", + "tslint": "5.20.0", + "typescript": "3.6.4", "webpack": "^1.13.2", "webpack-bundle-analyzer": "^2.11.1", "webpack-dev-middleware": "^1.6.1", diff --git a/yarn.lock b/yarn.lock index d248a63..7fd7099 100644 --- a/yarn.lock +++ b/yarn.lock @@ -142,14 +142,17 @@ tslint-microsoft-contrib "4.0.1" tslint-react "^3.0.0" -"@types/jest@^24.0.0": - version "24.0.0" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.0.tgz#848492026c327b3548d92be0352a545c36a21e8a" - integrity sha512-kOafJnUTnMd7/OfEO/x3I47EHswNjn+dbz9qk3mtonr1RvKT+1FGVxnxAx08I9K8Tl7j9hpoJRE7OCf+t10fng== +"@types/jest-diff@*": + version "20.0.1" + resolved "https://registry.yarnpkg.com/@types/jest-diff/-/jest-diff-20.0.1.tgz#35cc15b9c4f30a18ef21852e255fdb02f6d59b89" + integrity sha512-yALhelO3i0hqZwhjtcr6dYyaLoCHbAMshwtj6cGxTvHZAKXHsYGdff6E8EPw3xLKY0ELUTQ69Q1rQiJENnccMA== -"@types/node@*": - version "9.6.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.6.tgz#439b91f9caf3983cad2eef1e11f6bedcbf9431d2" +"@types/jest@24.0.20": + version "24.0.20" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.20.tgz#729d5fe8684e7fb06368d3bd557ac6d91289d861" + integrity sha512-M8ebEkOpykGdLoRrmew7UowTZ1DANeeP0HiSIChl/4DGgmnSC1ntitNtkyNSXjMTsZvXuaxJrxjImEnRWNPsPw== + dependencies: + "@types/jest-diff" "*" "@types/node@^6.0.34": version "6.0.106" @@ -159,16 +162,25 @@ version "9.6.24" resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.24.tgz#c1bccb30f30871718b220b34290ccf53e7ee9317" -"@types/react-dom@16.0.3": - version "16.0.3" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.0.3.tgz#8accad7eabdab4cca3e1a56f5ccb57de2da0ff64" +"@types/prop-types@*": + version "15.7.3" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" + integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== + +"@types/react-dom@16.9.3": + version "16.9.3" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.9.3.tgz#4006ff0e13958af91313869077c04cb20d9b9d04" + integrity sha512-FUuZKXPr9qlzUT9lhuzrZgLjH63TvNn28Ch3MvKG4B+F52zQtO8DtE0Opbncy3xaucNZM2WIPfuNTgkbKx5Brg== dependencies: - "@types/node" "*" "@types/react" "*" -"@types/react@*", "@types/react@16.0.33": - version "16.0.33" - resolved "https://registry.yarnpkg.com/@types/react/-/react-16.0.33.tgz#ee0f7b4dc62eaae311f81ac01cb00bdb0ffcf58f" +"@types/react@*", "@types/react@16.9.11": + version "16.9.11" + resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.11.tgz#70e0b7ad79058a7842f25ccf2999807076ada120" + integrity sha512-UBT4GZ3PokTXSWmdgC/GeCGEJXE5ofWyibCcecRLUVN2ZBpXQGVgQGtG2foS7CrTKFKlQVVswLvf7Js6XA/CVQ== + dependencies: + "@types/prop-types" "*" + csstype "^2.2.0" abab@^2.0.0: version "2.0.0" @@ -554,10 +566,6 @@ body-parser@1.18.2: raw-body "2.3.2" type-is "~1.6.15" -bowser@^1.0.0, bowser@^1.7.3: - version "1.9.3" - resolved "https://registry.yarnpkg.com/bowser/-/bowser-1.9.3.tgz#6643ae4d783f31683f6d23156976b74183862162" - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -647,12 +655,10 @@ buffer@^4.9.0: ieee754 "^1.1.4" isarray "^1.0.0" -buffer@^5.0.2: - version "5.1.0" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.1.0.tgz#c913e43678c7cb7c8bd16afbcddb6c5505e8f9fe" - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" +builtin-modules@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= builtin-status-codes@^3.0.0: version "3.0.0" @@ -875,10 +881,6 @@ colormin@^1.0.5: css-color-names "0.0.4" has "^1.0.1" -colors@0.5.x: - version "0.5.1" - resolved "https://registry.yarnpkg.com/colors/-/colors-0.5.1.tgz#7d0023eaeb154e8ee9fce75dcb923d0ed1667774" - colors@^1.1.2: version "1.2.1" resolved "https://registry.yarnpkg.com/colors/-/colors-1.2.1.tgz#f4a3d302976aaf042356ba1ade3b1a2c62d9d794" @@ -894,6 +896,11 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" +commander@^2.12.1: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + commander@^2.13.0: version "2.15.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" @@ -987,27 +994,10 @@ crypto-browserify@3.3.0: ripemd160 "0.2.0" sha.js "2.2.6" -css-color-list@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/css-color-list/-/css-color-list-0.0.1.tgz#8718e8695ae7a2cc8787be8715f1c008a7f28b15" - dependencies: - css-color-names "0.0.1" - -css-color-names@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.1.tgz#5d0548fa256456ede4a9a0c2ac7ab19d3eb1ad81" - 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@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/css-in-js-utils/-/css-in-js-utils-2.0.1.tgz#3b472b398787291b47cfe3e44fecfdd9e914ba99" - dependencies: - hyphenate-style-name "^1.0.2" - isobject "^3.0.1" - css-loader@^0.26.1: version "0.26.4" resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-0.26.4.tgz#b61e9e30db94303e6ffc892f10ecd09ad025a1fd" @@ -1033,14 +1023,6 @@ css-selector-tokenizer@^0.7.0: fastparse "^1.1.1" regexpu-core "^1.0.0" -css-to-react-native@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/css-to-react-native/-/css-to-react-native-1.0.6.tgz#728c7e774e56536558a0ecaa990d9507c43a4ac4" - dependencies: - css-color-list "0.0.1" - fbjs "^0.8.5" - nearley "^2.7.7" - cssesc@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-0.1.0.tgz#c814903e45623371a0477b40109aaafbeeaddbb4" @@ -1101,6 +1083,11 @@ cssstyle@^1.0.0: dependencies: cssom "0.3.x" +csstype@^2.2.0: + version "2.6.7" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.7.tgz#20b0024c20b6718f4eda3853a1f5a1cce7f5e4a5" + integrity sha512-9Mcn9sFbGBAdmimWb2gLVDtFJzeKtDGIr76TUqmjZrw9LFXBMSU70lcs+C0/7fyCd6iBDqmksUcCOUIkisPHsQ== + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -1236,9 +1223,10 @@ diff@^3.1.0, diff@^3.2.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" -discontinuous-range@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/discontinuous-range/-/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a" +diff@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.1.tgz#0c667cb467ebbb5cea7f14f135cc2dba7780a8ff" + integrity sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q== doctrine@^0.7.2: version "0.7.2" @@ -1590,7 +1578,7 @@ fb-watchman@^2.0.0: dependencies: bser "^2.0.0" -fbjs@^0.8.12, fbjs@^0.8.16, fbjs@^0.8.5, fbjs@^0.8.7: +fbjs@^0.8.16: version "0.8.16" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" dependencies: @@ -1776,16 +1764,6 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" -glamor@^2.20.12: - 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" - glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" @@ -2007,10 +1985,6 @@ https-browserify@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82" -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.19: version "0.4.19" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" @@ -2082,20 +2056,6 @@ ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" -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.6: - version "3.0.8" - resolved "https://registry.yarnpkg.com/inline-style-prefixer/-/inline-style-prefixer-3.0.8.tgz#8551b8e5b4d573244e66a34b04f7d32076a2b534" - dependencies: - bowser "^1.7.3" - css-in-js-utils "^2.0.0" - interpret@^0.6.4: version "0.6.6" resolved "https://registry.yarnpkg.com/interpret/-/interpret-0.6.6.tgz#fecd7a18e7ce5ca6abfb953e1f86213a49f1625b" @@ -2238,10 +2198,6 @@ is-fullwidth-code-point@^2.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= -is-function@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" - is-generator-fn@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.0.0.tgz#038c31b774709641bda678b1f06a4e3227c10b3e" @@ -2764,7 +2720,7 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -js-tokens@^4.0.0: +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== @@ -2777,6 +2733,14 @@ js-yaml@^3.12.0: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^3.13.1: + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== + 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" @@ -2998,6 +2962,13 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: dependencies: js-tokens "^3.0.0" +loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + macaddress@^0.2.8: version "0.2.8" resolved "https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12" @@ -3256,15 +3227,6 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -nearley@^2.7.7: - version "2.13.0" - resolved "https://registry.yarnpkg.com/nearley/-/nearley-2.13.0.tgz#6e7b0f4e68bfc3e74c99eaef2eda39e513143439" - dependencies: - nomnom "~1.6.2" - railroad-diagrams "^1.0.0" - randexp "0.4.6" - semver "^5.4.1" - needle@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.0.tgz#f14efc69cee1024b72c8b21c7bdf94a731dc12fa" @@ -3378,13 +3340,6 @@ node-pre-gyp@^0.9.0: semver "^5.3.0" tar "^4" -nomnom@~1.6.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/nomnom/-/nomnom-1.6.2.tgz#84a66a260174408fc5b77a18f888eccc44fb6971" - dependencies: - colors "0.5.x" - underscore "~1.4.4" - nopt@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" @@ -4040,7 +3995,7 @@ prompts@^2.0.1: kleur "^3.0.2" sisteransi "^1.0.0" -prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.6.0: +prop-types@^15.5.4: version "15.6.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.1.tgz#36644453564255ddda391191fb3a125cbdf654ca" dependencies: @@ -4048,6 +4003,15 @@ prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.6.0: loose-envify "^1.3.1" object-assign "^4.1.1" +prop-types@^15.6.2: + version "15.7.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" + integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.8.1" + proxy-addr@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.3.tgz#355f262505a621646b3130a728eb647e22055341" @@ -4113,17 +4077,6 @@ querystring@0.2.0, querystring@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" -railroad-diagrams@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz#eb7e6267548ddedfb899c1b90e57374559cddb7e" - -randexp@0.4.6: - version "0.4.6" - resolved "https://registry.yarnpkg.com/randexp/-/randexp-0.4.6.tgz#e986ad5e5e31dae13ddd6f7b3019aa7c87f60ca3" - dependencies: - discontinuous-range "1.0.0" - ret "~0.1.10" - randomatic@^1.1.3: version "1.1.7" resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" @@ -4167,14 +4120,20 @@ react-deep-force-update@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-1.1.1.tgz#bcd31478027b64b3339f108921ab520b4313dc2c" -react-dom@16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.2.0.tgz#69003178601c0ca19b709b33a83369fe6124c044" +react-dom@16.11.0: + version "16.11.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.11.0.tgz#7e7c4a5a85a569d565c2462f5d345da2dd849af5" + integrity sha512-nrRyIUE1e7j8PaXSPtyRKtz+2y9ubW/ghNgqKFHHAHaeP0fpF5uXR+sq8IMRHC+ZUxw7W9NyCDTBtwWxvkb0iA== dependencies: - fbjs "^0.8.16" loose-envify "^1.1.0" object-assign "^4.1.1" - prop-types "^15.6.0" + prop-types "^15.6.2" + scheduler "^0.17.0" + +react-is@^16.8.1: + version "16.11.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.11.0.tgz#b85dfecd48ad1ce469ff558a882ca8e8313928fa" + integrity sha512-gbBVYR2p8mnriqAwWx9LbuUrShnAuSCNnuPGyc7GJrMVQtPDAh8iLpv7FRuMPFb56KkaVZIYSz1PrjI9q0QPCw== react-proxy@^1.1.7: version "1.1.8" @@ -4194,14 +4153,14 @@ react-transform-hmr@^1.0.4: global "^4.3.0" react-proxy "^1.1.7" -react@16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/react/-/react-16.2.0.tgz#a31bd2dab89bff65d42134fa187f24d054c273ba" +react@16.11.0: + version "16.11.0" + resolved "https://registry.yarnpkg.com/react/-/react-16.11.0.tgz#d294545fe62299ccee83363599bf904e4a07fdbb" + integrity sha512-M5Y8yITaLmU0ynd0r1Yvfq98Rmll6q8AxaEe88c8e7LxO8fZ2cNgmFt0aGAS9wzf1Ao32NKXtCl+/tVVtkxq6g== dependencies: - fbjs "^0.8.16" loose-envify "^1.1.0" object-assign "^4.1.1" - prop-types "^15.6.0" + prop-types "^15.6.2" read-pkg-up@^4.0.0: version "4.0.0" @@ -4486,6 +4445,14 @@ sax@^1.2.4, sax@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" +scheduler@^0.17.0: + version "0.17.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.17.0.tgz#7c9c673e4ec781fac853927916d1c426b6f3ddfe" + integrity sha512-7rro8Io3tnCPuY4la/NuI5F2yfESpnfZyT6TtkXnSWVkcu0BCDJ+8gk5ozUaFaxpIyNuWAPXrH0yFcSi28fnDA== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + "semver@2 || 3 || 4 || 5", semver@^5.5, semver@^5.5.0: version "5.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" @@ -4867,24 +4834,11 @@ style-loader@^0.13.1: dependencies: loader-utils "^1.0.2" -styled-components@1.4.4: - version "1.4.4" - resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-1.4.4.tgz#c944de423d8ae2363f2ba4ff8fc26d367e7dfa8f" - dependencies: - buffer "^5.0.2" - css-to-react-native "^1.0.6" - fbjs "^0.8.7" - glamor "^2.20.12" - inline-style-prefixer "^2.0.5" - is-function "^1.0.1" - is-plain-object "^2.0.1" - supports-color "^3.1.2" - 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.1.0, supports-color@^3.1.2, supports-color@^3.2.3: +supports-color@^3.1.0, supports-color@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" dependencies: @@ -4955,10 +4909,6 @@ throat@^4.0.0: resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo= -through@^2.3.8: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - time-stamp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-2.0.0.tgz#95c6a44530e15ba8d6f4a3ecb8c3a3fac46da357" @@ -5105,6 +5055,11 @@ tslib@^1.0.0, tslib@^1.6.0, tslib@^1.8.1: version "1.9.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8" +tslib@^1.8.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" + integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== + tslib@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" @@ -5153,6 +5108,25 @@ tslint@5.2.0: tslib "^1.6.0" tsutils "^1.8.0" +tslint@5.20.0: + version "5.20.0" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.20.0.tgz#fac93bfa79568a5a24e7be9cdde5e02b02d00ec1" + integrity sha512-2vqIvkMHbnx8acMogAERQ/IuINOq6DFqgF8/VDvhEkBqQh/x6SP0Y+OHnKth9/ZcHQSroOZwUQSN18v8KKF0/g== + dependencies: + "@babel/code-frame" "^7.0.0" + builtin-modules "^1.1.1" + chalk "^2.3.0" + commander "^2.12.1" + diff "^4.0.1" + glob "^7.1.1" + js-yaml "^3.13.1" + minimatch "^3.0.4" + mkdirp "^0.5.1" + resolve "^1.3.2" + semver "^5.3.0" + tslib "^1.8.0" + tsutils "^2.29.0" + tsutils@^1.4.0, tsutils@^1.8.0: version "1.9.1" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-1.9.1.tgz#b9f9ab44e55af9681831d5f28d0aeeaf5c750cb0" @@ -5163,6 +5137,13 @@ tsutils@^2.13.1: dependencies: tslib "^1.8.1" +tsutils@^2.29.0: + version "2.29.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" + integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== + dependencies: + tslib "^1.8.1" + tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" @@ -5193,10 +5174,10 @@ type-is@~1.6.15, type-is@~1.6.16: media-typer "0.3.0" mime-types "~2.1.18" -typescript@3.3.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.3.tgz#f1657fc7daa27e1a8930758ace9ae8da31403221" - integrity sha512-Y21Xqe54TBVp+VDSNbuDYdGw0BpoR/Q6wo/+35M8PAU0vipahnyduJWirxxdxjsAkS7hue53x2zp8gz7F05u0A== +typescript@3.6.4: + version "3.6.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.4.tgz#b18752bb3792bc1a0281335f7f6ebf1bbfc5b91d" + integrity sha512-unoCll1+l+YK4i4F8f22TaNVPRHcD9PA3yCuZ8g5e0qGqlVlJ/8FSateOLLSagn+Yg5+ZwuPkL8LFUc0Jcvksg== ua-parser-js@^0.7.9: version "0.7.17" @@ -5223,10 +5204,6 @@ uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" -underscore@~1.4.4: - version "1.4.4" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.4.4.tgz#61a6a32010622afa07963bf325203cf12239d604" - union-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" From e73977b7b0a82023e112eae7d1fd34f23711e0f6 Mon Sep 17 00:00:00 2001 From: A-gambit Date: Mon, 28 Oct 2019 18:02:13 +0200 Subject: [PATCH 4/5] Revert "update react & react metods" This reverts commit 8a15d0bb81d69d6b6e8cfb9dd4065b0d27c25d6a. --- package.json | 6 +- packages/examples/all/package.json | 13 +- packages/examples/all/src/app.tsx | 2 + packages/examples/all/src/color-box/index.tsx | 40 +++ .../all/src/styled-components/index.tsx | 42 +++ packages/examples/todomvc/package.json | 12 +- packages/focal/package.json | 14 +- packages/focal/src/react/intrinsic.ts | 2 +- packages/focal/src/react/react.ts | 4 +- packages/test/package.json | 12 +- yarn.lock | 285 ++++++++++-------- 11 files changed, 270 insertions(+), 162 deletions(-) create mode 100644 packages/examples/all/src/color-box/index.tsx create mode 100644 packages/examples/all/src/styled-components/index.tsx diff --git a/package.json b/package.json index 2a90f52..564ddde 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ }, "devDependencies": { "@grammarly/tslint-config": "0.5.1", - "tslint": "5.20.0", - "typescript": "3.6.4" + "tslint": "5.2.0", + "typescript": "3.3.3" }, "workspaces": [ "packages/focal", @@ -19,6 +19,6 @@ "packages/examples/*" ], "resolutions": { - "@types/react": "16.9.11" + "@types/react": "16.0.33" } } diff --git a/packages/examples/all/package.json b/packages/examples/all/package.json index a45c8ea..e6b845d 100644 --- a/packages/examples/all/package.json +++ b/packages/examples/all/package.json @@ -21,22 +21,23 @@ "devDependencies": { "@grammarly/focal": "0.8.0-alpha.0", "@grammarly/tslint-config": "0.5.1", - "@types/react": "16.9.11", - "@types/react-dom": "16.9.3", + "@types/react": "16.0.33", + "@types/react-dom": "16.0.3", "css-loader": "^0.26.1", "express": "^4.14.0", - "react": "16.11.0", - "react-dom": "16.11.0", + "react": "16.2.0", + "react-dom": "16.2.0", "react-transform-catch-errors": "^1.0.2", "react-transform-hmr": "^1.0.4", "redbox-react": "^1.3.0", "rxjs": "6.3.3", "style-loader": "^0.13.1", + "styled-components": "1.4.4", "todomvc-app-css": "^2.0.6", "ts-loader": "^2.3.0", - "tslint": "5.20.0", + "tslint": "5.2.0", "tslint-loader": "^3.3.0", - "typescript": "3.6.4", + "typescript": "3.3.3", "webpack": "^1.13.2", "webpack-dev-middleware": "^1.6.1", "webpack-fail-plugin": "2.0.0", diff --git a/packages/examples/all/src/app.tsx b/packages/examples/all/src/app.tsx index c5b2c4f..adb935f 100644 --- a/packages/examples/all/src/app.tsx +++ b/packages/examples/all/src/app.tsx @@ -26,6 +26,8 @@ const examples: { name: string, example: ExampleComponent }[] = [ 'todos', 'todos-with-undo', 'http-search-github', + 'styled-components', + 'color-box', 'increment-number', 'update-number', 'timer', diff --git a/packages/examples/all/src/color-box/index.tsx b/packages/examples/all/src/color-box/index.tsx new file mode 100644 index 0000000..d9e9736 --- /dev/null +++ b/packages/examples/all/src/color-box/index.tsx @@ -0,0 +1,40 @@ +import * as React from 'react' +import styled from 'styled-components' +import { Atom, F, bind, lift } from '@grammarly/focal' + +interface AppState { + color: string, + width: string +} + +namespace AppState { + export const defaultState: AppState = { + color: 'red', + width: '250' + } +} + +const Box = lift(styled.div` + padding: 20px; + width: ${(props: AppState) => props.width}px; + background: ${(props: AppState) => props.color}; +`) + +const App = (props: { state: Atom }) => { + const color = props.state.lens('color') + const width = props.state.lens('width') + return ( + + Color: +
+ +
+ {width} +
+ ) +} + +export default { + Component: App, + defaultState: AppState.defaultState +} diff --git a/packages/examples/all/src/styled-components/index.tsx b/packages/examples/all/src/styled-components/index.tsx new file mode 100644 index 0000000..365e54d --- /dev/null +++ b/packages/examples/all/src/styled-components/index.tsx @@ -0,0 +1,42 @@ +import * as React from 'react' +import styled from 'styled-components' +import { Atom, bind, lift } from '@grammarly/focal' + +interface AppState { + entry: string +} + +namespace AppState { + export const defaultState: AppState = { + entry: 'Hello World' + } +} + +const Input = lift(styled.input` + width: 100%; + height: 20px; + padding: 2px 0px; + font-size: 15px; + text-align: center; +`) + +const Text = lift(styled.p` + width: 100%; + height: 20px; + font-size: 15px; + text-align: center; +`) + +const App = (props: { state: Atom }) => +
+ + {props.state.view('entry')} +
+ +export default { + Component: App, + defaultState: AppState.defaultState +} diff --git a/packages/examples/todomvc/package.json b/packages/examples/todomvc/package.json index 01e37a3..20e209b 100644 --- a/packages/examples/todomvc/package.json +++ b/packages/examples/todomvc/package.json @@ -21,20 +21,20 @@ "devDependencies": { "@grammarly/focal": "0.8.0-alpha.0", "@grammarly/tslint-config": "0.5.1", - "@types/react": "16.9.11", - "@types/react-dom": "16.9.3", + "@types/react": "16.0.33", + "@types/react-dom": "16.0.3", "express": "^4.14.0", - "react": "16.11.0", - "react-dom": "16.11.0", + "react": "16.2.0", + "react-dom": "16.2.0", "react-transform-catch-errors": "^1.0.2", "react-transform-hmr": "^1.0.4", "redbox-react": "^1.3.0", "rxjs": "6.3.3", "todomvc-app-css": "^2.0.6", "ts-loader": "^2.3.0", - "tslint": "5.20.0", + "tslint": "5.2.0", "tslint-loader": "^3.3.0", - "typescript": "3.6.4", + "typescript": "3.3.3", "webpack": "^1.13.2", "webpack-dev-middleware": "^1.6.1", "webpack-fail-plugin": "2.0.0", diff --git a/packages/focal/package.json b/packages/focal/package.json index 28bd37e..52826aa 100644 --- a/packages/focal/package.json +++ b/packages/focal/package.json @@ -80,17 +80,17 @@ "dependencies": {}, "devDependencies": { "@grammarly/tslint-config": "0.5.1", - "@types/jest": "24.0.20", + "@types/jest": "^24.0.0", "@types/node": "^6.0.34", - "@types/react": "16.9.11", - "@types/react-dom": "16.9.3", + "@types/react": "16.0.33", + "@types/react-dom": "16.0.3", "jest": "^24.1.0", - "react": "16.11.0", - "react-dom": "16.11.0", + "react": "16.2.0", + "react-dom": "16.2.0", "rxjs": "6.3.3", "ts-jest": "^23.10.5", - "tslint": "5.20.0", - "typescript": "3.6.4" + "tslint": "5.2.0", + "typescript": "3.3.3" }, "peerDependencies": { "@types/react": ">= 16.0.33 < 17.0.0-0", diff --git a/packages/focal/src/react/intrinsic.ts b/packages/focal/src/react/intrinsic.ts index 6471f3a..22e37e1 100644 --- a/packages/focal/src/react/intrinsic.ts +++ b/packages/focal/src/react/intrinsic.ts @@ -69,7 +69,7 @@ export function createLiftedIntrinsics(): LiftedIntrinsics { -readonly [P in keyof LiftedIntrinsics]?: LiftedIntrinsics[P]; } = {} - html.forEach(e => (r as any)[e] = liftIntrinsic(e)) + html.forEach(e => r[e] = liftIntrinsic(e)) r.Fragment = (props: LiftedFragmentAttributes) => React.createElement(LiftWrapper, { component: React.Fragment, props }) diff --git a/packages/focal/src/react/react.ts b/packages/focal/src/react/react.ts index 59a964a..7de8f48 100644 --- a/packages/focal/src/react/react.ts +++ b/packages/focal/src/react/react.ts @@ -89,12 +89,12 @@ export class LiftWrapper subscription.unsubscribe() } - componentDidReceiveProps(newProps: LiftWrapperProps) { + componentWillReceiveProps(newProps: LiftWrapperProps) { this._unsubscribe() this._subscribe(newProps) } - componentDidMount() { + componentWillMount() { this._unsubscribe() this._subscribe(this.props) } diff --git a/packages/test/package.json b/packages/test/package.json index 2bcbbc0..fec47fa 100644 --- a/packages/test/package.json +++ b/packages/test/package.json @@ -18,20 +18,20 @@ "@grammarly/focal": "0.8.0-alpha.0", "@grammarly/tslint-config": "0.5.1", "@types/node": "^9.6.0", - "@types/react": "16.9.11", - "@types/react-dom": "16.9.3", + "@types/react": "16.0.33", + "@types/react-dom": "16.0.3", "express": "^4.14.0", - "react": "16.11.0", - "react-dom": "16.11.0", + "react": "16.2.0", + "react-dom": "16.2.0", "react-transform-catch-errors": "^1.0.2", "react-transform-hmr": "^1.0.4", "redbox-react": "^1.3.0", "rxjs": "6.3.3", "todomvc-app-css": "^2.0.6", "ts-loader": "^2.3.0", + "tslint": "5.2.0", "tslint-loader": "^3.3.0", - "tslint": "5.20.0", - "typescript": "3.6.4", + "typescript": "3.3.3", "webpack": "^1.13.2", "webpack-bundle-analyzer": "^2.11.1", "webpack-dev-middleware": "^1.6.1", diff --git a/yarn.lock b/yarn.lock index 7fd7099..d248a63 100644 --- a/yarn.lock +++ b/yarn.lock @@ -142,17 +142,14 @@ tslint-microsoft-contrib "4.0.1" tslint-react "^3.0.0" -"@types/jest-diff@*": - version "20.0.1" - resolved "https://registry.yarnpkg.com/@types/jest-diff/-/jest-diff-20.0.1.tgz#35cc15b9c4f30a18ef21852e255fdb02f6d59b89" - integrity sha512-yALhelO3i0hqZwhjtcr6dYyaLoCHbAMshwtj6cGxTvHZAKXHsYGdff6E8EPw3xLKY0ELUTQ69Q1rQiJENnccMA== +"@types/jest@^24.0.0": + version "24.0.0" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.0.tgz#848492026c327b3548d92be0352a545c36a21e8a" + integrity sha512-kOafJnUTnMd7/OfEO/x3I47EHswNjn+dbz9qk3mtonr1RvKT+1FGVxnxAx08I9K8Tl7j9hpoJRE7OCf+t10fng== -"@types/jest@24.0.20": - version "24.0.20" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.20.tgz#729d5fe8684e7fb06368d3bd557ac6d91289d861" - integrity sha512-M8ebEkOpykGdLoRrmew7UowTZ1DANeeP0HiSIChl/4DGgmnSC1ntitNtkyNSXjMTsZvXuaxJrxjImEnRWNPsPw== - dependencies: - "@types/jest-diff" "*" +"@types/node@*": + version "9.6.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.6.tgz#439b91f9caf3983cad2eef1e11f6bedcbf9431d2" "@types/node@^6.0.34": version "6.0.106" @@ -162,25 +159,16 @@ version "9.6.24" resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.24.tgz#c1bccb30f30871718b220b34290ccf53e7ee9317" -"@types/prop-types@*": - version "15.7.3" - resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" - integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== - -"@types/react-dom@16.9.3": - version "16.9.3" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.9.3.tgz#4006ff0e13958af91313869077c04cb20d9b9d04" - integrity sha512-FUuZKXPr9qlzUT9lhuzrZgLjH63TvNn28Ch3MvKG4B+F52zQtO8DtE0Opbncy3xaucNZM2WIPfuNTgkbKx5Brg== +"@types/react-dom@16.0.3": + version "16.0.3" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.0.3.tgz#8accad7eabdab4cca3e1a56f5ccb57de2da0ff64" dependencies: + "@types/node" "*" "@types/react" "*" -"@types/react@*", "@types/react@16.9.11": - version "16.9.11" - resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.11.tgz#70e0b7ad79058a7842f25ccf2999807076ada120" - integrity sha512-UBT4GZ3PokTXSWmdgC/GeCGEJXE5ofWyibCcecRLUVN2ZBpXQGVgQGtG2foS7CrTKFKlQVVswLvf7Js6XA/CVQ== - dependencies: - "@types/prop-types" "*" - csstype "^2.2.0" +"@types/react@*", "@types/react@16.0.33": + version "16.0.33" + resolved "https://registry.yarnpkg.com/@types/react/-/react-16.0.33.tgz#ee0f7b4dc62eaae311f81ac01cb00bdb0ffcf58f" abab@^2.0.0: version "2.0.0" @@ -566,6 +554,10 @@ body-parser@1.18.2: raw-body "2.3.2" type-is "~1.6.15" +bowser@^1.0.0, bowser@^1.7.3: + version "1.9.3" + resolved "https://registry.yarnpkg.com/bowser/-/bowser-1.9.3.tgz#6643ae4d783f31683f6d23156976b74183862162" + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -655,10 +647,12 @@ buffer@^4.9.0: ieee754 "^1.1.4" isarray "^1.0.0" -builtin-modules@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= +buffer@^5.0.2: + version "5.1.0" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.1.0.tgz#c913e43678c7cb7c8bd16afbcddb6c5505e8f9fe" + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" builtin-status-codes@^3.0.0: version "3.0.0" @@ -881,6 +875,10 @@ colormin@^1.0.5: css-color-names "0.0.4" has "^1.0.1" +colors@0.5.x: + version "0.5.1" + resolved "https://registry.yarnpkg.com/colors/-/colors-0.5.1.tgz#7d0023eaeb154e8ee9fce75dcb923d0ed1667774" + colors@^1.1.2: version "1.2.1" resolved "https://registry.yarnpkg.com/colors/-/colors-1.2.1.tgz#f4a3d302976aaf042356ba1ade3b1a2c62d9d794" @@ -896,11 +894,6 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -commander@^2.12.1: - version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - commander@^2.13.0: version "2.15.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" @@ -994,10 +987,27 @@ crypto-browserify@3.3.0: ripemd160 "0.2.0" sha.js "2.2.6" +css-color-list@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/css-color-list/-/css-color-list-0.0.1.tgz#8718e8695ae7a2cc8787be8715f1c008a7f28b15" + dependencies: + css-color-names "0.0.1" + +css-color-names@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.1.tgz#5d0548fa256456ede4a9a0c2ac7ab19d3eb1ad81" + 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@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/css-in-js-utils/-/css-in-js-utils-2.0.1.tgz#3b472b398787291b47cfe3e44fecfdd9e914ba99" + dependencies: + hyphenate-style-name "^1.0.2" + isobject "^3.0.1" + css-loader@^0.26.1: version "0.26.4" resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-0.26.4.tgz#b61e9e30db94303e6ffc892f10ecd09ad025a1fd" @@ -1023,6 +1033,14 @@ css-selector-tokenizer@^0.7.0: fastparse "^1.1.1" regexpu-core "^1.0.0" +css-to-react-native@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/css-to-react-native/-/css-to-react-native-1.0.6.tgz#728c7e774e56536558a0ecaa990d9507c43a4ac4" + dependencies: + css-color-list "0.0.1" + fbjs "^0.8.5" + nearley "^2.7.7" + cssesc@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-0.1.0.tgz#c814903e45623371a0477b40109aaafbeeaddbb4" @@ -1083,11 +1101,6 @@ cssstyle@^1.0.0: dependencies: cssom "0.3.x" -csstype@^2.2.0: - version "2.6.7" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.7.tgz#20b0024c20b6718f4eda3853a1f5a1cce7f5e4a5" - integrity sha512-9Mcn9sFbGBAdmimWb2gLVDtFJzeKtDGIr76TUqmjZrw9LFXBMSU70lcs+C0/7fyCd6iBDqmksUcCOUIkisPHsQ== - dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -1223,10 +1236,9 @@ diff@^3.1.0, diff@^3.2.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" -diff@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.1.tgz#0c667cb467ebbb5cea7f14f135cc2dba7780a8ff" - integrity sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q== +discontinuous-range@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/discontinuous-range/-/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a" doctrine@^0.7.2: version "0.7.2" @@ -1578,7 +1590,7 @@ fb-watchman@^2.0.0: dependencies: bser "^2.0.0" -fbjs@^0.8.16: +fbjs@^0.8.12, fbjs@^0.8.16, fbjs@^0.8.5, fbjs@^0.8.7: version "0.8.16" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" dependencies: @@ -1764,6 +1776,16 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" +glamor@^2.20.12: + 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" + glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" @@ -1985,6 +2007,10 @@ https-browserify@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82" +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.19: version "0.4.19" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" @@ -2056,6 +2082,20 @@ ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" +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.6: + version "3.0.8" + resolved "https://registry.yarnpkg.com/inline-style-prefixer/-/inline-style-prefixer-3.0.8.tgz#8551b8e5b4d573244e66a34b04f7d32076a2b534" + dependencies: + bowser "^1.7.3" + css-in-js-utils "^2.0.0" + interpret@^0.6.4: version "0.6.6" resolved "https://registry.yarnpkg.com/interpret/-/interpret-0.6.6.tgz#fecd7a18e7ce5ca6abfb953e1f86213a49f1625b" @@ -2198,6 +2238,10 @@ is-fullwidth-code-point@^2.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= +is-function@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" + is-generator-fn@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.0.0.tgz#038c31b774709641bda678b1f06a4e3227c10b3e" @@ -2720,7 +2764,7 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: +js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== @@ -2733,14 +2777,6 @@ js-yaml@^3.12.0: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^3.13.1: - version "3.13.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" - integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== - 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" @@ -2962,13 +2998,6 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: dependencies: js-tokens "^3.0.0" -loose-envify@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" - integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== - dependencies: - js-tokens "^3.0.0 || ^4.0.0" - macaddress@^0.2.8: version "0.2.8" resolved "https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12" @@ -3227,6 +3256,15 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= +nearley@^2.7.7: + version "2.13.0" + resolved "https://registry.yarnpkg.com/nearley/-/nearley-2.13.0.tgz#6e7b0f4e68bfc3e74c99eaef2eda39e513143439" + dependencies: + nomnom "~1.6.2" + railroad-diagrams "^1.0.0" + randexp "0.4.6" + semver "^5.4.1" + needle@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.0.tgz#f14efc69cee1024b72c8b21c7bdf94a731dc12fa" @@ -3340,6 +3378,13 @@ node-pre-gyp@^0.9.0: semver "^5.3.0" tar "^4" +nomnom@~1.6.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/nomnom/-/nomnom-1.6.2.tgz#84a66a260174408fc5b77a18f888eccc44fb6971" + dependencies: + colors "0.5.x" + underscore "~1.4.4" + nopt@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" @@ -3995,7 +4040,7 @@ prompts@^2.0.1: kleur "^3.0.2" sisteransi "^1.0.0" -prop-types@^15.5.4: +prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.6.0: version "15.6.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.1.tgz#36644453564255ddda391191fb3a125cbdf654ca" dependencies: @@ -4003,15 +4048,6 @@ prop-types@^15.5.4: loose-envify "^1.3.1" object-assign "^4.1.1" -prop-types@^15.6.2: - version "15.7.2" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" - integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== - dependencies: - loose-envify "^1.4.0" - object-assign "^4.1.1" - react-is "^16.8.1" - proxy-addr@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.3.tgz#355f262505a621646b3130a728eb647e22055341" @@ -4077,6 +4113,17 @@ querystring@0.2.0, querystring@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" +railroad-diagrams@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz#eb7e6267548ddedfb899c1b90e57374559cddb7e" + +randexp@0.4.6: + version "0.4.6" + resolved "https://registry.yarnpkg.com/randexp/-/randexp-0.4.6.tgz#e986ad5e5e31dae13ddd6f7b3019aa7c87f60ca3" + dependencies: + discontinuous-range "1.0.0" + ret "~0.1.10" + randomatic@^1.1.3: version "1.1.7" resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" @@ -4120,20 +4167,14 @@ react-deep-force-update@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-1.1.1.tgz#bcd31478027b64b3339f108921ab520b4313dc2c" -react-dom@16.11.0: - version "16.11.0" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.11.0.tgz#7e7c4a5a85a569d565c2462f5d345da2dd849af5" - integrity sha512-nrRyIUE1e7j8PaXSPtyRKtz+2y9ubW/ghNgqKFHHAHaeP0fpF5uXR+sq8IMRHC+ZUxw7W9NyCDTBtwWxvkb0iA== +react-dom@16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.2.0.tgz#69003178601c0ca19b709b33a83369fe6124c044" dependencies: + fbjs "^0.8.16" loose-envify "^1.1.0" object-assign "^4.1.1" - prop-types "^15.6.2" - scheduler "^0.17.0" - -react-is@^16.8.1: - version "16.11.0" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.11.0.tgz#b85dfecd48ad1ce469ff558a882ca8e8313928fa" - integrity sha512-gbBVYR2p8mnriqAwWx9LbuUrShnAuSCNnuPGyc7GJrMVQtPDAh8iLpv7FRuMPFb56KkaVZIYSz1PrjI9q0QPCw== + prop-types "^15.6.0" react-proxy@^1.1.7: version "1.1.8" @@ -4153,14 +4194,14 @@ react-transform-hmr@^1.0.4: global "^4.3.0" react-proxy "^1.1.7" -react@16.11.0: - version "16.11.0" - resolved "https://registry.yarnpkg.com/react/-/react-16.11.0.tgz#d294545fe62299ccee83363599bf904e4a07fdbb" - integrity sha512-M5Y8yITaLmU0ynd0r1Yvfq98Rmll6q8AxaEe88c8e7LxO8fZ2cNgmFt0aGAS9wzf1Ao32NKXtCl+/tVVtkxq6g== +react@16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/react/-/react-16.2.0.tgz#a31bd2dab89bff65d42134fa187f24d054c273ba" dependencies: + fbjs "^0.8.16" loose-envify "^1.1.0" object-assign "^4.1.1" - prop-types "^15.6.2" + prop-types "^15.6.0" read-pkg-up@^4.0.0: version "4.0.0" @@ -4445,14 +4486,6 @@ sax@^1.2.4, sax@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" -scheduler@^0.17.0: - version "0.17.0" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.17.0.tgz#7c9c673e4ec781fac853927916d1c426b6f3ddfe" - integrity sha512-7rro8Io3tnCPuY4la/NuI5F2yfESpnfZyT6TtkXnSWVkcu0BCDJ+8gk5ozUaFaxpIyNuWAPXrH0yFcSi28fnDA== - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - "semver@2 || 3 || 4 || 5", semver@^5.5, semver@^5.5.0: version "5.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" @@ -4834,11 +4867,24 @@ style-loader@^0.13.1: dependencies: loader-utils "^1.0.2" +styled-components@1.4.4: + version "1.4.4" + resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-1.4.4.tgz#c944de423d8ae2363f2ba4ff8fc26d367e7dfa8f" + dependencies: + buffer "^5.0.2" + css-to-react-native "^1.0.6" + fbjs "^0.8.7" + glamor "^2.20.12" + inline-style-prefixer "^2.0.5" + is-function "^1.0.1" + is-plain-object "^2.0.1" + supports-color "^3.1.2" + 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.1.0, supports-color@^3.2.3: +supports-color@^3.1.0, supports-color@^3.1.2, supports-color@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" dependencies: @@ -4909,6 +4955,10 @@ throat@^4.0.0: resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo= +through@^2.3.8: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + time-stamp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-2.0.0.tgz#95c6a44530e15ba8d6f4a3ecb8c3a3fac46da357" @@ -5055,11 +5105,6 @@ tslib@^1.0.0, tslib@^1.6.0, tslib@^1.8.1: version "1.9.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8" -tslib@^1.8.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" - integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== - tslib@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" @@ -5108,25 +5153,6 @@ tslint@5.2.0: tslib "^1.6.0" tsutils "^1.8.0" -tslint@5.20.0: - version "5.20.0" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.20.0.tgz#fac93bfa79568a5a24e7be9cdde5e02b02d00ec1" - integrity sha512-2vqIvkMHbnx8acMogAERQ/IuINOq6DFqgF8/VDvhEkBqQh/x6SP0Y+OHnKth9/ZcHQSroOZwUQSN18v8KKF0/g== - dependencies: - "@babel/code-frame" "^7.0.0" - builtin-modules "^1.1.1" - chalk "^2.3.0" - commander "^2.12.1" - diff "^4.0.1" - glob "^7.1.1" - js-yaml "^3.13.1" - minimatch "^3.0.4" - mkdirp "^0.5.1" - resolve "^1.3.2" - semver "^5.3.0" - tslib "^1.8.0" - tsutils "^2.29.0" - tsutils@^1.4.0, tsutils@^1.8.0: version "1.9.1" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-1.9.1.tgz#b9f9ab44e55af9681831d5f28d0aeeaf5c750cb0" @@ -5137,13 +5163,6 @@ tsutils@^2.13.1: dependencies: tslib "^1.8.1" -tsutils@^2.29.0: - version "2.29.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" - integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== - dependencies: - tslib "^1.8.1" - tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" @@ -5174,10 +5193,10 @@ type-is@~1.6.15, type-is@~1.6.16: media-typer "0.3.0" mime-types "~2.1.18" -typescript@3.6.4: - version "3.6.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.4.tgz#b18752bb3792bc1a0281335f7f6ebf1bbfc5b91d" - integrity sha512-unoCll1+l+YK4i4F8f22TaNVPRHcD9PA3yCuZ8g5e0qGqlVlJ/8FSateOLLSagn+Yg5+ZwuPkL8LFUc0Jcvksg== +typescript@3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.3.tgz#f1657fc7daa27e1a8930758ace9ae8da31403221" + integrity sha512-Y21Xqe54TBVp+VDSNbuDYdGw0BpoR/Q6wo/+35M8PAU0vipahnyduJWirxxdxjsAkS7hue53x2zp8gz7F05u0A== ua-parser-js@^0.7.9: version "0.7.17" @@ -5204,6 +5223,10 @@ uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" +underscore@~1.4.4: + version "1.4.4" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.4.4.tgz#61a6a32010622afa07963bf325203cf12239d604" + union-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" From c9914a95f9181003a7ee51873b781e61310aebd0 Mon Sep 17 00:00:00 2001 From: Gregory Shehet Date: Tue, 29 Oct 2019 15:44:37 +0200 Subject: [PATCH 5/5] Update react.ts --- packages/focal/src/react/react.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/focal/src/react/react.ts b/packages/focal/src/react/react.ts index 7de8f48..bddaa9f 100644 --- a/packages/focal/src/react/react.ts +++ b/packages/focal/src/react/react.ts @@ -256,10 +256,10 @@ function render

( for (let j = 0; j < i; ++j) newChildren[j] = propValue[j] } - const child = observedValues[++k] - newChildren[i] = !child || child.key - ? child - : React.createElement(React.Fragment, { key: i }, child) + const childValue = observedValues[++k] + newChildren[i] = !childValue || childValue.key + ? childValue + : React.createElement(React.Fragment, { key: i }, childValue) } else if (newChildren) { newChildren[i] = propValue[i] }