diff --git a/package.json b/package.json index 6d22328c..13f6a9f3 100644 --- a/package.json +++ b/package.json @@ -8,5 +8,8 @@ ], "dependencies": { "prettier": "^2.8.4" + }, + "devDependencies": { + "@redwoodjs/web": "canary" } } diff --git a/package/src/ssr/RehydrationContext.tsx b/package/src/ssr/RehydrationContext.tsx index 0ad93f14..296bb801 100644 --- a/package/src/ssr/RehydrationContext.tsx +++ b/package/src/ssr/RehydrationContext.tsx @@ -1,7 +1,7 @@ import { useApolloClient } from "@apollo/client"; import React from "react"; import { NextSSRInMemoryCache } from "./NextSSRInMemoryCache"; -import { ServerInsertedHTMLContext } from "next/navigation"; +import { ServerHtmlContext } from "@redwoodjs/web"; import { RehydrationContextValue } from "./types"; import { registerDataTransport, transportDataToJS } from "./dataTransport"; import invariant from "ts-invariant"; @@ -46,7 +46,7 @@ export const RehydrationContextProvider = ({ export function useRehydrationContext(): RehydrationContextValue | undefined { const rehydrationContext = React.useContext(ApolloRehydrationContext); - const insertHtml = React.useContext(ServerInsertedHTMLContext); + const insertHtml = React.useContext(ServerHtmlContext); // help transpilers to omit this code in bundling if (typeof window !== "undefined") return; diff --git a/package/tsconfig.json b/package/tsconfig.json index 314a46b0..c713b67a 100644 --- a/package/tsconfig.json +++ b/package/tsconfig.json @@ -6,6 +6,7 @@ "declaration": true, "sourceMap": true, "jsx": "react", - "declarationMap": true + "declarationMap": true, + "types": ["react/canary"] } } diff --git a/yarn.lock b/yarn.lock index 5197cbff..3498a7fd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -40,6 +40,42 @@ __metadata: languageName: node linkType: hard +"@apollo/client@npm:3.8.1": + version: 3.8.1 + resolution: "@apollo/client@npm:3.8.1" + dependencies: + "@graphql-typed-document-node/core": ^3.1.1 + "@wry/context": ^0.7.3 + "@wry/equality": ^0.5.6 + "@wry/trie": ^0.4.3 + graphql-tag: ^2.12.6 + hoist-non-react-statics: ^3.3.2 + optimism: ^0.17.5 + prop-types: ^15.7.2 + response-iterator: ^0.2.6 + symbol-observable: ^4.0.0 + ts-invariant: ^0.10.3 + tslib: ^2.3.0 + zen-observable-ts: ^1.2.5 + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 + graphql-ws: ^5.5.5 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + subscriptions-transport-ws: ^0.9.0 || ^0.11.0 + peerDependenciesMeta: + graphql-ws: + optional: true + react: + optional: true + react-dom: + optional: true + subscriptions-transport-ws: + optional: true + checksum: 3a1748359a7c0f339764e7764dc6c7426be1d522eda963416d3a693733edbce8408cb8f78f9c98b036d34621af663e3dd3446703dfd29037c78a77eacd3c70bb + languageName: node + linkType: hard + "@apollo/client@npm:>=3.8.0-rc.1": version: 3.8.0-rc.1 resolution: "@apollo/client@npm:3.8.0-rc.1" @@ -1097,6 +1133,16 @@ __metadata: languageName: node linkType: hard +"@babel/runtime-corejs3@npm:7.22.11": + version: 7.22.11 + resolution: "@babel/runtime-corejs3@npm:7.22.11" + dependencies: + core-js-pure: ^3.30.2 + regenerator-runtime: ^0.14.0 + checksum: d7649e3dd789fce9f15a80521109e51faeda195ab0b65c330c61c9c0b2a13b11f5611e5d25db5b75df873e2ec06f642b60dc6ace6bacc699b975c4bc9d5cff88 + languageName: node + linkType: hard + "@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.14.8, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.20.7": version: 7.21.0 resolution: "@babel/runtime@npm:7.21.0" @@ -4147,6 +4193,49 @@ __metadata: languageName: node linkType: hard +"@redwoodjs/auth@npm:7.0.0-canary.250+62357b71b": + version: 7.0.0-canary.250 + resolution: "@redwoodjs/auth@npm:7.0.0-canary.250" + dependencies: + "@babel/runtime-corejs3": 7.22.11 + core-js: 3.32.0 + react: 18.3.0-canary-035a41c4e-20230704 + checksum: 253fc512b0f4c7651f14fcf0f583d15ce00ba941d5334ca6e0bd06801a42907cca49d2ab6091c534eceb43c2c2977bb5fe1c9fa9d204193406a4cd894ec9d474 + languageName: node + linkType: hard + +"@redwoodjs/web@npm:canary": + version: 7.0.0-canary.250 + resolution: "@redwoodjs/web@npm:7.0.0-canary.250" + dependencies: + "@apollo/client": 3.8.1 + "@babel/runtime-corejs3": 7.22.11 + "@redwoodjs/auth": 7.0.0-canary.250+62357b71b + core-js: 3.32.0 + graphql: 16.8.0 + graphql-sse: 2.2.1 + graphql-tag: 2.12.6 + react-helmet-async: 1.3.0 + react-hot-toast: 2.4.1 + stacktracey: 2.1.8 + ts-toolbelt: 9.6.0 + peerDependencies: + prop-types: 15.8.1 + react: 18.3.0-canary-035a41c4e-20230704 + react-dom: 18.3.0-canary-035a41c4e-20230704 + bin: + cross-env: dist/bins/cross-env.js + msw: dist/bins/msw.js + redwood: dist/bins/redwood.js + rw: dist/bins/redwood.js + rwfw: dist/bins/rwfw.js + storybook: dist/bins/storybook.js + tsc: dist/bins/tsc.js + webpack: dist/bins/webpack.js + checksum: 1cf3032444d21d2b360c003fb2a41e376ebd4a8861c3cd96b181947597e3a53c34501bbd792ca14a45bf7abea6e6b2951015eb97ec97e220d0a1cee69c6d5650 + languageName: node + linkType: hard + "@repeaterjs/repeater@npm:3.0.4, @repeaterjs/repeater@npm:^3.0.4": version: 3.0.4 resolution: "@repeaterjs/repeater@npm:3.0.4" @@ -5162,6 +5251,15 @@ __metadata: languageName: node linkType: hard +"as-table@npm:^1.0.36": + version: 1.0.55 + resolution: "as-table@npm:1.0.55" + dependencies: + printable-characters: ^1.0.42 + checksum: 341c99d9e99a702c315b3f0744d49b4764b26ef7ddd32bafb9e1706626560c0e599100521fc1b17f640e804bd0503ce70b2ba519c023da6edf06bdd9086dccd9 + languageName: node + linkType: hard + "asap@npm:~2.0.3": version: 2.0.6 resolution: "asap@npm:2.0.6" @@ -6000,6 +6098,20 @@ __metadata: languageName: node linkType: hard +"core-js-pure@npm:^3.30.2": + version: 3.32.1 + resolution: "core-js-pure@npm:3.32.1" + checksum: 06d3b1585b1f161e84adaf6a0f1db2434309b8d6c748ee82f1806c5d9755272a30074dfa888d60a164c639c6820588ab8462f1073c6971e76659f13788c2f10d + languageName: node + linkType: hard + +"core-js@npm:3.32.0": + version: 3.32.0 + resolution: "core-js@npm:3.32.0" + checksum: 52921395028550e4c9d21d47b9836439bb5b6b9eefc34d45a3948a68d81fdd093acc0fadf69f9cf632b82f01f95f22f484408a93dd9e940b19119ac204cd2925 + languageName: node + linkType: hard + "cors@npm:^2.8.5": version: 2.8.5 resolution: "cors@npm:2.8.5" @@ -6101,6 +6213,13 @@ __metadata: languageName: node linkType: hard +"data-uri-to-buffer@npm:^2.0.0": + version: 2.0.2 + resolution: "data-uri-to-buffer@npm:2.0.2" + checksum: 152bec5e77513ee253a7c686700a1723246f582dad8b614e8eaaaba7fa45a15c8671ae4b8f4843f4f3a002dae1d3e7a20f852f7d7bdc8b4c15cfe7adfdfb07f8 + languageName: node + linkType: hard + "dataloader@npm:^2.2.2": version: 2.2.2 resolution: "dataloader@npm:2.2.2" @@ -7569,6 +7688,16 @@ __metadata: languageName: node linkType: hard +"get-source@npm:^2.0.12": + version: 2.0.12 + resolution: "get-source@npm:2.0.12" + dependencies: + data-uri-to-buffer: ^2.0.0 + source-map: ^0.6.1 + checksum: c73368fee709594ba38682ec1a96872aac6f7d766396019611d3d2358b68186a7847765a773ea0db088c42781126cc6bc09e4b87f263951c74dae5dcea50ad42 + languageName: node + linkType: hard + "get-stdin@npm:^4.0.1": version: 4.0.1 resolution: "get-stdin@npm:4.0.1" @@ -7754,6 +7883,15 @@ __metadata: languageName: node linkType: hard +"goober@npm:^2.1.10": + version: 2.1.13 + resolution: "goober@npm:2.1.13" + peerDependencies: + csstype: ^3.0.10 + checksum: 0c00b90d26d1a2fad432e311fd4f47bc9fef1eee2a733158d9e2c72a89cf76d414090d063a8d20fe378f2b2b8087df0a83b0f00a3244d1466b97a0d3b14344a7 + languageName: node + linkType: hard + "gopd@npm:^1.0.1": version: 1.0.1 resolution: "gopd@npm:1.0.1" @@ -7814,7 +7952,16 @@ __metadata: languageName: node linkType: hard -"graphql-tag@npm:^2.11.0, graphql-tag@npm:^2.12.6": +"graphql-sse@npm:2.2.1": + version: 2.2.1 + resolution: "graphql-sse@npm:2.2.1" + peerDependencies: + graphql: ">=0.11 <=16" + checksum: c14d74cbb269a544139e0c50af03f41298fabd232eb081806bc511d19acdb6b6f6275ec9ea9e206871bc8b25ef611d65e0da710ab8eb437c7dffc8f53fd06cd9 + languageName: node + linkType: hard + +"graphql-tag@npm:2.12.6, graphql-tag@npm:^2.11.0, graphql-tag@npm:^2.12.6": version: 2.12.6 resolution: "graphql-tag@npm:2.12.6" dependencies: @@ -7834,6 +7981,13 @@ __metadata: languageName: node linkType: hard +"graphql@npm:16.8.0": + version: 16.8.0 + resolution: "graphql@npm:16.8.0" + checksum: d853d4085b0c911a7e2a926c3b0d379934ec61cd4329e70cdf281763102f024fd80a97db7a505b8b04fed9050cb4875f8f518150ea854557a500a0b41dcd7f4e + languageName: node + linkType: hard + "graphql@npm:^16.6.0": version: 16.6.0 resolution: "graphql@npm:16.6.0" @@ -9262,6 +9416,7 @@ __metadata: version: 0.0.0-use.local resolution: "monorepo@workspace:." dependencies: + "@redwoodjs/web": canary prettier: ^2.8.4 languageName: unknown linkType: soft @@ -10190,6 +10345,13 @@ __metadata: languageName: node linkType: hard +"printable-characters@npm:^1.0.42": + version: 1.0.42 + resolution: "printable-characters@npm:1.0.42" + checksum: 2724aa02919d7085933af0f8f904bd0de67a6b53834f2e5b98fc7aa3650e20755c805e8c85bcf96c09f678cb16a58b55640dd3a2da843195fce06b1ccb0c8ce4 + languageName: node + linkType: hard + "promise-inflight@npm:^1.0.1": version: 1.0.1 resolution: "promise-inflight@npm:1.0.1" @@ -10351,6 +10513,13 @@ __metadata: languageName: node linkType: hard +"react-fast-compare@npm:^3.2.0": + version: 3.2.2 + resolution: "react-fast-compare@npm:3.2.2" + checksum: 2071415b4f76a3e6b55c84611c4d24dcb12ffc85811a2840b5a3f1ff2d1a99be1020d9437ee7c6e024c9f4cbb84ceb35e48cf84f28fcb00265ad2dfdd3947704 + languageName: node + linkType: hard + "react-focus-lock@npm:^2.9.2": version: 2.9.4 resolution: "react-focus-lock@npm:2.9.4" @@ -10371,6 +10540,34 @@ __metadata: languageName: node linkType: hard +"react-helmet-async@npm:1.3.0": + version: 1.3.0 + resolution: "react-helmet-async@npm:1.3.0" + dependencies: + "@babel/runtime": ^7.12.5 + invariant: ^2.2.4 + prop-types: ^15.7.2 + react-fast-compare: ^3.2.0 + shallowequal: ^1.1.0 + peerDependencies: + react: ^16.6.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.6.0 || ^17.0.0 || ^18.0.0 + checksum: 7ca7e47f8af14ea186688b512a87ab912bf6041312b297f92516341b140b3f0f8aedf5a44d226d99e69ed067b0cc106e38aeb9c9b738ffcc63d10721c844db90 + languageName: node + linkType: hard + +"react-hot-toast@npm:2.4.1": + version: 2.4.1 + resolution: "react-hot-toast@npm:2.4.1" + dependencies: + goober: ^2.1.10 + peerDependencies: + react: ">=16" + react-dom: ">=16" + checksum: 3e337816db574782454bf09c63a8aca546bf9c5be3f83d0494d24bdcfd97ca2db64d4c151c4ab0184d2342d7a7226403e6812e70caf03c8b55a07787bb4ad0f2 + languageName: node + linkType: hard + "react-icons@npm:^4.8.0": version: 4.8.0 resolution: "react-icons@npm:4.8.0" @@ -10462,6 +10659,15 @@ __metadata: languageName: node linkType: hard +"react@npm:18.3.0-canary-035a41c4e-20230704": + version: 18.3.0-canary-035a41c4e-20230704 + resolution: "react@npm:18.3.0-canary-035a41c4e-20230704" + dependencies: + loose-envify: ^1.1.0 + checksum: 05c67a60a4a5a6e9f7c71befa0b09afc411f5d49680e41ec1176ebfbf3a911745e60c88ab03428ad42e61215941928e9d57c9aed315851682b74cc252eab7ae3 + languageName: node + linkType: hard + "read-cache@npm:^1.0.0": version: 1.0.0 resolution: "read-cache@npm:1.0.0" @@ -10498,6 +10704,13 @@ __metadata: languageName: node linkType: hard +"regenerator-runtime@npm:^0.14.0": + version: 0.14.0 + resolution: "regenerator-runtime@npm:0.14.0" + checksum: 1c977ad82a82a4412e4f639d65d22be376d3ebdd30da2c003eeafdaaacd03fc00c2320f18120007ee700900979284fc78a9f00da7fb593f6e6eeebc673fba9a3 + languageName: node + linkType: hard + "regexp.prototype.flags@npm:^1.4.3": version: 1.4.3 resolution: "regexp.prototype.flags@npm:1.4.3" @@ -10909,6 +11122,13 @@ __metadata: languageName: node linkType: hard +"shallowequal@npm:^1.1.0": + version: 1.1.0 + resolution: "shallowequal@npm:1.1.0" + checksum: f4c1de0837f106d2dbbfd5d0720a5d059d1c66b42b580965c8f06bb1db684be8783538b684092648c981294bf817869f743a066538771dbecb293df78f765e00 + languageName: node + linkType: hard + "shebang-command@npm:^2.0.0": version: 2.0.0 resolution: "shebang-command@npm:2.0.0" @@ -11091,6 +11311,16 @@ __metadata: languageName: node linkType: hard +"stacktracey@npm:2.1.8": + version: 2.1.8 + resolution: "stacktracey@npm:2.1.8" + dependencies: + as-table: ^1.0.36 + get-source: ^2.0.12 + checksum: abd8316b4e120884108f5a47b2f61abdcaeaa118afd95f3c48317cb057fff43d697450ba00de3f9fe7fee61ee72644ccda4db990a8e4553706644f7c17522eab + languageName: node + linkType: hard + "statuses@npm:2.0.1": version: 2.0.1 resolution: "statuses@npm:2.0.1" @@ -11634,6 +11864,13 @@ __metadata: languageName: node linkType: hard +"ts-toolbelt@npm:9.6.0": + version: 9.6.0 + resolution: "ts-toolbelt@npm:9.6.0" + checksum: 9f35fd95d895a5d32ea9fd2e532a695b0bae6cbff6832b77292efa188a0ed1ed6e54f63f74a8920390f3d909a7a3adb20a144686372a8e78b420246a9bd3d58a + languageName: node + linkType: hard + "tsconfig-paths@npm:^3.14.1": version: 3.14.2 resolution: "tsconfig-paths@npm:3.14.2"