From d4b99a2a5727c3d4e293c42ce88f6928ffda72bd Mon Sep 17 00:00:00 2001 From: Vinh Date: Fri, 7 Jun 2019 23:42:26 +0200 Subject: [PATCH] [CORL-420] Upgrade Relay (#2346) * chore: upgrade Relay * fix: fix errors * fix: snapshot * fix: relay prefix * fix: fragment spec error --- package-lock.json | 987 +++++++----------- package.json | 22 +- scripts/compileRelay.ts | 2 + .../admin/components/NavigationLink.tsx | 2 +- .../NavigationLink.spec.tsx.snap | 6 +- .../admin/containers/AuthCheckContainer.tsx | 186 ++-- .../admin/mutations/ApproveCommentMutation.ts | 12 +- .../client/admin/mutations/BanUserMutation.ts | 2 +- .../admin/mutations/RejectCommentMutation.ts | 12 +- src/core/client/admin/routeConfig.tsx | 13 +- .../__snapshots__/Link.spec.tsx.snap | 4 +- .../containers/AccountCompletionContainer.tsx | 4 +- .../moderate/components/NavigationLink.tsx | 2 +- .../__snapshots__/Moderate.spec.tsx.snap | 2 +- .../NavigationLink.spec.tsx.snap | 6 +- .../SingleModerate.spec.tsx.snap | 4 +- .../containers/FlagDetailsContainer.tsx | 4 +- .../routes/stories/components/StoryRow.tsx | 5 +- .../components/GoToCommentLink.tsx | 2 +- .../GoToCommentLink.spec.tsx.snap | 6 +- .../__snapshots__/initLocalState.spec.ts.snap | 11 - .../framework/lib/relay/createAndRetain.ts | 6 +- .../client/framework/lib/relay/localState.ts | 13 - src/core/client/framework/lib/relay/lookup.ts | 14 +- .../client/framework/lib/relay/useLocal.tsx | 7 +- .../lib/relay/withLocalStateContainer.tsx | 5 +- .../__snapshots__/initLocalState.spec.ts.snap | 8 - .../EditCommentFormContainer.tsx | 3 +- .../EditCommentForm/EditCommentMutation.ts | 23 +- .../ApproveCommentMutation.ts | 5 +- .../RejectCommentMutation.ts | 5 +- .../CreateCommentReactionMutation.ts | 5 + .../RemoveCommentReactionMutation.ts | 5 + .../CreateCommentReplyMutation.ts | 33 +- .../PostCommentForm/CreateCommentMutation.ts | 38 +- .../postLocalReply.spec.tsx.snap | 27 + .../__snapshots__/postReply.spec.tsx.snap | 27 + src/docs/workarounds.mdx | 93 -- 38 files changed, 682 insertions(+), 929 deletions(-) delete mode 100644 src/docs/workarounds.mdx diff --git a/package-lock.json b/package-lock.json index 2cd53e3d8..a0cc8d1aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@coralproject/talk", - "version": "5.0.0-beta.1", + "version": "5.0.0-beta.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1088,6 +1088,15 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, + "@babel/plugin-syntax-class-properties": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.2.0.tgz", + "integrity": "sha512-UxYaGXYQ7rrKJS/PxIKRkv3exi05oH7rokBAsmCSsCxz1sVPZ7Fu6FzKoGgUvmY+0YgSkYHgUoCh5R5bCNBQlw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, "@babel/plugin-syntax-dynamic-import": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz", @@ -2911,6 +2920,11 @@ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" }, + "@restart/context": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@restart/context/-/context-2.1.4.tgz", + "integrity": "sha512-INJYZQJP7g+IoDUh/475NlGiTeMfwTXUEr3tmRneckHIxNolGOW9CTq83S8cxq0CgJwwcMzMJFchxvlwe7Rk8Q==" + }, "@samverschueren/stream-to-observable": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz", @@ -3967,9 +3981,9 @@ } }, "@types/react-relay": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/@types/react-relay/-/react-relay-1.3.9.tgz", - "integrity": "sha512-DFhFrEiDUYxR6VWpkf14CnzS7vtpWaVku0EmnxT2X4U45rOUP75nnOEnRCixZyyxIgr7ULpg5Zc1G9VJpQF7GQ==", + "version": "1.3.14", + "resolved": "https://registry.npmjs.org/@types/react-relay/-/react-relay-1.3.14.tgz", + "integrity": "sha512-Zh5IpiG15D3eZQuhxnqpBrxcszmGv1JfDB4BdBkd4WnfZ0iHUqHTLX506BT/Nk8x9fezfqxOv9c4W8yITZizMQ==", "dev": true, "requires": { "@types/react": "*", @@ -4019,9 +4033,9 @@ "dev": true }, "@types/relay-runtime": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/@types/relay-runtime/-/relay-runtime-1.3.6.tgz", - "integrity": "sha512-NobpY0XFh0O9FTRkFJsN5ZNd+M+4eac8ZgM5LP3C0tLd1JkfrwuGkyBUMTuDDGYf+T5zl6vTO6EGgXKD+0QpGA==", + "version": "1.3.12", + "resolved": "https://registry.npmjs.org/@types/relay-runtime/-/relay-runtime-1.3.12.tgz", + "integrity": "sha512-MXM7ElUpLzPfaIlG6263qDd7+zdNpqy43K90yyQzB0ax1hKMJ+R3WfaVLFxn/X49YR8fa6kwA3ikjh2A/JNFJg==", "dev": true }, "@types/sane": { @@ -5471,104 +5485,12 @@ } } }, - "babel-helper-builder-react-jsx": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.26.0.tgz", - "integrity": "sha1-Of+DE7dci2Xc7/HzHTg+D/KkCKA=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "esutils": "^2.0.2" - } - }, - "babel-helper-call-delegate": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", - "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", - "dev": true, - "requires": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-define-map": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", - "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", - "dev": true, - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-helper-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", - "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", - "dev": true, - "requires": { - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-get-function-arity": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", - "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-hoist-variables": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", - "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, "babel-helper-is-react-class": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/babel-helper-is-react-class/-/babel-helper-is-react-class-1.0.0.tgz", "integrity": "sha1-7282eLBcdtve7a3q16+YwnJNhDE=", "dev": true }, - "babel-helper-optimise-call-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", - "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-replace-supers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", - "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", - "dev": true, - "requires": { - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, "babel-helpers": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", @@ -5697,15 +5619,6 @@ "babel-runtime": "^6.22.0" } }, - "babel-plugin-check-es2015-constants": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", - "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, "babel-plugin-dynamic-import-node": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.2.0.tgz", @@ -5858,28 +5771,14 @@ } }, "babel-plugin-relay": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/babel-plugin-relay/-/babel-plugin-relay-1.7.0.tgz", - "integrity": "sha512-4kDgElsQ3+m1YHGinm2CWu55XzpPqEzf42JuYWUAJWvTBcHkd/VGVftO9C6BjnssUU7fDH9izn3qMtp0XFWGKw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/babel-plugin-relay/-/babel-plugin-relay-4.0.0.tgz", + "integrity": "sha512-wM2L7kyyZcIF8ZAN11OpEkWnOzTT8KX78ot7ElKPbPuKpLxjwbVJkAcbhUj60eCmvS8Vz817xP5JLO7y1Uu5eA==", "dev": true, "requires": { - "babel-plugin-macros": "^2.0.0", - "babel-runtime": "^6.23.0", - "babel-types": "^6.24.1" + "babel-plugin-macros": "^2.0.0" } }, - "babel-plugin-syntax-class-properties": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz", - "integrity": "sha1-1+sjt5oxf4VDlixQW4J8fWysJ94=", - "dev": true - }, - "babel-plugin-syntax-flow": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz", - "integrity": "sha1-TDqyCiryaqIM0lmVw5jE63AxDI0=", - "dev": true - }, "babel-plugin-syntax-jsx": { "version": "6.18.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", @@ -5893,23 +5792,11 @@ "dev": true }, "babel-plugin-syntax-trailing-function-commas": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", - "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", + "version": "7.0.0-beta.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-7.0.0-beta.0.tgz", + "integrity": "sha512-Xj9XuRuz3nTSbaTXWv3itLOcxyF4oPD8douBBmj7U9BBC6nEBYfyOJYQMf/8PJAFotC62UY5dFfIGEPr7WswzQ==", "dev": true }, - "babel-plugin-transform-class-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz", - "integrity": "sha1-anl2PqYdM9NvN7YRqp3vgagbRqw=", - "dev": true, - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-plugin-syntax-class-properties": "^6.8.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, "babel-plugin-transform-dynamic-import": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-dynamic-import/-/babel-plugin-transform-dynamic-import-2.1.0.tgz", @@ -5919,204 +5806,6 @@ "@babel/plugin-syntax-dynamic-import": "^7.0.0" } }, - "babel-plugin-transform-es2015-arrow-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", - "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-block-scoped-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", - "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-block-scoping": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", - "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-plugin-transform-es2015-classes": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", - "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", - "dev": true, - "requires": { - "babel-helper-define-map": "^6.24.1", - "babel-helper-function-name": "^6.24.1", - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-helper-replace-supers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-computed-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", - "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-destructuring": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", - "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-for-of": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", - "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", - "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", - "dev": true, - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", - "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-modules-commonjs": { - "version": "6.26.2", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", - "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", - "dev": true, - "requires": { - "babel-plugin-transform-strict-mode": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-types": "^6.26.0" - } - }, - "babel-plugin-transform-es2015-object-super": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", - "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", - "dev": true, - "requires": { - "babel-helper-replace-supers": "^6.24.1", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-parameters": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", - "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", - "dev": true, - "requires": { - "babel-helper-call-delegate": "^6.24.1", - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-shorthand-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", - "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-spread": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", - "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-template-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", - "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es3-member-expression-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es3-member-expression-literals/-/babel-plugin-transform-es3-member-expression-literals-6.22.0.tgz", - "integrity": "sha1-cz00RPPsxBvvjtGmpOCWV7iWnrs=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es3-property-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es3-property-literals/-/babel-plugin-transform-es3-property-literals-6.22.0.tgz", - "integrity": "sha1-sgeNWELiKr9A9z6M3pzTcRq9V1g=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-flow-strip-types": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz", - "integrity": "sha1-hMtnKTXUNxT9wyvOhFaNh0Qc988=", - "dev": true, - "requires": { - "babel-plugin-syntax-flow": "^6.18.0", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-object-rest-spread": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz", - "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=", - "dev": true, - "requires": { - "babel-plugin-syntax-object-rest-spread": "^6.8.0", - "babel-runtime": "^6.26.0" - } - }, "babel-plugin-transform-react-constant-elements": { "version": "6.23.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-constant-elements/-/babel-plugin-transform-react-constant-elements-6.23.0.tgz", @@ -6126,15 +5815,6 @@ "babel-runtime": "^6.22.0" } }, - "babel-plugin-transform-react-display-name": { - "version": "6.25.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.25.0.tgz", - "integrity": "sha1-Z+K/Hx6ck6sI25Z5LgU5K/LMKNE=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, "babel-plugin-transform-react-inline-elements": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-inline-elements/-/babel-plugin-transform-react-inline-elements-6.22.0.tgz", @@ -6144,17 +5824,6 @@ "babel-runtime": "^6.22.0" } }, - "babel-plugin-transform-react-jsx": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz", - "integrity": "sha1-hAoCjn30YN/DotKfDA2R9jduZqM=", - "dev": true, - "requires": { - "babel-helper-builder-react-jsx": "^6.24.1", - "babel-plugin-syntax-jsx": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, "babel-plugin-transform-react-pure-class-to-function": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-pure-class-to-function/-/babel-plugin-transform-react-pure-class-to-function-1.0.1.tgz", @@ -6170,16 +5839,6 @@ "integrity": "sha1-NAZpbfC4tFYIn51ybSfn4SPS+Sk=", "dev": true }, - "babel-plugin-transform-strict-mode": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", - "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, "babel-plugin-use-lodash-es": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/babel-plugin-use-lodash-es/-/babel-plugin-use-lodash-es-0.2.0.tgz", @@ -6531,39 +6190,38 @@ } }, "babel-preset-fbjs": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/babel-preset-fbjs/-/babel-preset-fbjs-2.2.0.tgz", - "integrity": "sha512-jj0KFJDioYZMtPtZf77dQuU+Ad/1BtN0UnAYlHDa8J8f4tGXr3YrPoJImD5MdueaOPeN/jUdrCgu330EfXr0XQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-fbjs/-/babel-preset-fbjs-3.2.0.tgz", + "integrity": "sha512-5Jo+JeWiVz2wHUUyAlvb/sSYnXNig9r+HqGAOSfh5Fzxp7SnAaR/tEGRJ1ZX7C77kfk82658w6R5Z+uPATTD9g==", "dev": true, "requires": { - "babel-plugin-check-es2015-constants": "^6.8.0", - "babel-plugin-syntax-class-properties": "^6.8.0", - "babel-plugin-syntax-flow": "^6.8.0", - "babel-plugin-syntax-jsx": "^6.8.0", - "babel-plugin-syntax-object-rest-spread": "^6.8.0", - "babel-plugin-syntax-trailing-function-commas": "^6.8.0", - "babel-plugin-transform-class-properties": "^6.8.0", - "babel-plugin-transform-es2015-arrow-functions": "^6.8.0", - "babel-plugin-transform-es2015-block-scoped-functions": "^6.8.0", - "babel-plugin-transform-es2015-block-scoping": "^6.8.0", - "babel-plugin-transform-es2015-classes": "^6.8.0", - "babel-plugin-transform-es2015-computed-properties": "^6.8.0", - "babel-plugin-transform-es2015-destructuring": "^6.8.0", - "babel-plugin-transform-es2015-for-of": "^6.8.0", - "babel-plugin-transform-es2015-function-name": "^6.8.0", - "babel-plugin-transform-es2015-literals": "^6.8.0", - "babel-plugin-transform-es2015-modules-commonjs": "^6.8.0", - "babel-plugin-transform-es2015-object-super": "^6.8.0", - "babel-plugin-transform-es2015-parameters": "^6.8.0", - "babel-plugin-transform-es2015-shorthand-properties": "^6.8.0", - "babel-plugin-transform-es2015-spread": "^6.8.0", - "babel-plugin-transform-es2015-template-literals": "^6.8.0", - "babel-plugin-transform-es3-member-expression-literals": "^6.8.0", - "babel-plugin-transform-es3-property-literals": "^6.8.0", - "babel-plugin-transform-flow-strip-types": "^6.8.0", - "babel-plugin-transform-object-rest-spread": "^6.8.0", - "babel-plugin-transform-react-display-name": "^6.8.0", - "babel-plugin-transform-react-jsx": "^6.8.0" + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-object-rest-spread": "^7.0.0", + "@babel/plugin-syntax-class-properties": "^7.0.0", + "@babel/plugin-syntax-flow": "^7.0.0", + "@babel/plugin-syntax-jsx": "^7.0.0", + "@babel/plugin-syntax-object-rest-spread": "^7.0.0", + "@babel/plugin-transform-arrow-functions": "^7.0.0", + "@babel/plugin-transform-block-scoped-functions": "^7.0.0", + "@babel/plugin-transform-block-scoping": "^7.0.0", + "@babel/plugin-transform-classes": "^7.0.0", + "@babel/plugin-transform-computed-properties": "^7.0.0", + "@babel/plugin-transform-destructuring": "^7.0.0", + "@babel/plugin-transform-flow-strip-types": "^7.0.0", + "@babel/plugin-transform-for-of": "^7.0.0", + "@babel/plugin-transform-function-name": "^7.0.0", + "@babel/plugin-transform-literals": "^7.0.0", + "@babel/plugin-transform-member-expression-literals": "^7.0.0", + "@babel/plugin-transform-modules-commonjs": "^7.0.0", + "@babel/plugin-transform-object-super": "^7.0.0", + "@babel/plugin-transform-parameters": "^7.0.0", + "@babel/plugin-transform-property-literals": "^7.0.0", + "@babel/plugin-transform-react-display-name": "^7.0.0", + "@babel/plugin-transform-react-jsx": "^7.0.0", + "@babel/plugin-transform-shorthand-properties": "^7.0.0", + "@babel/plugin-transform-spread": "^7.0.0", + "@babel/plugin-transform-template-literals": "^7.0.0", + "babel-plugin-syntax-trailing-function-commas": "^7.0.0-beta.0" } }, "babel-preset-jest": { @@ -6651,6 +6309,7 @@ "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, "requires": { "core-js": "^2.4.0", "regenerator-runtime": "^0.11.0" @@ -13706,6 +13365,12 @@ } } }, + "fbjs-css-vars": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/fbjs-css-vars/-/fbjs-css-vars-1.0.2.tgz", + "integrity": "sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ==", + "dev": true + }, "figgy-pudding": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz", @@ -14760,33 +14425,64 @@ "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" }, "found": { - "version": "0.3.21", - "resolved": "https://registry.npmjs.org/found/-/found-0.3.21.tgz", - "integrity": "sha512-iaeGVTBirrTAravFPcIfWPuJHIaFNqnJ87AMvnpB4Ig8RTB97C4PipVopmSxK+lLeMdEybUwaW+BhNDhLPEUSw==", + "version": "0.4.0-alpha.17", + "resolved": "https://registry.npmjs.org/found/-/found-0.4.0-alpha.17.tgz", + "integrity": "sha512-Q0VpXjcXYel4FS0hHtpLppmZ2zO/SfUICkV1yxfgr2sGzOeWuHnyRCxTpaxZLjWIqcA03VVFgSAT32B4U4TRlw==", "requires": { - "babel-runtime": "^6.26.0", - "farce": "^0.2.6", + "@babel/runtime-corejs2": "^7.4.4", + "@restart/context": "^2.1.4", + "farce": "^0.2.8", + "invariant": "^2.2.4", "is-promise": "^2.1.0", "lodash": "^4.17.11", "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.2", - "prop-types-extra": "^1.1.0", - "react-redux": "^5.1.1", + "prop-types": "^15.7.2", + "react-redux": "^7.0.0", "react-static-container": "^1.0.2", "redux": "^4.0.1", - "warning": "^4.0.2" + "warning": "^4.0.3" }, "dependencies": { + "@babel/runtime-corejs2": { + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.4.5.tgz", + "integrity": "sha512-5yLuwzvIDecKwYMzJtiarky4Fb5643H3Ao5jwX0HrMR5oM5mn2iHH9wSZonxwNK0oAjAFUQAiOd4jT7/9Y2jMQ==", + "requires": { + "core-js": "^2.6.5", + "regenerator-runtime": "^0.13.2" + } + }, + "core-js": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz", + "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==" + }, + "dom-helpers": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-3.4.0.tgz", + "integrity": "sha512-LnuPJ+dwqKDIyotW1VzmOZ5TONUN7CwkCR5hrgawTUbkBGYdeoNLZo6nNfGkCrjtE1nXXaj7iMMpDa8/d9WoIA==", + "requires": { + "@babel/runtime": "^7.1.2" + } + }, + "farce": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/farce/-/farce-0.2.8.tgz", + "integrity": "sha512-x4N70Ti9nOo6/waNJUZMLDd/U6+WA0gV+AUE1gFS/npD/FliTUCKbBLNQYbgeejzDdw0MgtPCCjRX8kPTHjspA==", + "requires": { + "dom-helpers": "^3.4.0", + "invariant": "^2.2.4", + "is-promise": "^2.1.0", + "query-string": "^5.1.1", + "redux": "^4.0.1", + "warning": "^4.0.3" + } + }, "isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" - }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -14803,6 +14499,16 @@ "isarray": "0.0.1" } }, + "prop-types": { + "version": "15.7.2", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", + "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", + "requires": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.8.1" + } + }, "redux": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/redux/-/redux-4.0.1.tgz", @@ -14811,20 +14517,68 @@ "loose-envify": "^1.4.0", "symbol-observable": "^1.2.0" } + }, + "regenerator-runtime": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", + "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" } } }, "found-relay": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/found-relay/-/found-relay-0.3.1.tgz", - "integrity": "sha512-N9lADMedKGkl+PNY/L/qf0rDy+3HRbO9IX8Gcvjpy2tgRmPy6Z2QM/zVOufCvvD8rYGP84CuqtmTWJvJrLPFYw==", + "version": "0.4.0-alpha.8", + "resolved": "https://registry.npmjs.org/found-relay/-/found-relay-0.4.0-alpha.8.tgz", + "integrity": "sha512-HiwWY6fQLfrysnmFA2L4GxlGVu4cLujLhKbfzvDWV47EB5lHt/EylLpwEDgR64ayZus1p6Z0X6ryyv+T2SPWow==", "requires": { - "babel-runtime": "^6.26.0", + "@babel/runtime-corejs2": "^7.4.4", "is-promise": "^2.1.0", - "lodash": "^4.17.10", - "prop-types": "^15.6.2", - "prop-types-extra": "^1.1.0", - "warning": "^4.0.2" + "lodash": "^4.17.11", + "prop-types": "^15.7.2", + "warning": "^4.0.3" + }, + "dependencies": { + "@babel/runtime-corejs2": { + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.4.5.tgz", + "integrity": "sha512-5yLuwzvIDecKwYMzJtiarky4Fb5643H3Ao5jwX0HrMR5oM5mn2iHH9wSZonxwNK0oAjAFUQAiOd4jT7/9Y2jMQ==", + "requires": { + "core-js": "^2.6.5", + "regenerator-runtime": "^0.13.2" + } + }, + "core-js": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz", + "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==" + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "prop-types": { + "version": "15.7.2", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", + "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", + "requires": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.8.1" + } + }, + "react-is": { + "version": "16.8.6", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz", + "integrity": "sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==" + }, + "regenerator-runtime": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", + "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" + } } }, "fragment-cache": { @@ -16393,49 +16147,6 @@ "iterall": "^1.2.1" } }, - "graphql-compiler": { - "version": "1.7.0-rc.1", - "resolved": "https://registry.npmjs.org/graphql-compiler/-/graphql-compiler-1.7.0-rc.1.tgz", - "integrity": "sha512-wu1HMcI39I2Ion1N+nrn9ELGMFGi6lFDz+dJuJwnlO3BdXTrSVvYnnusxNaim4/Gkmf9tM/ErYSbpvRzBWPk3g==", - "dev": true, - "requires": { - "chalk": "^1.1.1", - "fb-watchman": "^2.0.0", - "immutable": "~3.7.6" - }, - "dependencies": { - "chalk": { - "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - } - } - }, "graphql-config": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/graphql-config/-/graphql-config-2.0.1.tgz", @@ -17199,9 +16910,9 @@ } }, "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" }, "header-case": { "version": "1.0.1", @@ -17390,6 +17101,11 @@ "optimist": "^0.6.1" }, "dependencies": { + "domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==" + }, "domhandler": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", @@ -17399,16 +17115,26 @@ } }, "htmlparser2": { - "version": "3.9.2", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.9.2.tgz", - "integrity": "sha1-G9+HrMoPP55T+k/M6w9LTLsAszg=", + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", + "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", "requires": { - "domelementtype": "^1.3.0", + "domelementtype": "^1.3.1", "domhandler": "^2.3.0", "domutils": "^1.5.1", "entities": "^1.1.1", "inherits": "^2.0.1", - "readable-stream": "^2.0.2" + "readable-stream": "^3.1.1" + } + }, + "readable-stream": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", + "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" } } } @@ -22952,6 +22678,12 @@ "boolbase": "~1.0.0" } }, + "nullthrows": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz", + "integrity": "sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==", + "dev": true + }, "num2fraction": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", @@ -27692,25 +27424,6 @@ "reflect.ownkeys": "^0.2.0" } }, - "prop-types-extra": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/prop-types-extra/-/prop-types-extra-1.1.0.tgz", - "integrity": "sha512-QFyuDxvMipmIVKD2TwxLVPzMnO4e5oOf1vr3tJIomL8E7d0lr6phTHd5nkPhFIzTD1idBLLEPeylL9g+rrTzRg==", - "requires": { - "react-is": "^16.3.2", - "warning": "^3.0.0" - }, - "dependencies": { - "warning": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/warning/-/warning-3.0.0.tgz", - "integrity": "sha1-MuU3fLVy3kqwR1O9+IIcAe1gW3w=", - "requires": { - "loose-envify": "^1.0.0" - } - } - } - }, "property-expr": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/property-expr/-/property-expr-1.5.1.tgz", @@ -29161,14 +28874,15 @@ } }, "react-is": { - "version": "16.4.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.4.2.tgz", - "integrity": "sha512-rI3cGFj/obHbBz156PvErrS5xc6f1eWyTwyV4mo0vF2lGgXgS+mm7EKD5buLJq6jNgIagQescGSVG2YzgXt8Yg==" + "version": "16.8.6", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz", + "integrity": "sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==" }, "react-lifecycles-compat": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", - "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" + "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==", + "dev": true }, "react-live": { "version": "1.12.0", @@ -29238,19 +28952,26 @@ } }, "react-redux": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-5.1.1.tgz", - "integrity": "sha512-LE7Ned+cv5qe7tMV5BPYkGQ5Lpg8gzgItK07c67yHvJ8t0iaD9kPFPAli/mYkiyJYrs2pJgExR2ZgsGqlrOApg==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.0.3.tgz", + "integrity": "sha512-vYZA7ftOYlDk3NetitsI7fLjryt/widNl1SLXYvFenIpm7vjb4ryK0EeFrgn62usg5fYkyIAWNUPKnwWPevKLg==", "requires": { - "@babel/runtime": "^7.1.2", - "hoist-non-react-statics": "^3.1.0", + "@babel/runtime": "^7.4.3", + "hoist-non-react-statics": "^3.3.0", "invariant": "^2.2.4", - "loose-envify": "^1.1.0", - "prop-types": "^15.6.1", - "react-is": "^16.6.0", - "react-lifecycles-compat": "^3.0.0" + "loose-envify": "^1.4.0", + "prop-types": "^15.7.2", + "react-is": "^16.8.6" }, "dependencies": { + "@babel/runtime": { + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.5.tgz", + "integrity": "sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ==", + "requires": { + "regenerator-runtime": "^0.13.2" + } + }, "hoist-non-react-statics": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz", @@ -29259,34 +28980,65 @@ "react-is": "^16.7.0" } }, - "react-is": { - "version": "16.8.3", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.3.tgz", - "integrity": "sha512-Y4rC1ZJmsxxkkPuMLwvKvlL1Zfpbcu+Bf4ZigkHup3v9EfdYhAlWAaVyA19olXq2o2mGn0w+dFKvk3pVVlYcIA==" + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "prop-types": { + "version": "15.7.2", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", + "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", + "requires": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.8.1" + } }, "regenerator-runtime": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", - "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==" + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", + "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" } } }, "react-relay": { - "version": "1.7.0-rc.1", - "resolved": "https://registry.npmjs.org/react-relay/-/react-relay-1.7.0-rc.1.tgz", - "integrity": "sha512-5BcnFr++zkfq5AVoCjcqr8eotuJwVN+57+BnhJZuw3EoY8Yi+avV/AqZ7Tz9F6r9p5xZkCoYZw3kRTtpK9lPSQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/react-relay/-/react-relay-4.0.0.tgz", + "integrity": "sha512-Z7O+zM5oUmUWqOiPv7Z3L8a9cNCXare8wkUfDgtTBl048wXXtkAWTHTP0QZdViRSLmNHmEwHo/y0lBpZ7iy6SQ==", "dev": true, "requires": { - "babel-runtime": "^6.23.0", - "fbjs": "0.8.17", - "prop-types": "^15.5.8", - "relay-runtime": "1.7.0-rc.1" + "@babel/runtime": "^7.0.0", + "fbjs": "^1.0.0", + "nullthrows": "^1.1.0", + "relay-runtime": "4.0.0" + }, + "dependencies": { + "fbjs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-1.0.0.tgz", + "integrity": "sha512-MUgcMEJaFhCaF1QtWGnmq9ZDRAzECTCRAF7O6UZIlAlkTs1SasiX9aP0Iw7wfD2mJ7wDTNfg2w7u5fSCwJk1OA==", + "dev": true, + "requires": { + "core-js": "^2.4.1", + "fbjs-css-vars": "^1.0.0", + "isomorphic-fetch": "^2.1.1", + "loose-envify": "^1.0.0", + "object-assign": "^4.1.0", + "promise": "^7.1.1", + "setimmediate": "^1.0.5", + "ua-parser-js": "^0.7.18" + } + } } }, "react-relay-network-modern": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/react-relay-network-modern/-/react-relay-network-modern-2.4.0.tgz", - "integrity": "sha512-LR/RhHcJclDCVEiwRhlRtf1iltSnbGSxS2rag+bAljMFJ0kOVSYUK3+NDPRbcHLRqbha1FuQXBVfHjjPE6jhMA==" + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/react-relay-network-modern/-/react-relay-network-modern-3.0.4.tgz", + "integrity": "sha512-d1ttgGGRrjvntUeStKOGO4tsJy2P7hQ+T98DzdTa8QFEx8//0+/IPc1TUtFk0GVTUQJXG66cQw7EknwDRmRLfg==" }, "react-responsive": { "version": "5.0.0", @@ -29633,7 +29385,8 @@ "regenerator-runtime": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true }, "regenerator-transform": { "version": "0.13.4", @@ -29748,89 +29501,41 @@ "integrity": "sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=" }, "relay-compiler": { - "version": "1.7.0-rc.1", - "resolved": "https://registry.npmjs.org/relay-compiler/-/relay-compiler-1.7.0-rc.1.tgz", - "integrity": "sha512-NCbrAWG692dp0on3sefX0pZ+1/eWDPOnme/i0vAbH38ejfRW5vPS9pznHYS7A0y7OC5lABMZT+DCyEYeHFpflA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/relay-compiler/-/relay-compiler-4.0.0.tgz", + "integrity": "sha512-IljjuroVEBWfNgZHb9Qm2YeAH6GRagM64eRYIdyVN4kitY1u1Hitle4000y3A1XRwjgrEuD4CuryFK0ktGaszA==", "dev": true, "requires": { - "@babel/generator": "7.0.0-beta.56", - "@babel/parser": "7.0.0-beta.56", - "@babel/types": "7.0.0-beta.56", - "babel-polyfill": "^6.20.0", - "babel-preset-fbjs": "2.2.0", - "babel-runtime": "^6.23.0", - "babel-traverse": "^6.26.0", - "chalk": "^1.1.1", + "@babel/core": "^7.0.0", + "@babel/generator": "^7.0.0", + "@babel/parser": "^7.0.0", + "@babel/polyfill": "^7.0.0", + "@babel/runtime": "^7.0.0", + "@babel/traverse": "^7.0.0", + "@babel/types": "^7.0.0", + "babel-preset-fbjs": "^3.1.2", + "chalk": "^2.4.1", "fast-glob": "^2.2.2", "fb-watchman": "^2.0.0", - "fbjs": "0.8.17", - "graphql-compiler": "1.7.0-rc.1", + "fbjs": "^1.0.0", "immutable": "~3.7.6", - "relay-runtime": "1.7.0-rc.1", + "nullthrows": "^1.1.0", + "relay-runtime": "4.0.0", "signedsource": "^1.0.0", "yargs": "^9.0.0" }, "dependencies": { - "@babel/generator": { - "version": "7.0.0-beta.56", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.56.tgz", - "integrity": "sha512-d+Ls/Vr5OU5FBDYQToXSqAluI3r2UaSoNZ41zD3sxdoVoaT8K5Bdh4So4eG4o//INGM7actValXGfb+5J1+r8w==", - "dev": true, - "requires": { - "@babel/types": "7.0.0-beta.56", - "jsesc": "^2.5.1", - "lodash": "^4.17.10", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" - } - }, - "@babel/parser": { - "version": "7.0.0-beta.56", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.0.0-beta.56.tgz", - "integrity": "sha512-JM0ughhbo+sPXw2Z+SUyowfYrAOhjanzjMshcLswBdXVelJCOeEKe/FqMqPWGVPQr7wByongXIn+MKdCpY7DBw==", - "dev": true - }, "@babel/types": { - "version": "7.0.0-beta.56", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.56.tgz", - "integrity": "sha512-fRIBeHtKxAD3D1E7hYSpG4MnLt0AfzHHs5gfVclOB0NlfLu3qiWU/IqdbK2ixTK61424iEkV1P/VAzndx6ungA==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.4.tgz", + "integrity": "sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ==", "dev": true, "requires": { "esutils": "^2.0.2", - "lodash": "^4.17.10", + "lodash": "^4.17.11", "to-fast-properties": "^2.0.0" } }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, "cliui": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", @@ -29852,18 +29557,25 @@ "is-fullwidth-code-point": "^1.0.0", "strip-ansi": "^3.0.0" } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } } } }, + "fbjs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-1.0.0.tgz", + "integrity": "sha512-MUgcMEJaFhCaF1QtWGnmq9ZDRAzECTCRAF7O6UZIlAlkTs1SasiX9aP0Iw7wfD2mJ7wDTNfg2w7u5fSCwJk1OA==", + "dev": true, + "requires": { + "core-js": "^2.4.1", + "fbjs-css-vars": "^1.0.0", + "isomorphic-fetch": "^2.1.1", + "loose-envify": "^1.0.0", + "object-assign": "^4.1.0", + "promise": "^7.1.1", + "setimmediate": "^1.0.5", + "ua-parser-js": "^0.7.18" + } + }, "is-fullwidth-code-point": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", @@ -29930,10 +29642,14 @@ "read-pkg": "^2.0.0" } }, - "regenerator-runtime": { - "version": "0.10.5", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", - "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=" + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } }, "wrap-ansi": { "version": "2.1.0", @@ -29955,15 +29671,6 @@ "is-fullwidth-code-point": "^1.0.0", "strip-ansi": "^3.0.0" } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } } } }, @@ -30006,29 +29713,55 @@ } }, "relay-compiler-language-typescript": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/relay-compiler-language-typescript/-/relay-compiler-language-typescript-1.1.0.tgz", - "integrity": "sha512-HDWTEsSsNuphmNrjbc1Tf1ljVjbi2CSA7zArsFFYCYHfVU/O7oS3qv/u5E+LrHdYSM80AjpUVjdcFGsqkgOmNw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/relay-compiler-language-typescript/-/relay-compiler-language-typescript-4.3.0.tgz", + "integrity": "sha512-X7hOG3Q/YkkwCuP6MA881aY3JmqatpsnCpW/J58LOaS6NQ6osl1aurmL7qVwfrIUfk+aSXvUbyUrFeQUj/DhXg==", "dev": true, "requires": { - "immutable": "^3.7.6", + "immutable": "^3.8.2", "invariant": "^2.2.2" + }, + "dependencies": { + "immutable": { + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-3.8.2.tgz", + "integrity": "sha1-wkOZUUVbs5kT2vKBN28VMOEErfM=", + "dev": true + } } }, "relay-local-schema": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/relay-local-schema/-/relay-local-schema-0.7.0.tgz", - "integrity": "sha1-onxxcMYUi5Fu0PhNbDAAm6MyoOQ=", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/relay-local-schema/-/relay-local-schema-0.8.0.tgz", + "integrity": "sha512-jT2DsWHEdVVSA+ulNx96TAd4FCVmTlXn9S9ZiPaoqhTHWzEt6BE4xoYUtPrni2JD4m1XPL2hWzsbUq1aoq4kaA==", "dev": true }, "relay-runtime": { - "version": "1.7.0-rc.1", - "resolved": "https://registry.npmjs.org/relay-runtime/-/relay-runtime-1.7.0-rc.1.tgz", - "integrity": "sha512-gdhtIKojPA0FJPc4hPGAbxZBAR2xpnCvCuoL4/wu3ffHxwUFvSSlBIptW3GSxTRM2F55vl7I1IeehCS9IAfQPA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/relay-runtime/-/relay-runtime-4.0.0.tgz", + "integrity": "sha512-Fd5nAMNfySINAYPf1zgtcYbCk33pO5ANiYfaMhKYzukfc2GCmn6RP7NEpG69GxVezu/E1aOxo72t+Y1NspDV8A==", "dev": true, "requires": { - "babel-runtime": "^6.23.0", - "fbjs": "0.8.17" + "@babel/runtime": "^7.0.0", + "fbjs": "^1.0.0" + }, + "dependencies": { + "fbjs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-1.0.0.tgz", + "integrity": "sha512-MUgcMEJaFhCaF1QtWGnmq9ZDRAzECTCRAF7O6UZIlAlkTs1SasiX9aP0Iw7wfD2mJ7wDTNfg2w7u5fSCwJk1OA==", + "dev": true, + "requires": { + "core-js": "^2.4.1", + "fbjs-css-vars": "^1.0.0", + "isomorphic-fetch": "^2.1.1", + "loose-envify": "^1.0.0", + "object-assign": "^4.1.0", + "promise": "^7.1.1", + "setimmediate": "^1.0.5", + "ua-parser-js": "^0.7.18" + } + } } }, "remark": { @@ -33352,9 +33085,9 @@ }, "dependencies": { "tsutils": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.10.0.tgz", - "integrity": "sha512-q20XSMq7jutbGB8luhKKsQldRKWvyBO2BGqni3p4yq8Ys9bEP/xQw3KepKmMRt9gJ4lvQSScrihJrcKdKoSU7Q==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.14.0.tgz", + "integrity": "sha512-SmzGbB0l+8I0QwsPgjooFRaRvHLBLNYM8SeQ0k6rtNDru5sCGeLJcZdwilNndN+GysuFjF5EIYgN8GfFG6UeUw==", "dev": true, "requires": { "tslib": "^1.8.1" diff --git a/package.json b/package.json index 86d61ec9f..1512fceba 100644 --- a/package.json +++ b/package.json @@ -74,8 +74,8 @@ "farce": "^0.2.6", "fluent": "^0.10.0", "fluent-dom": "^0.4.1", - "found": "^0.3.21", - "found-relay": "^0.3.1", + "found": "^0.4.0-alpha.17", + "found-relay": "^0.4.0-alpha.8", "fs-extra": "^6.0.1", "graphql": "^0.13.2", "graphql-config": "^2.0.1", @@ -118,7 +118,7 @@ "prom-client": "^11.3.0", "proxy-agent": "^3.1.0", "querystringify": "^2.1.0", - "react-relay-network-modern": "^2.4.0", + "react-relay-network-modern": "^3.0.4", "source-map-support": "^0.5.12", "stack-utils": "^1.0.2", "striptags": "^3.1.1", @@ -191,12 +191,12 @@ "@types/react": "^16.8.15", "@types/react-copy-to-clipboard": "^4.2.6", "@types/react-dom": "^16.8.4", - "@types/react-relay": "^1.3.9", + "@types/react-relay": "^1.3.14", "@types/react-responsive": "^3.0.1", "@types/react-test-renderer": "^16.8.1", "@types/react-transition-group": "^2.0.14", "@types/recompose": "^0.26.5", - "@types/relay-runtime": "^1.3.6", + "@types/relay-runtime": "^1.3.12", "@types/sane": "^2.0.0", "@types/shallow-equals": "^1.0.0", "@types/simplemde": "^1.11.7", @@ -222,7 +222,7 @@ "babel-plugin-dynamic-import-node": "^2.2.0", "babel-plugin-lodash": "^3.3.4", "babel-plugin-module-resolver": "^3.2.0", - "babel-plugin-relay": "^1.7.0", + "babel-plugin-relay": "^4.0.0", "babel-plugin-use-lodash-es": "^0.2.0", "babel-preset-react-optimize": "^1.0.1", "bowser": "^1.9.4", @@ -293,17 +293,17 @@ "react-error-overlay": "^5.1.6", "react-final-form": "4.0.2", "react-popper": "^1.3.2", - "react-relay": "^1.7.0-rc.1", + "react-relay": "^4.0.0", "react-responsive": "^5.0.0", "react-test-renderer": "^16.8.6", "react-timeago": "^4.1.9", "react-transition-group": "^2.5.0", "react-with-state-props": "^2.0.4", "recompose": "0.27.1", - "relay-compiler": "^1.7.0-rc.1", - "relay-compiler-language-typescript": "^1.1.0", - "relay-local-schema": "^0.7.0", - "relay-runtime": "^1.7.0-rc.1", + "relay-compiler": "^4.0.0", + "relay-compiler-language-typescript": "^4.1.0", + "relay-local-schema": "^0.8.0", + "relay-runtime": "^4.0.0", "sane": "^4.1.0", "shallow-equals": "^1.0.0", "simplemde": "^1.11.2", diff --git a/scripts/compileRelay.ts b/scripts/compileRelay.ts index 44f15d5d1..81b1aaab8 100644 --- a/scripts/compileRelay.ts +++ b/scripts/compileRelay.ts @@ -57,6 +57,8 @@ const args = [ `${program.src}/__generated__`, "--schema", config.projects[program.schema].schemaPath, + // "--persist-output", + // `${program.src}/persisted-queries.json`, ]; spawn.sync("relay-compiler", args, { stdio: "inherit" }); diff --git a/src/core/client/admin/components/NavigationLink.tsx b/src/core/client/admin/components/NavigationLink.tsx index 29ef2243b..daa9b4026 100644 --- a/src/core/client/admin/components/NavigationLink.tsx +++ b/src/core/client/admin/components/NavigationLink.tsx @@ -9,7 +9,7 @@ interface Props { } const NavigationLink: FunctionComponent = props => ( - + {props.children} ); diff --git a/src/core/client/admin/components/__snapshots__/NavigationLink.spec.tsx.snap b/src/core/client/admin/components/__snapshots__/NavigationLink.spec.tsx.snap index 856a7af68..8bd73ab38 100644 --- a/src/core/client/admin/components/__snapshots__/NavigationLink.spec.tsx.snap +++ b/src/core/client/admin/components/__snapshots__/NavigationLink.spec.tsx.snap @@ -1,11 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renders correctly 1`] = ` - link - + `; diff --git a/src/core/client/admin/containers/AuthCheckContainer.tsx b/src/core/client/admin/containers/AuthCheckContainer.tsx index 525671d2c..0c77cf762 100644 --- a/src/core/client/admin/containers/AuthCheckContainer.tsx +++ b/src/core/client/admin/containers/AuthCheckContainer.tsx @@ -5,6 +5,7 @@ import { AuthCheckContainerQueryResponse } from "coral-admin/__generated__/AuthC import { SetRedirectPathMutation } from "coral-admin/mutations"; import { AbilityType, can } from "coral-admin/permissions"; import RestrictedContainer from "coral-admin/views/restricted/containers/RestrictedContainer"; +import { roleIsAtLeast } from "coral-framework/helpers"; import { graphql, MutationProp, withMutation } from "coral-framework/lib/relay"; import { withRouteConfig } from "coral-framework/lib/router"; import { GQLUSER_ROLE } from "coral-framework/schema"; @@ -13,114 +14,115 @@ interface Props { match: Match; router: Router; setRedirectPath: MutationProp; - data: - | AuthCheckContainerQueryResponse & { - route: { - // An AbilityType can be passed in as the Route data - // to perform a permission check. - data?: AbilityType; - }; - } - | null; + data: AuthCheckContainerQueryResponse; } -class AuthCheckContainer extends React.Component { - private wasLoggedIn = false; - constructor(props: Props) { - super(props); - this.redirectIfNotLoggedIn(); - } - - public componentWillReceiveProps(nextProps: Props) { - if (nextProps.data && nextProps.data.viewer) { - this.wasLoggedIn = true; +type CheckParams = + | { + role: GQLUSER_ROLE; + ability?: AbilityType; } - this.redirectIfNotLoggedIn(nextProps, this.props); - if (nextProps.data && !nextProps.data.viewer) { - this.wasLoggedIn = false; - } - } + | { + role?: GQLUSER_ROLE; + ability: AbilityType; + }; - private shouldRedirectTo(props: Props = this.props) { - if (!props.data || props.data.viewer) { - return false; +function createAuthCheckContainer(check: CheckParams) { + class AuthCheckContainer extends React.Component { + private wasLoggedIn = false; + constructor(props: Props) { + super(props); + this.redirectIfNotLoggedIn(); } - return true; - } - private hasAccess(props: Props = this.props) { - const { viewer } = props.data!; - if (viewer) { - if ( - viewer.role === GQLUSER_ROLE.COMMENTER || - viewer.role === GQLUSER_ROLE.STAFF || - (props.data && - props.data.route.data && - // Perform permission check on the ability passed in by the route data - !can(viewer, props.data.route.data)) - ) { + public componentWillReceiveProps(nextProps: Props) { + if (nextProps.data && nextProps.data.viewer) { + this.wasLoggedIn = true; + } + this.redirectIfNotLoggedIn(nextProps, this.props); + if (nextProps.data && !nextProps.data.viewer) { + this.wasLoggedIn = false; + } + } + + private shouldRedirectTo(props: Props = this.props) { + if (!props.data || props.data.viewer) { return false; } return true; } - return false; - } - private async redirectIfNotLoggedIn( - props: Props = this.props, - prevProps: Props | null = null - ) { - if (!this.shouldRedirectTo(props)) { - return; - } - // If I was previously logged in then logged out, we don't need to set the redirect path. - if (!this.wasLoggedIn) { - const location = props.match.location; - await props.setRedirectPath({ - path: location.pathname + location.search + location.hash, - }); - } - props.router.replace("/admin/login"); - } - - public render() { - if (!this.props.data || this.shouldRedirectTo()) { - return null; - } - if (this.hasAccess()) { - return this.props.children; - } - return ; - } -} - -const enhanced = withRouteConfig({ - query: graphql` - query AuthCheckContainerQuery { - viewer { - ...RestrictedContainer_viewer - username - email - profiles { - __typename + private hasAccess(props: Props = this.props) { + const { viewer } = props.data!; + if (viewer) { + if ( + (check.role && !roleIsAtLeast(viewer.role, check.role)) || + (check.ability && !can(viewer, check.ability)) + ) { + return false; } - role + return true; } - settings { - auth { - integrations { - local { - enabled - targetFilter { - admin - stream + return false; + } + + private async redirectIfNotLoggedIn( + props: Props = this.props, + prevProps: Props | null = null + ) { + if (!this.shouldRedirectTo(props)) { + return; + } + // If I was previously logged in then logged out, we don't need to set the redirect path. + if (!this.wasLoggedIn) { + const location = props.match.location; + await props.setRedirectPath({ + path: location.pathname + location.search + location.hash, + }); + } + props.router.replace("/admin/login"); + } + + public render() { + if (!this.props.data || this.shouldRedirectTo()) { + return null; + } + if (this.hasAccess()) { + return this.props.children; + } + return ; + } + } + + const enhanced = withRouteConfig({ + query: graphql` + query AuthCheckContainerQuery { + viewer { + ...RestrictedContainer_viewer + username + email + profiles { + __typename + } + role + } + settings { + auth { + integrations { + local { + enabled + targetFilter { + admin + stream + } } } } } } - } - `, -})(withRouter(withMutation(SetRedirectPathMutation)(AuthCheckContainer))); + `, + })(withRouter(withMutation(SetRedirectPathMutation)(AuthCheckContainer))); + return enhanced; +} -export default enhanced; +export default createAuthCheckContainer; diff --git a/src/core/client/admin/mutations/ApproveCommentMutation.ts b/src/core/client/admin/mutations/ApproveCommentMutation.ts index 391fab9bf..29e1afd03 100644 --- a/src/core/client/admin/mutations/ApproveCommentMutation.ts +++ b/src/core/client/admin/mutations/ApproveCommentMutation.ts @@ -47,18 +47,12 @@ const ApproveCommentMutation = createMutation( input: { commentID: input.commentID, commentRevisionID: input.commentRevisionID, - clientMutationId: clientMutationId.toString(), - }, - }, - optimisticResponse: { - approveComment: { - comment: { - id: input.commentID, - status: "APPROVED", - }, clientMutationId: (clientMutationId++).toString(), }, }, + optimisticUpdater: store => { + store.get(input.commentID)!.setValue("APPROVED", "status"); + }, updater: store => { const connections = [ getQueueConnection(store, "reported", input.storyID), diff --git a/src/core/client/admin/mutations/BanUserMutation.ts b/src/core/client/admin/mutations/BanUserMutation.ts index 5220a2959..e79a4a0d3 100644 --- a/src/core/client/admin/mutations/BanUserMutation.ts +++ b/src/core/client/admin/mutations/BanUserMutation.ts @@ -46,7 +46,7 @@ const BanUserMutation = createMutation( current: lookup( environment, input.userID - )!.status.current.concat([GQLUSER_STATUS.BANNED]), + )!.status.current.concat(GQLUSER_STATUS.BANNED), ban: { active: true, }, diff --git a/src/core/client/admin/mutations/RejectCommentMutation.ts b/src/core/client/admin/mutations/RejectCommentMutation.ts index fd0662ad6..6fcdc1269 100644 --- a/src/core/client/admin/mutations/RejectCommentMutation.ts +++ b/src/core/client/admin/mutations/RejectCommentMutation.ts @@ -47,18 +47,12 @@ const RejectCommentMutation = createMutation( input: { commentID: input.commentID, commentRevisionID: input.commentRevisionID, - clientMutationId: clientMutationId.toString(), - }, - }, - optimisticResponse: { - rejectComment: { - comment: { - id: input.commentID, - status: "REJECTED", - }, clientMutationId: (clientMutationId++).toString(), }, }, + optimisticUpdater: store => { + store.get(input.commentID)!.setValue("REJECTED", "status"); + }, updater: store => { const connections = [ getQueueConnection(store, "reported", input.storyID), diff --git a/src/core/client/admin/routeConfig.tsx b/src/core/client/admin/routeConfig.tsx index 0e9040774..7ac110c83 100644 --- a/src/core/client/admin/routeConfig.tsx +++ b/src/core/client/admin/routeConfig.tsx @@ -1,8 +1,9 @@ import { makeRouteConfig, Redirect, Route } from "found"; import React from "react"; +import { GQLUSER_ROLE } from "coral-framework/schema"; import AppContainer from "./containers/AppContainer"; -import AuthCheckContainer from "./containers/AuthCheckContainer"; +import createAuthCheckContainer from "./containers/AuthCheckContainer"; import { Ability } from "./permissions"; import CommunityContainer from "./routes/community/containers/CommunityContainer"; import ConfigureContainer from "./routes/configure/containers/ConfigureContainer"; @@ -26,7 +27,10 @@ import StoriesContainer from "./routes/stories/containers/StoriesContainer"; export default makeRouteConfig( - + diff --git a/src/core/client/admin/routes/configure/components/Navigation/__snapshots__/Link.spec.tsx.snap b/src/core/client/admin/routes/configure/components/Navigation/__snapshots__/Link.spec.tsx.snap index 435b55960..840668b07 100644 --- a/src/core/client/admin/routes/configure/components/Navigation/__snapshots__/Link.spec.tsx.snap +++ b/src/core/client/admin/routes/configure/components/Navigation/__snapshots__/Link.spec.tsx.snap @@ -4,12 +4,12 @@ exports[`renders correctly 1`] = `
  • - child - +
  • `; diff --git a/src/core/client/admin/routes/login/containers/AccountCompletionContainer.tsx b/src/core/client/admin/routes/login/containers/AccountCompletionContainer.tsx index 34ac3ee80..3ae11575e 100644 --- a/src/core/client/admin/routes/login/containers/AccountCompletionContainer.tsx +++ b/src/core/client/admin/routes/login/containers/AccountCompletionContainer.tsx @@ -1,4 +1,4 @@ -import { withRouter, WithRouter } from "found"; +import { RouterState, withRouter } from "found"; import * as React from "react"; import { Component } from "react"; @@ -25,7 +25,7 @@ type Props = { auth: AuthData; viewer: UserData | null; setRedirectPath: MutationProp; -} & WithRouter; +} & RouterState; function handleAccountCompletion(props: Props) { const { diff --git a/src/core/client/admin/routes/moderate/components/NavigationLink.tsx b/src/core/client/admin/routes/moderate/components/NavigationLink.tsx index c3ac7a438..7a495d7ac 100644 --- a/src/core/client/admin/routes/moderate/components/NavigationLink.tsx +++ b/src/core/client/admin/routes/moderate/components/NavigationLink.tsx @@ -9,7 +9,7 @@ interface Props { } const NavigationLink: FunctionComponent = props => ( - + {props.children} ); diff --git a/src/core/client/admin/routes/moderate/components/__snapshots__/Moderate.spec.tsx.snap b/src/core/client/admin/routes/moderate/components/__snapshots__/Moderate.spec.tsx.snap index 6f44cc9df..41256cd83 100644 --- a/src/core/client/admin/routes/moderate/components/__snapshots__/Moderate.spec.tsx.snap +++ b/src/core/client/admin/routes/moderate/components/__snapshots__/Moderate.spec.tsx.snap @@ -4,7 +4,7 @@ exports[`renders correctly 1`] = `
    - diff --git a/src/core/client/admin/routes/moderate/components/__snapshots__/NavigationLink.spec.tsx.snap b/src/core/client/admin/routes/moderate/components/__snapshots__/NavigationLink.spec.tsx.snap index 856a7af68..8bd73ab38 100644 --- a/src/core/client/admin/routes/moderate/components/__snapshots__/NavigationLink.spec.tsx.snap +++ b/src/core/client/admin/routes/moderate/components/__snapshots__/NavigationLink.spec.tsx.snap @@ -1,11 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renders correctly 1`] = ` - link - + `; diff --git a/src/core/client/admin/routes/moderate/components/__snapshots__/SingleModerate.spec.tsx.snap b/src/core/client/admin/routes/moderate/components/__snapshots__/SingleModerate.spec.tsx.snap index 16a2d29de..cb264f41d 100644 --- a/src/core/client/admin/routes/moderate/components/__snapshots__/SingleModerate.spec.tsx.snap +++ b/src/core/client/admin/routes/moderate/components/__snapshots__/SingleModerate.spec.tsx.snap @@ -12,12 +12,12 @@ exports[`renders correctly 1`] = ` - Go to moderation queues - + { const nodes = this.props.comment.flags.nodes; const offensiveList: React.ReactElement[] = []; const spamList: React.ReactElement[] = []; - nodes.forEach(n => { + nodes.forEach((n, i) => { switch (n.reason) { case GQLCOMMENT_FLAG_REASON.COMMENT_REPORTED_OFFENSIVE: offensiveList.push( } details={n.additionalDetails} /> @@ -33,6 +34,7 @@ export class FlagDetailsContainer extends React.Component { case GQLCOMMENT_FLAG_REASON.COMMENT_REPORTED_SPAM: spamList.push( } details={n.additionalDetails} /> diff --git a/src/core/client/admin/routes/stories/components/StoryRow.tsx b/src/core/client/admin/routes/stories/components/StoryRow.tsx index 7b0af5002..34afac46e 100644 --- a/src/core/client/admin/routes/stories/components/StoryRow.tsx +++ b/src/core/client/admin/routes/stories/components/StoryRow.tsx @@ -23,10 +23,7 @@ interface Props { const UserRow: FunctionComponent = props => ( - + {props.title || } diff --git a/src/core/client/admin/views/decisionHistory/components/GoToCommentLink.tsx b/src/core/client/admin/views/decisionHistory/components/GoToCommentLink.tsx index 81696b12c..edb689e99 100644 --- a/src/core/client/admin/views/decisionHistory/components/GoToCommentLink.tsx +++ b/src/core/client/admin/views/decisionHistory/components/GoToCommentLink.tsx @@ -14,7 +14,7 @@ interface Props { const GoToCommentLink: FunctionComponent = props => { return ( chevron_right - + `; diff --git a/src/core/client/auth/local/__snapshots__/initLocalState.spec.ts.snap b/src/core/client/auth/local/__snapshots__/initLocalState.spec.ts.snap index 16bcf04f7..84136b740 100644 --- a/src/core/client/auth/local/__snapshots__/initLocalState.spec.ts.snap +++ b/src/core/client/auth/local/__snapshots__/initLocalState.spec.ts.snap @@ -7,9 +7,6 @@ exports[`get auth token from url 1`] = ` \\"accessToken\\": \\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzMWIyNjU5MS00ZTlhLTQzODgtYTdmZi1lMWJkYzVkOTdjY2UifQ==\\", \\"accessTokenJTI\\": \\"31b26591-4e9a-4388-a7ff-e1bdc5d97cce\\", \\"loggedIn\\": true, - \\"network\\": { - \\"__ref\\": \\"client:root.local.network\\" - }, \\"view\\": \\"SIGN_IN\\", \\"error\\": null }" @@ -31,16 +28,8 @@ exports[`init local state 1`] = ` \\"accessTokenExp\\": null, \\"accessTokenJTI\\": null, \\"loggedIn\\": false, - \\"network\\": { - \\"__ref\\": \\"client:root.local.network\\" - }, \\"view\\": \\"SIGN_IN\\", \\"error\\": null - }, - \\"client:root.local.network\\": { - \\"__id\\": \\"client:root.local.network\\", - \\"__typename\\": \\"Network\\", - \\"isOffline\\": false } }" `; diff --git a/src/core/client/framework/lib/relay/createAndRetain.ts b/src/core/client/framework/lib/relay/createAndRetain.ts index b9089d6c9..30b718d7c 100644 --- a/src/core/client/framework/lib/relay/createAndRetain.ts +++ b/src/core/client/framework/lib/relay/createAndRetain.ts @@ -1,9 +1,9 @@ import { Environment, RecordProxy, RecordSourceProxy } from "relay-runtime"; /** - * Creates a Record and retain it forever. - * This means that the garbage collector will - * not remove the record on the next run. + * Creates a Record and retain it forever. Useful for local state. + * This means that the garbage collector will not remove the record + * on the next run. * * See https://github.com/facebook/relay/issues/1656#issuecomment-380519761 */ diff --git a/src/core/client/framework/lib/relay/localState.ts b/src/core/client/framework/lib/relay/localState.ts index 54b90d6e6..1b2ef671d 100644 --- a/src/core/client/framework/lib/relay/localState.ts +++ b/src/core/client/framework/lib/relay/localState.ts @@ -18,9 +18,6 @@ export const LOCAL_TYPE = "Local"; */ export const LOCAL_ID = "client:root.local"; -export const NETWORK_TYPE = "Network"; -export const NETWORK_ID = "client:root.local.network"; - export function setAccessTokenInLocalState( accessToken: string | null, source: RecordSourceProxy @@ -57,15 +54,5 @@ export async function initLocalBaseState( // Set auth token setAccessTokenInLocalState(accessToken || null, s); - - // Create network Record - const networkRecord = createAndRetain( - environment, - s, - NETWORK_ID, - NETWORK_TYPE - ); - networkRecord.setValue(false, "isOffline"); - localRecord.setLinkedRecord(networkRecord, "network"); }); } diff --git a/src/core/client/framework/lib/relay/lookup.ts b/src/core/client/framework/lib/relay/lookup.ts index 4e6a81865..d5a75c616 100644 --- a/src/core/client/framework/lib/relay/lookup.ts +++ b/src/core/client/framework/lib/relay/lookup.ts @@ -23,8 +23,20 @@ const createProxy = ( recordSource: RelayInMemoryRecordSource ) => { const proxy: ProxyHandler = { + ownKeys() { + return Object.keys(recordSource); + }, + getOwnPropertyDescriptor() { + return { + enumerable: true, + configurable: true, + }; + }, + has(_, prop) { + return prop in recordSource; + }, get(_, prop) { - if ((recordSource as any)[prop].__ref) { + if (prop in recordSource && (recordSource as any)[prop].__ref) { return lookup(environment, (recordSource as any)[prop].__ref); } return (recordSource as any)[prop]; diff --git a/src/core/client/framework/lib/relay/useLocal.tsx b/src/core/client/framework/lib/relay/useLocal.tsx index 4da0f7b80..a5e21f220 100644 --- a/src/core/client/framework/lib/relay/useLocal.tsx +++ b/src/core/client/framework/lib/relay/useLocal.tsx @@ -83,7 +83,10 @@ function applySimplified( function useLocal( fragmentSpec: GraphQLTaggedNode ): [OmitFragments, (update: LocalUpdater>) => void] { - const fragment = (fragmentSpec as any).data().default; + const fragment = + typeof fragmentSpec === "function" + ? fragmentSpec().default + : (fragmentSpec as any).data().default; if (fragment.kind !== "Fragment") { throw new Error("Expected fragment"); } @@ -106,7 +109,7 @@ function useLocal( if (isAdvancedUpdater(update)) { update(record); } else { - applySimplified(record, fragment.selections, update); + applySimplified(record, fragment.selections[0].selections, update); } }); return; diff --git a/src/core/client/framework/lib/relay/withLocalStateContainer.tsx b/src/core/client/framework/lib/relay/withLocalStateContainer.tsx index 9f42ac401..62d64da4e 100644 --- a/src/core/client/framework/lib/relay/withLocalStateContainer.tsx +++ b/src/core/client/framework/lib/relay/withLocalStateContainer.tsx @@ -29,7 +29,10 @@ interface Props { function withLocalStateContainer( fragmentSpec: GraphQLTaggedNode ): InferableComponentEnhancer<{ local: _RefType }> { - const fragment = (fragmentSpec as any).data().default; + const fragment = + typeof fragmentSpec === "function" + ? fragmentSpec().default + : (fragmentSpec as any).data().default; return compose( withContext(({ relayEnvironment }) => ({ relayEnvironment })), hoistStatics((BaseComponent: React.ComponentType) => { diff --git a/src/core/client/stream/local/__snapshots__/initLocalState.spec.ts.snap b/src/core/client/stream/local/__snapshots__/initLocalState.spec.ts.snap index a75972d45..58565d4ef 100644 --- a/src/core/client/stream/local/__snapshots__/initLocalState.spec.ts.snap +++ b/src/core/client/stream/local/__snapshots__/initLocalState.spec.ts.snap @@ -16,9 +16,6 @@ exports[`init local state 1`] = ` \\"accessTokenExp\\": null, \\"accessTokenJTI\\": null, \\"loggedIn\\": false, - \\"network\\": { - \\"__ref\\": \\"client:root.local.network\\" - }, \\"defaultStreamOrderBy\\": \\"CREATED_AT_DESC\\", \\"authPopup\\": { \\"__ref\\": \\"client:root.local.authPopup\\" @@ -26,11 +23,6 @@ exports[`init local state 1`] = ` \\"activeTab\\": \\"COMMENTS\\", \\"profileTab\\": \\"MY_COMMENTS\\" }, - \\"client:root.local.network\\": { - \\"__id\\": \\"client:root.local.network\\", - \\"__typename\\": \\"Network\\", - \\"isOffline\\": false - }, \\"client:root.local.authPopup\\": { \\"__id\\": \\"client:root.local.authPopup\\", \\"__typename\\": \\"AuthPopup\\", diff --git a/src/core/client/stream/tabs/Comments/Comment/EditCommentForm/EditCommentFormContainer.tsx b/src/core/client/stream/tabs/Comments/Comment/EditCommentForm/EditCommentFormContainer.tsx index 5d9f784bf..40b351a45 100644 --- a/src/core/client/stream/tabs/Comments/Comment/EditCommentForm/EditCommentFormContainer.tsx +++ b/src/core/client/stream/tabs/Comments/Comment/EditCommentForm/EditCommentFormContainer.tsx @@ -48,6 +48,7 @@ interface State { export class EditCommentFormContainer extends Component { private expiredTimer: any; + private intitialValues = { body: this.props.comment.body || "" }; public state: State = { initialized: false, @@ -129,7 +130,7 @@ export class EditCommentFormContainer extends Component { ; @@ -33,7 +36,11 @@ const mutation = graphql` let clientMutationId = 0; -function commit(environment: Environment, input: EditCommentInput) { +function commit( + environment: Environment, + input: EditCommentInput, + { uuidGenerator }: CoralContext +) { return commitMutationPromiseNormalized(environment, { mutation, variables: { @@ -44,10 +51,16 @@ function commit(environment: Environment, input: EditCommentInput) { }, optimisticResponse: { editComment: { - id: input.commentID, - body: input.body, - editing: { - edited: true, + comment: { + id: input.commentID, + body: input.body, + status: lookup(environment, input.commentID)!.status, + revision: { + id: uuidGenerator(), + }, + editing: { + edited: true, + }, }, clientMutationId: (clientMutationId++).toString(), }, diff --git a/src/core/client/stream/tabs/Comments/Comment/ModerationDropdown/ApproveCommentMutation.ts b/src/core/client/stream/tabs/Comments/Comment/ModerationDropdown/ApproveCommentMutation.ts index ef3a9bd9c..c774bdede 100644 --- a/src/core/client/stream/tabs/Comments/Comment/ModerationDropdown/ApproveCommentMutation.ts +++ b/src/core/client/stream/tabs/Comments/Comment/ModerationDropdown/ApproveCommentMutation.ts @@ -6,6 +6,7 @@ import { createMutation, MutationInput, } from "coral-framework/lib/relay"; +import { GQLCOMMENT_STATUS } from "coral-framework/schema"; import { ApproveCommentMutation as MutationTypes } from "coral-stream/__generated__/ApproveCommentMutation.graphql"; let clientMutationId = 0; @@ -27,8 +28,10 @@ const ApproveCommentMutation = createMutation( optimisticResponse: { approveComment: { comment: { - status: "APPROVED", + id: input.commentID, + status: GQLCOMMENT_STATUS.APPROVED, }, + clientMutationId: clientMutationId.toString(), }, }, variables: { diff --git a/src/core/client/stream/tabs/Comments/Comment/ModerationDropdown/RejectCommentMutation.ts b/src/core/client/stream/tabs/Comments/Comment/ModerationDropdown/RejectCommentMutation.ts index e36baff7c..d7144f99c 100644 --- a/src/core/client/stream/tabs/Comments/Comment/ModerationDropdown/RejectCommentMutation.ts +++ b/src/core/client/stream/tabs/Comments/Comment/ModerationDropdown/RejectCommentMutation.ts @@ -6,6 +6,7 @@ import { createMutation, MutationInput, } from "coral-framework/lib/relay"; +import { GQLCOMMENT_STATUS } from "coral-framework/schema"; import { RejectCommentMutation as MutationTypes } from "coral-stream/__generated__/RejectCommentMutation.graphql"; let clientMutationId = 0; @@ -27,8 +28,10 @@ const RejectCommentMutation = createMutation( optimisticResponse: { rejectComment: { comment: { - status: "REJECTED", + id: input.commentID, + status: GQLCOMMENT_STATUS.REJECTED, }, + clientMutationId: clientMutationId.toString(), }, }, variables: { diff --git a/src/core/client/stream/tabs/Comments/Comment/ReactionButton/CreateCommentReactionMutation.ts b/src/core/client/stream/tabs/Comments/Comment/ReactionButton/CreateCommentReactionMutation.ts index 90a6d6f5b..482a028ea 100644 --- a/src/core/client/stream/tabs/Comments/Comment/ReactionButton/CreateCommentReactionMutation.ts +++ b/src/core/client/stream/tabs/Comments/Comment/ReactionButton/CreateCommentReactionMutation.ts @@ -5,10 +5,12 @@ import { Environment } from "relay-runtime"; import { commitMutationPromiseNormalized, createMutationContainer, + lookup, MutationInput, MutationResponsePromise, } from "coral-framework/lib/relay"; +import { GQLComment } from "coral-framework/schema"; import { CreateCommentReactionMutation as MutationTypes } from "coral-stream/__generated__/CreateCommentReactionMutation.graphql"; export type CreateCommentReactionInput = MutationInput; @@ -47,6 +49,9 @@ function commit(environment: Environment, input: CreateCommentReactionInput) { viewerActionPresence: { reaction: true, }, + revision: { + id: lookup(environment, input.commentID)!.revision.id, + }, actionCounts: { reaction: { total: currentCount + 1, diff --git a/src/core/client/stream/tabs/Comments/Comment/ReactionButton/RemoveCommentReactionMutation.ts b/src/core/client/stream/tabs/Comments/Comment/ReactionButton/RemoveCommentReactionMutation.ts index e2e3a120c..0957f63da 100644 --- a/src/core/client/stream/tabs/Comments/Comment/ReactionButton/RemoveCommentReactionMutation.ts +++ b/src/core/client/stream/tabs/Comments/Comment/ReactionButton/RemoveCommentReactionMutation.ts @@ -5,10 +5,12 @@ import { Environment } from "relay-runtime"; import { commitMutationPromiseNormalized, createMutationContainer, + lookup, MutationInput, MutationResponsePromise, } from "coral-framework/lib/relay"; +import { GQLComment } from "coral-framework/schema"; import { RemoveCommentReactionMutation as MutationTypes } from "coral-stream/__generated__/RemoveCommentReactionMutation.graphql"; export type RemoveCommentReactionInput = MutationInput; @@ -46,6 +48,9 @@ function commit(environment: Environment, input: RemoveCommentReactionInput) { viewerActionPresence: { reaction: false, }, + revision: { + id: lookup(environment, input.commentID)!.revision.id, + }, actionCounts: { reaction: { total: currentCount - 1, diff --git a/src/core/client/stream/tabs/Comments/Comment/ReplyCommentForm/CreateCommentReplyMutation.ts b/src/core/client/stream/tabs/Comments/Comment/ReplyCommentForm/CreateCommentReplyMutation.ts index 333f2d764..094bd340e 100644 --- a/src/core/client/stream/tabs/Comments/Comment/ReplyCommentForm/CreateCommentReplyMutation.ts +++ b/src/core/client/stream/tabs/Comments/Comment/ReplyCommentForm/CreateCommentReplyMutation.ts @@ -16,9 +16,10 @@ import { MutationInput, MutationResponsePromise, } from "coral-framework/lib/relay"; -import { GQLStory, GQLUSER_ROLE } from "coral-framework/schema"; +import { GQLComment, GQLStory, GQLUSER_ROLE } from "coral-framework/schema"; import { CreateCommentReplyMutation as MutationTypes } from "coral-stream/__generated__/CreateCommentReplyMutation.graphql"; +import { pick } from "lodash"; import { incrementStoryCommentCounts, isVisible, @@ -108,6 +109,9 @@ graphql` moderation } } +`; +// tslint:disable-next-line:no-unused-expression +graphql` fragment CreateCommentReplyMutation_viewer on User { role } @@ -135,6 +139,7 @@ function commit( input: CreateCommentReplyInput, { uuidGenerator, relayEnvironment }: CoralContext ) { + const parentComment = lookup(environment, input.parentID)!; const viewer = getViewer(environment)!; const currentDate = new Date().toISOString(); const id = uuidGenerator(); @@ -172,17 +177,39 @@ function commit( author: { id: viewer.id, username: viewer.username, + createdAt: viewer.createdAt, }, body: input.body, + revision: { + id: uuidGenerator(), + }, + parent: { + id: parentComment.id, + author: parentComment.author + ? pick(parentComment.author, "username", "id") + : null, + }, editing: { - editableUntil: new Date(Date.now() + 10000), + editableUntil: new Date(Date.now() + 10000).toISOString(), + edited: false, }, actionCounts: { reaction: { total: 0, }, }, - tags: [], + tags: roleIsAtLeast(viewer.role, GQLUSER_ROLE.STAFF) + ? [{ name: "Staff" }] + : [], + viewerActionPresence: { + reaction: false, + dontAgree: false, + flag: false, + }, + replies: { + edges: [], + pageInfo: { endCursor: null, hasNextPage: false }, + }, }, }, clientMutationId: (clientMutationId++).toString(), diff --git a/src/core/client/stream/tabs/Comments/Stream/PostCommentForm/CreateCommentMutation.ts b/src/core/client/stream/tabs/Comments/Stream/PostCommentForm/CreateCommentMutation.ts index 793317342..64f808bf1 100644 --- a/src/core/client/stream/tabs/Comments/Stream/PostCommentForm/CreateCommentMutation.ts +++ b/src/core/client/stream/tabs/Comments/Stream/PostCommentForm/CreateCommentMutation.ts @@ -74,15 +74,18 @@ function addCommentToStory( /** These are needed to be included when querying for the stream. */ // tslint:disable-next-line:no-unused-expression +graphql` + fragment CreateCommentMutation_viewer on User { + role + } +`; +// tslint:disable-next-line:no-unused-expression graphql` fragment CreateCommentMutation_story on Story { settings { moderation } } - fragment CreateCommentMutation_viewer on User { - role - } `; /** end */ @@ -108,7 +111,7 @@ function commit( input: CreateCommentInput, { uuidGenerator, relayEnvironment }: CoralContext ) { - const me = getViewer(environment)!; + const viewer = getViewer(environment)!; const currentDate = new Date().toISOString(); const id = uuidGenerator(); @@ -120,7 +123,7 @@ function commit( // TODO: Generate and use schema types. const expectPremoderation = - !roleIsAtLeast(me.role, GQLUSER_ROLE.STAFF) && + !roleIsAtLeast(viewer.role, GQLUSER_ROLE.STAFF) && storySettings.moderation === "PRE"; return commitMutationPromiseNormalized(environment, { @@ -142,19 +145,36 @@ function commit( createdAt: currentDate, status: "NONE", author: { - id: me.id, - username: me.username, + id: viewer.id, + username: viewer.username, + createdAt: viewer.createdAt, }, + revision: { + id: uuidGenerator(), + }, + parent: null, body: input.body, editing: { - editableUntil: new Date(Date.now() + 10000), + editableUntil: new Date(Date.now() + 10000).toISOString(), + edited: false, }, actionCounts: { reaction: { total: 0, }, }, - tags: [], + tags: roleIsAtLeast(viewer.role, GQLUSER_ROLE.STAFF) + ? [{ name: "Staff" }] + : [], + viewerActionPresence: { + reaction: false, + dontAgree: false, + flag: false, + }, + replies: { + edges: [], + pageInfo: { endCursor: null, hasNextPage: false }, + }, }, }, clientMutationId: (clientMutationId++).toString(), diff --git a/src/core/client/stream/test/comments/stream/__snapshots__/postLocalReply.spec.tsx.snap b/src/core/client/stream/test/comments/stream/__snapshots__/postLocalReply.spec.tsx.snap index 7271867ef..bb7ec24b8 100644 --- a/src/core/client/stream/test/comments/stream/__snapshots__/postLocalReply.spec.tsx.snap +++ b/src/core/client/stream/test/comments/stream/__snapshots__/postLocalReply.spec.tsx.snap @@ -478,6 +478,33 @@ exports[`post a reply: optimistic response 1`] = `
    +
    +
    + + +   + + + In reply to + + Markus + + +
    +
    diff --git a/src/core/client/stream/test/comments/stream/__snapshots__/postReply.spec.tsx.snap b/src/core/client/stream/test/comments/stream/__snapshots__/postReply.spec.tsx.snap index ad6b6b526..ff3a37cef 100644 --- a/src/core/client/stream/test/comments/stream/__snapshots__/postReply.spec.tsx.snap +++ b/src/core/client/stream/test/comments/stream/__snapshots__/postReply.spec.tsx.snap @@ -463,6 +463,33 @@ exports[`post a reply: optimistic response 1`] = `
    +
    +
    + + +   + + + In reply to + + Markus + + +
    +
    diff --git a/src/docs/workarounds.mdx b/src/docs/workarounds.mdx deleted file mode 100644 index ba2777968..000000000 --- a/src/docs/workarounds.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -name: Workarounds ---- - -# Workarounds - -A place to write down temporary workarounds. - -## Babel - -Babel versions are currently locked to 7.0.0-beta.49 because of this bug: - -https://github.com/babel/babel/issues/8167#issuecomment-397295483 - -## Relay Client Side Schema Extensions - -We use Client Side Schema Extension in `Relay` to store client and UI related state. It works great, the only limitation currently is that locally created `Records` are garbage collected. We created a little helper in `coral-framework/lib/relay/createAndRetain.ts` that creates and retains these `Records` forever. Hopefully this gets resolved and we don't need to do this kind of manual lifecycle management. - -Related: https://github.com/facebook/relay/issues/1656#issuecomment-374079965 - -```ts -import { commitLocalUpdate, Environment } from "relay-runtime"; - -import { - createAndRetain, - LOCAL_ID, - LOCAL_TYPE, -} from "coral-framework/lib/relay"; - -commitLocalUpdate(environment, s => { - const root = s.getRoot(); - // Create the Local Record which is the Root for the client states. - const localRecord = createAndRetain(environment, s, LOCAL_ID, LOCAL_TYPE); - root.setLinkedRecord(localRecord, "local"); -}); -``` - -## Type inference for `compose(...fn)` - -[recompose](https://github.com/acdlite/recompose) is a great library to work with Higher-Order-Components. `Typescript` is powerful enough to type a lot of HOC in a way that it works with type inference. However type inference currently does not work for `compose()` until this https://github.com/Microsoft/TypeScript/pull/24626 lands. - -That's why in many cases instead of doing this - -```ts -export type ContainerProps { - … -} - -const enhance = compose( - withLocalStateContainer(…), - withFragmentContainer(…) -); - -export default enhance(Container); -``` - -We do this - -```ts -const enhanced = withLocalStateContainer( - … -)( - withFragmentContainer( - … - )(Container) -); - -export type ContainerProps = ReturnPropTypes; -export default enhanced; -``` - -A working chaining example looks like this: - -``` -const enhanced = withFragmentContainer<{ data: Data }>({ - data: graphql` - fragment PermalinkViewContainerQuery on Query - @argumentDefinitions(commentID: { type: "ID!" }) { - comment(id: $commentID) { - ...CommentContainer_comment - } - } - `, -})( - withLocalStateContainer( - graphql` - fragment PermalinkViewContainerLocal on Local { - storyURL - } - ` - )(PermalinkViewContainer) -); -```