This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type PerformanceServerTimings = Record< | |
string, | |
Array<PerformanceServerTiming> | |
> | |
/** | |
* Run this on the server to get a `time` function that can be used to time | |
* server-side operations and add them to the `Server-Timing` header. | |
*/ | |
export function getServerTiming() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createRequestHandler } from "./streaming-lambda.ts"; | |
import * as build from "@remix-run/dev/server-build"; | |
export const handler = awslambda.streamifyResponse( | |
createRequestHandler({ | |
build, | |
mode: process.env.NODE_ENV, | |
}) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { V2_HtmlMetaDescriptor, V2_MetaFunction } from "@remix-run/node"; | |
export const mergeMeta = ( | |
overrideFn: V2_MetaFunction, | |
appendFn?: V2_MetaFunction, | |
): V2_MetaFunction => { | |
return arg => { | |
// get meta from parent routes | |
let mergedMeta = arg.matches.reduce((acc, match) => { | |
return acc.concat(match.meta || []); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createHash } from "crypto"; | |
import fs from "fs"; | |
import fsp from "fs/promises"; | |
import path from "path"; | |
import https from "https"; | |
import { PassThrough } from "stream"; | |
import type { Readable } from "stream"; | |
import type { LoaderFunction } from "remix"; | |
import sharp from "sharp"; | |
import type { Request as NodeRequest } from "@remix-run/node"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import path from "node:path"; | |
import fse from "fs-extra"; | |
import svgstore from "svgstore"; | |
import { glob } from "glob"; | |
import prettier from "prettier"; | |
let HEROICONS_PATH = path.join(process.cwd(), "node_modules/heroicons"); | |
let ASSETS_PATH = path.join(process.cwd(), "assets"); | |
let OUTFILE = path.join(process.cwd(), "app/components/sprite/index.svg"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { | |
ActionFunction, | |
LinksFunction, | |
LoaderFunction, | |
MetaFunction | |
} from "@remix-run/react"; | |
import { | |
Meta, | |
Links, | |
Scripts, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { | |
VercelRequest as IVercelRequest, | |
VercelRequestBody, | |
VercelRequestCookies, | |
VercelRequestQuery | |
} from '@vercel/node' | |
import isUndefined from 'lodash/isUndefined' | |
import omit from 'lodash/omit' | |
import type { MockRequestOptions } from 'mock-http' | |
import { Request } from 'mock-http' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "remove-ts", | |
"version": "1.0.0", | |
"description": "I use this to automatically fix feedback links in my workshops", | |
"bin": "./remove-ts.js", | |
"dependencies": { | |
"@babel/core": "7.13.8", | |
"@babel/preset-typescript": "7.13.0", | |
"glob": "7.1.6" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ReactDOMServer from "react-dom/server"; | |
import type { EntryContext } from "@remix-run/core"; | |
import Remix from "@remix-run/react/server"; | |
import { renderToString } from "react-dom/server"; | |
import { ServerStyleSheet } from "styled-components"; | |
import StylesContext from "./stylesContext"; | |
export default function handleRequest( | |
request: Request, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The Anatomy of a Remix Route | |
*/ | |
import { parseFormBody, json, redirect } from "@remix-run/data"; | |
import { | |
Form, | |
useRouteData, | |
usePendingFormSubmit, | |
preload, | |
} from "@remix-run/react"; |
NewerOlder