Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into pr/integration-jest
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Mar 6, 2024
2 parents 68caa33 + 80aec32 commit 90d1580
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 18 deletions.
2 changes: 1 addition & 1 deletion integration-test/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ yalc.lock
.vscode/
.vercel
.next/
test-results/
test-results/
6 changes: 0 additions & 6 deletions integration-test/experimental-react/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const app = express();
let vite;
let bootstrapModules = [];
let assets = [];
console.log({ isProduction });
if (!isProduction) {
const { createServer } = await import("vite");
vite = await createServer({
Expand Down Expand Up @@ -48,7 +47,6 @@ app.use("*", async (req, res) => {
res.socket.on("error", (error) => {
console.error("Fatal", error);
});

let didError = false;
let didFinish = false;
const App = (
Expand All @@ -62,26 +60,22 @@ app.use("*", async (req, res) => {
const { pipe, abort } = renderToPipeableStream(App, {
bootstrapModules,
onAllReady() {
console.log("All ready");
// Full completion.
// You can use this for SSG or crawlers.
didFinish = true;
},
onShellReady() {
console.log("Shell ready", { didError });
// If something errored before we started streaming, we set the error code appropriately.
res.statusCode = didError ? 500 : 200;
res.setHeader("Content-type", "text/html");
setImmediate(() => pipe(res));
},
onShellError(x) {
console.log("Shell error", x);
// Something errored before we could complete the shell so we emit an alternative shell.
res.statusCode = 500;
res.send("<!doctype><p>Error</p>");
},
onError(x) {
console.log("Error", x);
didError = true;
console.error(x);
},
Expand Down
4 changes: 2 additions & 2 deletions integration-test/vite-streaming/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"express": "^4.18.2",
"graphql": "^16.8.1",
"graphql-tag": "^2.12.6",
"react": "npm:@phryneas/[email protected].0-phryneas-a1c625c",
"react-dom": "npm:@phryneas/[email protected].0-phryneas-a1c625c",
"react": "18.3.0-canary-60a927d04-20240113",
"react-dom": "18.3.0-canary-60a927d04-20240113",
"sirv": "^2.0.4"
},
"devDependencies": {
Expand Down
1 change: 0 additions & 1 deletion integration-test/vite-streaming/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const app = express();
let vite;
let bootstrapModules = [];
let assets = [];
console.log({ isProduction });
if (!isProduction) {
const { createServer } = await import("vite");
vite = await createServer({
Expand Down
44 changes: 37 additions & 7 deletions integration-test/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ __metadata:
peerDependencies:
"@apollo/client": ^3.9.0
react: ^18
checksum: 10/ce08a9940b1a08c77f1a63ef8294685df9a091c573f5e74c5b0e0a488ee62f3b86ff889e5e2dcac9af352490dd54a3a4174829ede6311fb0893d9e14ea2e4843
checksum: 10/8e12155ebcb9672f5b645c364d356018014df750412c61613341121ebb4d4eabb5f42cd9018cc3a81ad988f1b425548d68254ca49ede19c31d0d9e5a9a4f240a
languageName: node
linkType: hard

"@apollo/client@npm:^3.9.1":
"@apollo/client@npm:^3.9.1, @apollo/client@npm:^3.9.5":
version: 3.9.5
resolution: "@apollo/client@npm:3.9.5"
dependencies:
Expand Down Expand Up @@ -83,14 +83,14 @@ __metadata:

"@apollo/experimental-nextjs-app-support@exec:./shared/build-experimental-nextjs-app-support.cjs::locator=%40integration-test%2Froot%40workspace%3A.":
version: 0.8.0
resolution: "@apollo/experimental-nextjs-app-support@exec:./shared/build-experimental-nextjs-app-support.cjs#./shared/build-experimental-nextjs-app-support.cjs::hash=3174d7&locator=%40integration-test%2Froot%40workspace%3A."
resolution: "@apollo/experimental-nextjs-app-support@exec:./shared/build-experimental-nextjs-app-support.cjs#./shared/build-experimental-nextjs-app-support.cjs::hash=fd83cc&locator=%40integration-test%2Froot%40workspace%3A."
dependencies:
"@apollo/client-react-streaming": "npm:^0.9.0"
peerDependencies:
"@apollo/client": ^3.9.0
next: ^13.4.1 || ^14.0.0
react: ^18
checksum: 10/dbb9e86eaa6561b871ddf3bca851a3b75a406e72ff5e316a4c33a4ac2b1623036e592011371ccc1fc85d800e92bf866ce915732b78c1b1c4053e54f2fdc9efab
checksum: 10/505b723bac0f3a7f15287ea32fab9f2e8c0cd567149abf11d750855f8a9bfc0aa26e44179ad10c32f7d162ad86318717032413ef8e1a25385185178e022588fa
languageName: node
linkType: hard

Expand Down Expand Up @@ -2003,7 +2003,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@integration-test/jest@workspace:jest"
dependencies:
"@apollo/client": "npm:^3.9.1"
"@apollo/client": "npm:^3.9.5"
"@apollo/client-react-streaming": "workspace:*"
"@apollo/experimental-nextjs-app-support": "workspace:*"
"@babel/core": "npm:^7.24.0"
Expand Down Expand Up @@ -2072,8 +2072,8 @@ __metadata:
graphql: "npm:^16.8.1"
graphql-tag: "npm:^2.12.6"
prettier: "npm:^3.2.5"
react: "npm:@phryneas/[email protected].0-phryneas-a1c625c"
react-dom: "npm:@phryneas/[email protected].0-phryneas-a1c625c"
react: "npm:18.3.0-canary-60a927d04-20240113"
react-dom: "npm:18.3.0-canary-60a927d04-20240113"
sirv: "npm:^2.0.4"
vite: "npm:^5.0.10"
languageName: unknown
Expand Down Expand Up @@ -6875,6 +6875,18 @@ __metadata:
languageName: node
linkType: hard

"react-dom@npm:18.3.0-canary-60a927d04-20240113":
version: 18.3.0-canary-60a927d04-20240113
resolution: "react-dom@npm:18.3.0-canary-60a927d04-20240113"
dependencies:
loose-envify: "npm:^1.1.0"
scheduler: "npm:0.24.0-canary-60a927d04-20240113"
peerDependencies:
react: 18.3.0-canary-60a927d04-20240113
checksum: 10/5a339f511e32d2690021458913d40fcf3671d4fe708026851b811420d958615a298d80352bb78ed4c635c3125ce491d30591213cb1086888bac8c426a2e98e65
languageName: node
linkType: hard

"react-dom@npm:@phryneas/[email protected]":
version: 0.0.0-phryneas-a1c625c
resolution: "@phryneas/experimental-react-dom@npm:0.0.0-phryneas-a1c625c"
Expand Down Expand Up @@ -6924,6 +6936,15 @@ __metadata:
languageName: node
linkType: hard

"react@npm:18.3.0-canary-60a927d04-20240113":
version: 18.3.0-canary-60a927d04-20240113
resolution: "react@npm:18.3.0-canary-60a927d04-20240113"
dependencies:
loose-envify: "npm:^1.1.0"
checksum: 10/7da693ec8a4e4c33941f55c2cc042a4a1ea9360ab7b7fd227b7cddcc8949cac0058e585e557ea1a447dbb74e7865bcebb996ee975680e2b98c6d98e941847cb1
languageName: node
linkType: hard

"react@npm:@phryneas/[email protected]":
version: 0.0.0-phryneas-a1c625c
resolution: "@phryneas/experimental-react@npm:0.0.0-phryneas-a1c625c"
Expand Down Expand Up @@ -7195,6 +7216,15 @@ __metadata:
languageName: node
linkType: hard

"scheduler@npm:0.24.0-canary-60a927d04-20240113":
version: 0.24.0-canary-60a927d04-20240113
resolution: "scheduler@npm:0.24.0-canary-60a927d04-20240113"
dependencies:
loose-envify: "npm:^1.1.0"
checksum: 10/0289b2a5d20e4885c268a90765ebe7192eafb5b3a065888092c1684e25438932e06efd199a852b47dc8b57cc8741c609552e9f13de66e4492400e8dd4201b809
languageName: node
linkType: hard

"scheduler@npm:^0.23.0":
version: 0.23.0
resolution: "scheduler@npm:0.23.0"
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
},
"resolutions": {
"@apollo/client": "0.0.0-pr-11617-20240227102358",
"prettier": "^3.0.0",
"[email protected]": "18.3.0-canary-60a927d04-20240113",
"[email protected]": "18.3.0-canary-60a927d04-20240113",
"superjson": "1.13.3"
Expand Down

0 comments on commit 90d1580

Please sign in to comment.