Skip to content

Commit

Permalink
Still having TypeScript issue #26395
Browse files Browse the repository at this point in the history
  • Loading branch information
tkrotoff committed Sep 18, 2018
1 parent 3b9e2ec commit aef555f
Show file tree
Hide file tree
Showing 19 changed files with 71 additions and 54 deletions.
2 changes: 1 addition & 1 deletion examples/ClubMembers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},

"devDependencies": {
"typescript": "^2.9.2",
"typescript": "next",

"@types/react": "latest",
"@types/react-dom": "latest",
Expand Down
2 changes: 1 addition & 1 deletion examples/HTML5Constraints/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},

"devDependencies": {
"typescript": "^2.9.2",
"typescript": "next",

"@types/react": "latest",
"@types/react-dom": "latest",
Expand Down
2 changes: 1 addition & 1 deletion examples/MaterialUI/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},

"devDependencies": {
"typescript": "^2.9.2",
"typescript": "next",

"@types/react": "latest",
"@types/react-dom": "latest",
Expand Down
2 changes: 1 addition & 1 deletion examples/NoFramework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},

"devDependencies": {
"typescript": "^2.9.2",
"typescript": "next",

"@types/react": "latest",
"@types/react-dom": "latest",
Expand Down
2 changes: 1 addition & 1 deletion examples/Password/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},

"devDependencies": {
"typescript": "^2.9.2",
"typescript": "next",

"@types/react": "latest",
"@types/react-dom": "latest",
Expand Down
2 changes: 1 addition & 1 deletion examples/PasswordNoState/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},

"devDependencies": {
"typescript": "^2.9.2",
"typescript": "next",

"@types/react": "latest",
"@types/react-dom": "latest",
Expand Down
2 changes: 1 addition & 1 deletion examples/ReactNative/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},

"devDependencies": {
"typescript": "^2.9.2",
"typescript": "next",

"@types/react": "latest",
"@types/react-native": "latest",
Expand Down
2 changes: 1 addition & 1 deletion examples/ServerSideRendering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},

"devDependencies": {
"typescript": "^2.9.2",
"typescript": "next",

"@types/react": "latest",
"@types/react-dom": "latest",
Expand Down
2 changes: 1 addition & 1 deletion examples/SignUp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},

"devDependencies": {
"typescript": "^2.9.2",
"typescript": "next",

"@types/react": "latest",
"@types/react-dom": "latest",
Expand Down
2 changes: 1 addition & 1 deletion examples/WizardForm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},

"devDependencies": {
"typescript": "^2.9.2",
"typescript": "next",

"@types/react": "latest",
"@types/react-dom": "latest",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"devDependencies": {
"lerna": "latest",

"typescript": "^2.9.2",
"typescript": "next",

"tslint": "latest",
"tslint-react": "latest"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},

"devDependencies": {
"typescript": "^2.9.2",
"typescript": "next",

"react": "latest",
"@types/react": "latest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},

"devDependencies": {
"typescript": "^2.9.2",
"typescript": "next",

"react": "latest",
"@types/react": "latest",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-form-with-constraints-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},

"devDependencies": {
"typescript": "^2.9.2",
"typescript": "next",

"react": "16.0.0",
"@types/react": "latest",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-form-with-constraints-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},

"devDependencies": {
"typescript": "^2.9.2",
"typescript": "next",

"react": "latest",
"@types/react": "latest",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-form-with-constraints/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
},

"devDependencies": {
"typescript": "^2.9.2",
"typescript": "next",

"react": "latest",
"@types/react": "latest",
Expand Down
11 changes: 8 additions & 3 deletions packages/react-form-with-constraints/src/InputElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand All @@ -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;
Expand All @@ -80,3 +84,4 @@ export class IValidityState implements ValidityState {
this.valueMissing = validity.valueMissing;
}
}
*/
3 changes: 1 addition & 2 deletions tsconfig-react-es5.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
79 changes: 46 additions & 33 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -2704,9 +2704,15 @@ columnify@^1.5.4:
strip-ansi "^3.0.0"
wcwidth "^1.0.0"

[email protected], combined-stream@^1.0.5, combined-stream@~1.0.5, combined-stream@~1.0.6:
[email protected]:
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"

Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -8304,13 +8310,13 @@ [email protected]:
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"
Expand Down Expand Up @@ -8342,13 +8348,13 @@ [email protected]:
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"
Expand Down Expand Up @@ -8836,7 +8842,7 @@ rollup-plugin-uglify@latest:
serialize-javascript "^1.5.0"
uglify-js "^3.4.9"

[email protected], rollup-pluginutils@latest:
[email protected]:
version "2.3.1"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.3.1.tgz#760d185ccc237dedc12d7ae48c6bcd127b4892d0"
dependencies:
Expand All @@ -8845,11 +8851,18 @@ [email protected], 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"
Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit aef555f

Please sign in to comment.