Skip to content

Commit a387da6

Browse files
authored
Convert template to Javascript
1 parent d6eaa93 commit a387da6

22 files changed

+24
-890
lines changed

.graphqlrc.ts

Lines changed: 0 additions & 40 deletions
This file was deleted.

app/db.server.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

app/entry.server.jsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { createReadableStreamFromReadable } from "@remix-run/node";
55
import { isbot } from "isbot";
66
import { addDocumentResponseHeaders } from "./shopify.server";
77

8-
const ABORT_DELAY = 5000;
8+
export const streamTimeout = 5000;
99

1010
export default async function handleRequest(
1111
request,
@@ -19,11 +19,7 @@ export default async function handleRequest(
1919

2020
return new Promise((resolve, reject) => {
2121
const { pipe, abort } = renderToPipeableStream(
22-
<RemixServer
23-
context={remixContext}
24-
url={request.url}
25-
abortDelay={ABORT_DELAY}
26-
/>,
22+
<RemixServer context={remixContext} url={request.url} />,
2723
{
2824
[callbackName]: () => {
2925
const body = new PassThrough();
@@ -48,6 +44,8 @@ export default async function handleRequest(
4844
},
4945
);
5046

51-
setTimeout(abort, ABORT_DELAY);
47+
// Automatically timeout the React renderer after 6 seconds, which ensures
48+
// React has enough time to flush down the rejected boundary contents
49+
setTimeout(abort, streamTimeout + 1000);
5250
});
5351
}

app/entry.server.tsx

Lines changed: 0 additions & 59 deletions
This file was deleted.

app/globals.d.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

app/root.tsx

Lines changed: 0 additions & 30 deletions
This file was deleted.
File renamed without changes.

app/routes/_index/route.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { json, redirect } from "@remix-run/node";
1+
import { redirect } from "@remix-run/node";
22
import { Form, useLoaderData } from "@remix-run/react";
33
import { login } from "../../shopify.server";
44
import styles from "./styles.module.css";
@@ -10,7 +10,7 @@ export const loader = async ({ request }) => {
1010
throw redirect(`/app?${url.searchParams.toString()}`);
1111
}
1212

13-
return json({ showForm: Boolean(login) });
13+
return { showForm: Boolean(login) };
1414
};
1515

1616
export default function App() {

app/routes/_index/route.tsx

Lines changed: 0 additions & 58 deletions
This file was deleted.

app/routes/app._index.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { useEffect } from "react";
2-
import { json } from "@remix-run/node";
32
import { useFetcher } from "@remix-run/react";
43
import {
54
Page,
@@ -81,10 +80,10 @@ export const action = async ({ request }) => {
8180
);
8281
const variantResponseJson = await variantResponse.json();
8382

84-
return json({
83+
return {
8584
product: responseJson.data.productCreate.product,
8685
variant: variantResponseJson.data.productVariantsBulkUpdate.productVariants,
87-
});
86+
};
8887
};
8988

9089
export default function Index() {

0 commit comments

Comments
 (0)