From aef555f4a7bc9be78d0315a9a8a83006e81fa22a Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Wed, 19 Sep 2018 01:53:26 +0200 Subject: [PATCH] Still having TypeScript issue #26395 See https://github.com/Microsoft/TypeScript/issues/26395 --- examples/ClubMembers/package.json | 2 +- examples/HTML5Constraints/package.json | 2 +- examples/MaterialUI/package.json | 2 +- examples/NoFramework/package.json | 2 +- examples/Password/package.json | 2 +- examples/PasswordNoState/package.json | 2 +- examples/ReactNative/package.json | 2 +- examples/ServerSideRendering/package.json | 2 +- examples/SignUp/package.json | 2 +- examples/WizardForm/package.json | 2 +- package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../react-form-with-constraints/package.json | 2 +- .../src/InputElement.ts | 11 ++- tsconfig-react-es5.json | 3 +- yarn.lock | 79 +++++++++++-------- 19 files changed, 71 insertions(+), 54 deletions(-) diff --git a/examples/ClubMembers/package.json b/examples/ClubMembers/package.json index bff2e682..e057624a 100644 --- a/examples/ClubMembers/package.json +++ b/examples/ClubMembers/package.json @@ -25,7 +25,7 @@ }, "devDependencies": { - "typescript": "^2.9.2", + "typescript": "next", "@types/react": "latest", "@types/react-dom": "latest", diff --git a/examples/HTML5Constraints/package.json b/examples/HTML5Constraints/package.json index 1cbe79fa..c06f9bf7 100644 --- a/examples/HTML5Constraints/package.json +++ b/examples/HTML5Constraints/package.json @@ -18,7 +18,7 @@ }, "devDependencies": { - "typescript": "^2.9.2", + "typescript": "next", "@types/react": "latest", "@types/react-dom": "latest", diff --git a/examples/MaterialUI/package.json b/examples/MaterialUI/package.json index 97fbcefe..41ca4036 100644 --- a/examples/MaterialUI/package.json +++ b/examples/MaterialUI/package.json @@ -26,7 +26,7 @@ }, "devDependencies": { - "typescript": "^2.9.2", + "typescript": "next", "@types/react": "latest", "@types/react-dom": "latest", diff --git a/examples/NoFramework/package.json b/examples/NoFramework/package.json index 937df714..ae19e973 100644 --- a/examples/NoFramework/package.json +++ b/examples/NoFramework/package.json @@ -18,7 +18,7 @@ }, "devDependencies": { - "typescript": "^2.9.2", + "typescript": "next", "@types/react": "latest", "@types/react-dom": "latest", diff --git a/examples/Password/package.json b/examples/Password/package.json index 54d7c5d0..b7d96312 100644 --- a/examples/Password/package.json +++ b/examples/Password/package.json @@ -24,7 +24,7 @@ }, "devDependencies": { - "typescript": "^2.9.2", + "typescript": "next", "@types/react": "latest", "@types/react-dom": "latest", diff --git a/examples/PasswordNoState/package.json b/examples/PasswordNoState/package.json index 9bd5cd13..f369db93 100644 --- a/examples/PasswordNoState/package.json +++ b/examples/PasswordNoState/package.json @@ -20,7 +20,7 @@ }, "devDependencies": { - "typescript": "^2.9.2", + "typescript": "next", "@types/react": "latest", "@types/react-dom": "latest", diff --git a/examples/ReactNative/package.json b/examples/ReactNative/package.json index 1ca022f7..7ff677ac 100644 --- a/examples/ReactNative/package.json +++ b/examples/ReactNative/package.json @@ -34,7 +34,7 @@ }, "devDependencies": { - "typescript": "^2.9.2", + "typescript": "next", "@types/react": "latest", "@types/react-native": "latest", diff --git a/examples/ServerSideRendering/package.json b/examples/ServerSideRendering/package.json index 25ebadfd..6a1033c3 100644 --- a/examples/ServerSideRendering/package.json +++ b/examples/ServerSideRendering/package.json @@ -24,7 +24,7 @@ }, "devDependencies": { - "typescript": "^2.9.2", + "typescript": "next", "@types/react": "latest", "@types/react-dom": "latest", diff --git a/examples/SignUp/package.json b/examples/SignUp/package.json index a4f5f587..8c1174f5 100644 --- a/examples/SignUp/package.json +++ b/examples/SignUp/package.json @@ -29,7 +29,7 @@ }, "devDependencies": { - "typescript": "^2.9.2", + "typescript": "next", "@types/react": "latest", "@types/react-dom": "latest", diff --git a/examples/WizardForm/package.json b/examples/WizardForm/package.json index dca34037..33a4c0f4 100644 --- a/examples/WizardForm/package.json +++ b/examples/WizardForm/package.json @@ -20,7 +20,7 @@ }, "devDependencies": { - "typescript": "^2.9.2", + "typescript": "next", "@types/react": "latest", "@types/react-dom": "latest", diff --git a/package.json b/package.json index a0e485db..d8f15ebe 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "devDependencies": { "lerna": "latest", - "typescript": "^2.9.2", + "typescript": "next", "tslint": "latest", "tslint-react": "latest" diff --git a/packages/react-form-with-constraints-bootstrap4/package.json b/packages/react-form-with-constraints-bootstrap4/package.json index 55500be7..d095e0b2 100644 --- a/packages/react-form-with-constraints-bootstrap4/package.json +++ b/packages/react-form-with-constraints-bootstrap4/package.json @@ -41,7 +41,7 @@ }, "devDependencies": { - "typescript": "^2.9.2", + "typescript": "next", "react": "latest", "@types/react": "latest", diff --git a/packages/react-form-with-constraints-material-ui/package.json b/packages/react-form-with-constraints-material-ui/package.json index b27d99ab..faee9ff0 100644 --- a/packages/react-form-with-constraints-material-ui/package.json +++ b/packages/react-form-with-constraints-material-ui/package.json @@ -41,7 +41,7 @@ }, "devDependencies": { - "typescript": "^2.9.2", + "typescript": "next", "react": "latest", "@types/react": "latest", diff --git a/packages/react-form-with-constraints-native/package.json b/packages/react-form-with-constraints-native/package.json index 725cfca6..36320475 100644 --- a/packages/react-form-with-constraints-native/package.json +++ b/packages/react-form-with-constraints-native/package.json @@ -38,7 +38,7 @@ }, "devDependencies": { - "typescript": "^2.9.2", + "typescript": "next", "react": "16.0.0", "@types/react": "latest", diff --git a/packages/react-form-with-constraints-tools/package.json b/packages/react-form-with-constraints-tools/package.json index f4ea0d29..4bd5a883 100644 --- a/packages/react-form-with-constraints-tools/package.json +++ b/packages/react-form-with-constraints-tools/package.json @@ -39,7 +39,7 @@ }, "devDependencies": { - "typescript": "^2.9.2", + "typescript": "next", "react": "latest", "@types/react": "latest", diff --git a/packages/react-form-with-constraints/package.json b/packages/react-form-with-constraints/package.json index f39d1662..aa73efa7 100644 --- a/packages/react-form-with-constraints/package.json +++ b/packages/react-form-with-constraints/package.json @@ -47,7 +47,7 @@ }, "devDependencies": { - "typescript": "^2.9.2", + "typescript": "next", "react": "latest", "@types/react": "latest", diff --git a/packages/react-form-with-constraints/src/InputElement.ts b/packages/react-form-with-constraints/src/InputElement.ts index fd450c37..61d7a690 100644 --- a/packages/react-form-with-constraints/src/InputElement.ts +++ b/packages/react-form-with-constraints/src/InputElement.ts @@ -17,7 +17,7 @@ export class InputElement { // HTMLButtonElement, HTMLFieldSetElement, HTMLInputElement, HTMLObjectElement, // HTMLOutputElement, HTMLSelectElement, HTMLTextAreaElement // ValidityState is supported by IE >= 10 - readonly validity: IValidityState; + readonly validity: ValidityState; readonly validationMessage: string; // Need to duplicate the input when the user changes rapidly the input @@ -30,13 +30,13 @@ export class InputElement { this.value = input.value; // Solution 1: no clone, then .mock.calls never ends with ValidityState inside FormWithConstraints.test.tsx in v0.8 - //this.validity = input.validity; + this.validity = input.validity; // Solution 2: JSON does not work to clone ValidityState (results in an empty object) //this.validity = JSON.parse(JSON.stringify(input.validity)); // Solution 3: manually clone ValidityState - this.validity = new IValidityState(input.validity as ValidityState); + //this.validity = new IValidityState(input.validity as ValidityState); this.validationMessage = input.validationMessage; } else { @@ -53,7 +53,11 @@ export class InputElement { // Cannot clone ValidityState using JSON.parse(JSON.stringify(input.validity)), // results in an empty object ({}) under Chrome 66, Firefox 60 and Safari 10.1.2 // so let's manually clone it. +/* export class IValidityState implements ValidityState { + // FIXME + // See Crash: TypeError: Cannot read property 'kind' of undefined (at isConstraintPosition) https://github.com/Microsoft/TypeScript/issues/26978 + readonly badInput: boolean; readonly customError: boolean; readonly patternMismatch: boolean; @@ -80,3 +84,4 @@ export class IValidityState implements ValidityState { this.valueMissing = validity.valueMissing; } } +*/ diff --git a/tsconfig-react-es5.json b/tsconfig-react-es5.json index 3e80ea6b..dd1329a8 100644 --- a/tsconfig-react-es5.json +++ b/tsconfig-react-es5.json @@ -8,8 +8,7 @@ "moduleResolution": "node", "esModuleInterop": true, "allowSyntheticDefaultImports": true, // FIXME https://github.com/Microsoft/TypeScript/issues/26193 - "noLib": false, - "lib": ["dom.iterable", "es2017"], + "lib": ["dom", "dom.iterable", "es2018"], "experimentalDecorators": true, "noUnusedLocals": true, "noUnusedParameters": true, diff --git a/yarn.lock b/yarn.lock index 82fc4c45..36f61e39 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2093,8 +2093,8 @@ big.js@^3.1.3: resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e" binary-extensions@^1.0.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" + version "1.12.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" bl@^1.0.0: version "1.2.2" @@ -2704,9 +2704,15 @@ columnify@^1.5.4: strip-ansi "^3.0.0" wcwidth "^1.0.0" -combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5, combined-stream@~1.0.6: +combined-stream@1.0.6: version "1.0.6" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" + resolved "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" + dependencies: + delayed-stream "~1.0.0" + +combined-stream@^1.0.5, combined-stream@~1.0.5, combined-stream@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" dependencies: delayed-stream "~1.0.0" @@ -6227,7 +6233,7 @@ libnpmaccess@^3.0.0: load-json-file@^1.0.0: version "1.1.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + resolved "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" dependencies: graceful-fs "^4.1.2" parse-json "^2.2.0" @@ -6237,7 +6243,7 @@ load-json-file@^1.0.0: load-json-file@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + resolved "http://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" dependencies: graceful-fs "^4.1.2" parse-json "^2.2.0" @@ -6764,8 +6770,8 @@ min-document@^2.19.0: dom-walk "^0.1.0" mini-css-extract-plugin@latest: - version "0.4.2" - resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.4.2.tgz#b3ecc0d6b1bbe5ff14add42b946a7b200cf78651" + version "0.4.3" + resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.4.3.tgz#98d60fcc5d228c3e36a9bd15a1d6816d6580beb8" dependencies: loader-utils "^1.1.0" schema-utils "^1.0.0" @@ -6879,8 +6885,8 @@ mobx-react@latest: react-lifecycles-compat "^3.0.2" mobx@latest: - version "5.1.1" - resolved "https://registry.yarnpkg.com/mobx/-/mobx-5.1.1.tgz#b8579ea7e7fbb07b79d56a71c3191287afc45f93" + version "5.1.2" + resolved "https://registry.yarnpkg.com/mobx/-/mobx-5.1.2.tgz#5a3a0bc381ba155901e33eabe492c3c7482e8b35" modify-values@^1.0.0: version "1.0.1" @@ -8190,13 +8196,13 @@ react-devtools-core@^2.5.0: ws "^2.0.3" react-dom@latest: - version "16.5.1" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.5.1.tgz#29d0c5a01ed3b6b4c14309aa91af6ec4eb4f292c" + version "16.5.2" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.5.2.tgz#b69ee47aa20bab5327b2b9d7c1fe2a30f2cfa9d7" dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" prop-types "^15.6.2" - schedule "^0.4.0" + schedule "^0.5.0" react-event-listener@^0.6.2: version "0.6.3" @@ -8214,9 +8220,9 @@ react-i18next@latest: html-parse-stringify2 "2.0.1" prop-types "^15.6.0" -react-is@^16.4.2, react-is@^16.5.1: - version "16.5.1" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.5.1.tgz#c6e8734fd548a22e1cef4fd0833afbeb433b85ee" +react-is@^16.4.2, react-is@^16.5.2: + version "16.5.2" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.5.2.tgz#e2a7b7c3f5d48062eb769fcb123505eb928722e3" react-jss@^8.1.0: version "8.6.1" @@ -8304,13 +8310,13 @@ react-test-renderer@16.0.0: object-assign "^4.1.1" react-test-renderer@^16.0.0-0: - version "16.5.1" - resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.5.1.tgz#17f020fb0cf884cadebb5240d9d9c23452f18299" + version "16.5.2" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.5.2.tgz#92e9d2c6f763b9821b2e0b22f994ee675068b5ae" dependencies: object-assign "^4.1.1" prop-types "^15.6.2" - react-is "^16.5.1" - schedule "^0.4.0" + react-is "^16.5.2" + schedule "^0.5.0" react-timer-mixin@^0.13.2: version "0.13.4" @@ -8342,13 +8348,13 @@ react@16.0.0: prop-types "^15.6.0" react@latest: - version "16.5.1" - resolved "https://registry.yarnpkg.com/react/-/react-16.5.1.tgz#8cb8e9f8cdcb4bde41c9a138bfbf907e66132372" + version "16.5.2" + resolved "https://registry.yarnpkg.com/react/-/react-16.5.2.tgz#19f6b444ed139baa45609eee6dc3d318b3895d42" dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" prop-types "^15.6.2" - schedule "^0.4.0" + schedule "^0.5.0" read-cmd-shim@^1.0.1: version "1.0.1" @@ -8836,7 +8842,7 @@ rollup-plugin-uglify@latest: serialize-javascript "^1.5.0" uglify-js "^3.4.9" -rollup-pluginutils@2.3.1, rollup-pluginutils@latest: +rollup-pluginutils@2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.3.1.tgz#760d185ccc237dedc12d7ae48c6bcd127b4892d0" dependencies: @@ -8845,11 +8851,18 @@ rollup-pluginutils@2.3.1, rollup-pluginutils@latest: rollup-pluginutils@^1.3.1: version "1.5.2" - resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408" + resolved "http://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408" dependencies: estree-walker "^0.2.1" minimatch "^3.0.2" +rollup-pluginutils@latest: + version "2.3.2" + resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.3.2.tgz#78d99a0a4baa281c80e23e5d911251ed5ab27d4f" + dependencies: + estree-walker "^0.5.2" + micromatch "^3.1.10" + rollup@latest: version "0.66.0" resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.66.0.tgz#697acc008f4b613695b17222c7626affddf4a506" @@ -8961,9 +8974,9 @@ sax@~1.1.1: version "1.1.6" resolved "http://registry.npmjs.org/sax/-/sax-1.1.6.tgz#5d616be8a5e607d54e114afae55b7eaf2fcc3240" -schedule@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/schedule/-/schedule-0.4.0.tgz#fa20cfd0bfbf91c47d02272fd7096780d3170bbb" +schedule@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/schedule/-/schedule-0.5.0.tgz#c128fffa0b402488b08b55ae74bb9df55cc29cc8" dependencies: object-assign "^4.1.1" @@ -9936,9 +9949,9 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -typescript@^2.9.2: - version "2.9.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c" +typescript@next: + version "3.1.0-dev.20180918" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.0-dev.20180918.tgz#17ca3de221cfef96b5e33c5444b0c9ca1d104c02" ua-parser-js@^0.7.18: version "0.7.18" @@ -10300,8 +10313,8 @@ webpack-sources@^1.1.0, webpack-sources@^1.2.0: source-map "~0.6.1" webpack@latest: - version "4.19.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.19.0.tgz#252296c8af2d21c0994911007defdb3913a7bc66" + version "4.19.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.19.1.tgz#096674bc3b573f8756c762754366e5b333d6576f" dependencies: "@webassemblyjs/ast" "1.7.6" "@webassemblyjs/helper-module-context" "1.7.6"