Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/entry.client.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hydrate } from "react-dom";
import { RemixBrowser } from "remix";
import { hydrate } from 'react-dom'
import { RemixBrowser } from 'remix'

hydrate(<RemixBrowser />, document);
hydrate(<RemixBrowser />, document)
30 changes: 15 additions & 15 deletions app/entry.server.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { renderToString } from "react-dom/server";
import { RemixServer } from "remix";
import type { EntryContext } from "remix";
import { renderToString } from 'react-dom/server'
import { RemixServer } from 'remix'
import type { EntryContext } from 'remix'

export default function handleRequest(
request: Request,
responseStatusCode: number,
responseHeaders: Headers,
remixContext: EntryContext
request: Request,
responseStatusCode: number,
responseHeaders: Headers,
remixContext: EntryContext,
) {
const markup = renderToString(
<RemixServer context={remixContext} url={request.url} />
);
const markup = renderToString(
<RemixServer context={remixContext} url={request.url} />,
)

responseHeaders.set("Content-Type", "text/html");
responseHeaders.set('Content-Type', 'text/html')

return new Response("<!DOCTYPE html>" + markup, {
status: responseStatusCode,
headers: responseHeaders
});
return new Response('<!DOCTYPE html>' + markup, {
status: responseStatusCode,
headers: responseHeaders,
})
}
55 changes: 29 additions & 26 deletions app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
import {
Links,
LiveReload,
Meta,
Outlet,
Scripts,
ScrollRestoration
} from "remix";
import type { MetaFunction } from "remix";
Links,
LiveReload,
Meta,
Outlet,
Scripts,
ScrollRestoration,
} from 'remix'
import type { MetaFunction } from 'remix'

export const meta: MetaFunction = () => {
return { title: "New Remix App" };
};
return { title: 'New Remix App' }
}

export default function App() {
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<Meta />
<Links />
</head>
<body>
<Outlet />
<ScrollRestoration />
<Scripts />
{process.env.NODE_ENV === "development" && <LiveReload />}
</body>
</html>
);
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta
name="viewport"
content="width=device-width,initial-scale=1"
/>
<Meta />
<Links />
</head>
<body>
<Outlet />
<ScrollRestoration />
<Scripts />
{process.env.NODE_ENV === 'development' && <LiveReload />}
</body>
</html>
)
}
31 changes: 1 addition & 30 deletions app/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,3 @@
export default function Index() {
return (
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
<h1>Welcome to Remix</h1>
<ul>
<li>
<a
target="_blank"
href="https://remix.run/tutorials/blog"
rel="noreferrer"
>
15m Quickstart Blog Tutorial
</a>
</li>
<li>
<a
target="_blank"
href="https://remix.run/tutorials/jokes"
rel="noreferrer"
>
Deep Dive Jokes App Tutorial
</a>
</li>
<li>
<a target="_blank" href="https://remix.run/docs" rel="noreferrer">
Remix Docs
</a>
</li>
</ul>
</div>
);
return <></>
}
12 changes: 6 additions & 6 deletions remix.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* @type {import('@remix-run/dev/config').AppConfig}
*/
module.exports = {
appDirectory: "app",
assetsBuildDirectory: "public/build",
publicPath: "/build/",
serverBuildDirectory: "api/_build",
ignoredRouteFiles: [".*"]
};
appDirectory: 'app',
assetsBuildDirectory: 'public/build',
publicPath: '/build/',
serverBuildDirectory: 'api/_build',
ignoredRouteFiles: ['.*'],
}
33 changes: 15 additions & 18 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
{
"include": [
"remix.env.d.ts", "**/*.ts", "**/*.tsx"],
"compilerOptions": {
"lib": ["DOM", "DOM.Iterable", "ES2019"],
"isolatedModules": true,
"esModuleInterop": true,
"jsx": "react-jsx",
"moduleResolution": "node",
"resolveJsonModule": true,
"target": "ES2019",
"strict": true,
"baseUrl": "./ArrayKnight",
"paths": {
"~/*": ["./app/*"]
"compilerOptions": {
"baseUrl": ".",
"esModuleInterop": true,
"isolatedModules": true,
"jsx": "react-jsx",
"lib": ["DOM", "DOM.Iterable", "ES2019"],
"moduleResolution": "node",
"noEmit": true,
"paths": {
"~/*": ["./app/*"]
},
"resolveJsonModule": true,
"strict": true,
"target": "ES2019"
},

// Remix takes care of building everything in `remix build`.
"noEmit": true
}
"include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"]
}