Skip to content

Commit

Permalink
Convert template to Javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow authored Dec 4, 2024
1 parent d6eaa93 commit a387da6
Show file tree
Hide file tree
Showing 22 changed files with 24 additions and 890 deletions.
40 changes: 0 additions & 40 deletions .graphqlrc.ts

This file was deleted.

15 changes: 0 additions & 15 deletions app/db.server.ts

This file was deleted.

12 changes: 5 additions & 7 deletions app/entry.server.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { createReadableStreamFromReadable } from "@remix-run/node";
import { isbot } from "isbot";
import { addDocumentResponseHeaders } from "./shopify.server";

const ABORT_DELAY = 5000;
export const streamTimeout = 5000;

export default async function handleRequest(
request,
Expand All @@ -19,11 +19,7 @@ export default async function handleRequest(

return new Promise((resolve, reject) => {
const { pipe, abort } = renderToPipeableStream(
<RemixServer
context={remixContext}
url={request.url}
abortDelay={ABORT_DELAY}
/>,
<RemixServer context={remixContext} url={request.url} />,
{
[callbackName]: () => {
const body = new PassThrough();
Expand All @@ -48,6 +44,8 @@ export default async function handleRequest(
},
);

setTimeout(abort, ABORT_DELAY);
// Automatically timeout the React renderer after 6 seconds, which ensures
// React has enough time to flush down the rejected boundary contents
setTimeout(abort, streamTimeout + 1000);
});
}
59 changes: 0 additions & 59 deletions app/entry.server.tsx

This file was deleted.

1 change: 0 additions & 1 deletion app/globals.d.ts

This file was deleted.

30 changes: 0 additions & 30 deletions app/root.tsx

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions app/routes/_index/route.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { json, redirect } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { Form, useLoaderData } from "@remix-run/react";
import { login } from "../../shopify.server";
import styles from "./styles.module.css";
Expand All @@ -10,7 +10,7 @@ export const loader = async ({ request }) => {
throw redirect(`/app?${url.searchParams.toString()}`);
}

return json({ showForm: Boolean(login) });
return { showForm: Boolean(login) };
};

export default function App() {
Expand Down
58 changes: 0 additions & 58 deletions app/routes/_index/route.tsx

This file was deleted.

5 changes: 2 additions & 3 deletions app/routes/app._index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useEffect } from "react";
import { json } from "@remix-run/node";
import { useFetcher } from "@remix-run/react";
import {
Page,
Expand Down Expand Up @@ -81,10 +80,10 @@ export const action = async ({ request }) => {
);
const variantResponseJson = await variantResponse.json();

return json({
return {
product: responseJson.data.productCreate.product,
variant: variantResponseJson.data.productVariantsBulkUpdate.productVariants,
});
};
};

export default function Index() {
Expand Down
Loading

0 comments on commit a387da6

Please sign in to comment.