repo stringlengths 7 64 | file_url stringlengths 81 338 | file_path stringlengths 5 257 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:25:31 2026-01-05 01:50:38 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-remix-routes-option-adapter/__tests__/defineRoutes-test.ts | packages/react-router-remix-routes-option-adapter/__tests__/defineRoutes-test.ts | import { defineRoutes } from "../defineRoutes";
describe("defineRoutes", () => {
it("returns an array of routes", () => {
let routes = defineRoutes((route) => {
route("/", "routes/home.js");
route("inbox", "routes/inbox.js", () => {
route("/", "routes/inbox/index.js", { index: true });
... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-remix-routes-option-adapter/__tests__/routeManifestToRouteConfig-test.ts | packages/react-router-remix-routes-option-adapter/__tests__/routeManifestToRouteConfig-test.ts | import { route } from "@react-router/dev/routes";
import { routeManifestToRouteConfig } from "../manifest";
import { defineRoutes } from "../defineRoutes";
const clean = (obj: any) => cleanUndefined(cleanIds(obj));
const cleanUndefined = (obj: any) => JSON.parse(JSON.stringify(obj));
const cleanIds = (obj: any) =>
... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-express/server.ts | packages/react-router-express/server.ts | // IDK why this is needed when it's in the tsconfig..........
// YAY PROJECT REFERENCES!
/// <reference lib="DOM.Iterable" />
import type * as express from "express";
import type {
AppLoadContext,
ServerBuild,
UNSAFE_MiddlewareEnabled as MiddlewareEnabled,
RouterContextProvider,
} from "react-router";
import {... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-express/tsup.config.ts | packages/react-router-express/tsup.config.ts | import { defineConfig } from "tsup";
// @ts-ignore - out of scope
import { createBanner } from "../../build.utils.js";
import pkg from "./package.json";
const entry = ["index.ts"];
export default defineConfig([
{
clean: true,
entry,
format: ["cjs", "esm"],
outDir: "dist",
dts: true,
banner... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-express/index.ts | packages/react-router-express/index.ts | export type { GetLoadContextFunction, RequestHandler } from "./server";
export { createRequestHandler } from "./server";
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-express/__tests__/server-test.ts | packages/react-router-express/__tests__/server-test.ts | import { Readable } from "node:stream";
import { createRequestHandler as createRemixRequestHandler } from "react-router";
import { createReadableStreamFromReadable } from "@react-router/node";
import express from "express";
import { createRequest, createResponse } from "node-mocks-http";
import supertest from "supertes... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-fs-routes/flatRoutes.ts | packages/react-router-fs-routes/flatRoutes.ts | import fs from "node:fs";
import path from "node:path";
import { makeRe } from "minimatch";
import type { RouteManifest, RouteManifestEntry } from "./manifest";
import { normalizeSlashes } from "./normalizeSlashes";
export const routeModuleExts = [".js", ".jsx", ".ts", ".tsx", ".md", ".mdx"];
export let paramPrefixC... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-fs-routes/normalizeSlashes.ts | packages/react-router-fs-routes/normalizeSlashes.ts | import path from "node:path";
export function normalizeSlashes(file: string) {
return file.replaceAll(path.win32.sep, "/");
}
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-fs-routes/tsup.config.ts | packages/react-router-fs-routes/tsup.config.ts | import { defineConfig } from "tsup";
// @ts-ignore - out of scope
import { createBanner } from "../../build.utils.js";
import pkg from "./package.json";
const entry = ["index.ts"];
export default defineConfig([
{
clean: true,
entry,
format: ["cjs"],
outDir: "dist",
dts: true,
banner: {
... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-fs-routes/index.ts | packages/react-router-fs-routes/index.ts | import fs from "node:fs";
import path from "node:path";
import {
type RouteConfigEntry,
getAppDirectory,
} from "@react-router/dev/routes";
import { routeManifestToRouteConfig } from "./manifest";
import { flatRoutes as flatRoutesImpl } from "./flatRoutes";
import { normalizeSlashes } from "./normalizeSlashes";
/... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-fs-routes/manifest.ts | packages/react-router-fs-routes/manifest.ts | import type { RouteConfigEntry } from "@react-router/dev/routes";
export interface RouteManifestEntry {
path?: string;
index?: boolean;
caseSensitive?: boolean;
id: string;
parentId?: string;
file: string;
}
export interface RouteManifest {
[routeId: string]: RouteManifestEntry;
}
export function route... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-fs-routes/__tests__/flatRoutes-test.ts | packages/react-router-fs-routes/__tests__/flatRoutes-test.ts | import { mkdirSync, rmSync, writeFileSync } from "node:fs";
import os from "node:os";
import path from "node:path";
import type { RouteManifestEntry } from "../manifest";
import {
flatRoutes,
flatRoutesUniversal,
getRoutePathConflictErrorMessage,
getRouteIdConflictErrorMessage,
getRouteSegments,
} from "../... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-fs-routes/__tests__/routeManifestToRouteConfig-test.ts | packages/react-router-fs-routes/__tests__/routeManifestToRouteConfig-test.ts | import { route } from "@react-router/dev/routes";
import { routeManifestToRouteConfig } from "../manifest";
const clean = (obj: any) => cleanUndefined(cleanIds(obj));
const cleanUndefined = (obj: any) => JSON.parse(JSON.stringify(obj));
const cleanIds = (obj: any) =>
JSON.parse(
JSON.stringify(obj, function r... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/prompts-select.ts | packages/create-react-router/prompts-select.ts | /**
* Adapted from https://github.com/withastro/cli-kit
* @license MIT License Copyright (c) 2022 Nate Moore
*/
import { cursor, erase } from "sisteransi";
import { Prompt, type PromptOptions } from "./prompts-prompt-base";
import { color, strip, clear, shouldUseAscii, type ActionKey } from "./utils";
export inter... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/loading-indicator.ts | packages/create-react-router/loading-indicator.ts | // Adapted from https://github.com/withastro/cli-kit
// MIT License Copyright (c) 2022 Nate Moore
import process from "node:process";
import readline from "node:readline";
import { erase, cursor } from "sisteransi";
import { reverse, sleep, color } from "./utils";
const GRADIENT_COLORS: Array<`#${string}`> = [
"#ff... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/utils.ts | packages/create-react-router/utils.ts | import fs from "node:fs";
import { readdir } from "node:fs/promises";
import path from "node:path";
import process from "node:process";
import os from "node:os";
import { type Key as ActionKey } from "node:readline";
import { erase, cursor } from "sisteransi";
import chalk from "chalk";
// https://no-color.org/
const ... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/prompts-prompt-base.ts | packages/create-react-router/prompts-prompt-base.ts | /**
* Adapted from https://github.com/withastro/cli-kit
* @license MIT License Copyright (c) 2022 Nate Moore
*/
import process from "node:process";
import EventEmitter from "node:events";
import readline from "node:readline";
import { beep, cursor } from "sisteransi";
import { color, action, type ActionKey } from "... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/cli.ts | packages/create-react-router/cli.ts | #!/usr/bin/env node
import process from "node:process";
import { createReactRouter } from "./index";
process.on("SIGINT", () => process.exit(0));
process.on("SIGTERM", () => process.exit(0));
let argv = process.argv.slice(2).filter((arg) => arg !== "--");
createReactRouter(argv).then(
() => process.exit(0),
() ... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/prompts-confirm.ts | packages/create-react-router/prompts-confirm.ts | /**
* Adapted from https://github.com/withastro/cli-kit
* @license MIT License Copyright (c) 2022 Nate Moore
*/
import { cursor, erase } from "sisteransi";
import { Prompt, type PromptOptions } from "./prompts-prompt-base";
import { color, strip, clear, type ActionKey } from "./utils";
export interface ConfirmProm... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/prompts-text.ts | packages/create-react-router/prompts-text.ts | /**
* Adapted from https://github.com/withastro/cli-kit
* @license MIT License Copyright (c) 2022 Nate Moore
*/
import { cursor, erase } from "sisteransi";
import { Prompt, type PromptOptions } from "./prompts-prompt-base";
import {
color,
strip,
clear,
lines,
shouldUseAscii,
type ActionKey,
} from "./u... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/prompts-multi-select.ts | packages/create-react-router/prompts-multi-select.ts | /**
* Adapted from https://github.com/withastro/cli-kit
* @license MIT License Copyright (c) 2022 Nate Moore
*/
import { cursor, erase } from "sisteransi";
import { Prompt, type PromptOptions } from "./prompts-prompt-base";
import { type SelectChoice } from "./prompts-select";
import { color, strip, clear, type Act... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/tsup.config.ts | packages/create-react-router/tsup.config.ts | import { defineConfig } from "tsup";
// @ts-ignore - out of scope
import { createBanner } from "../../build.utils.js";
import pkg from "./package.json";
const entry = ["cli.ts"];
export default defineConfig([
{
clean: true,
entry,
format: ["cjs"],
outDir: "dist",
dts: true,
banner: {
... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/index.ts | packages/create-react-router/index.ts | import process from "node:process";
import { existsSync } from "node:fs";
import { cp, readFile, realpath, writeFile } from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import stripAnsi from "strip-ansi";
import execa from "execa";
import arg from "arg";
import * as semver from "semver";
... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/prompt.ts | packages/create-react-router/prompt.ts | // Adapted from https://github.com/withastro/cli-kit
// MIT License Copyright (c) 2022 Nate Moore
// https://github.com/withastro/cli-kit/tree/main/src/prompt
import process from "node:process";
import { ConfirmPrompt, type ConfirmPromptOptions } from "./prompts-confirm";
import {
SelectPrompt,
type SelectPromptOp... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/copy-template.ts | packages/create-react-router/copy-template.ts | import process from "node:process";
import url from "node:url";
import fs from "node:fs";
import path from "node:path";
import stream from "node:stream";
import { promisify } from "node:util";
import { fetch } from "@remix-run/web-fetch";
import gunzip from "gunzip-maybe";
import tar from "tar-fs";
import { ProxyAgent ... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/__tests__/setupAfterEnv.ts | packages/create-react-router/__tests__/setupAfterEnv.ts | export let jestTimeout = process.platform === "win32" ? 20_000 : 10_000;
jest.setTimeout(jestTimeout);
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/__tests__/msw.ts | packages/create-react-router/__tests__/msw.ts | import path from "node:path";
import fsp from "node:fs/promises";
import { setupServer } from "msw/node";
import { http, type RequestHandler } from "msw";
import { githubHandlers } from "./github-mocks";
let miscHandlers: Array<RequestHandler> = [
http.get("https://registry.npmjs.org/react-router/latest", () => {
... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/__tests__/msw-register.ts | packages/create-react-router/__tests__/msw-register.ts | import process from "node:process";
import { server } from "./msw";
server.listen({ onUnhandledRequest: "error" });
process.on("exit", () => {
server.close();
});
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/__tests__/github-mocks.ts | packages/create-react-router/__tests__/github-mocks.ts | import fsp from "node:fs/promises";
import * as path from "node:path";
import { http } from "msw";
import type { setupServer } from "msw/node";
import invariant from "tiny-invariant";
type RequestHandler = Parameters<typeof setupServer>[0];
async function isDirectory(d: string) {
try {
return (await fsp.lstat(d... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/__tests__/create-react-router-test.ts | packages/create-react-router/__tests__/create-react-router-test.ts | import type { ChildProcessWithoutNullStreams } from "node:child_process";
import { spawn } from "node:child_process";
import {
existsSync,
mkdirSync,
readFileSync,
realpathSync,
rmSync,
writeFileSync,
} from "node:fs";
import { mkdir, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import pa... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | true |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/__tests__/fixtures/basic/vite.config.ts | packages/create-react-router/__tests__/fixtures/basic/vite.config.ts | import { reactRouter } from "@react-router/dev/vite";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [reactRouter()],
});
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/__tests__/fixtures/basic/app/routes.ts | packages/create-react-router/__tests__/fixtures/basic/app/routes.ts | import type { RouteConfig } from "@react-router/dev/routes";
import { index } from "@react-router/dev/routes";
export default [index("routes/home.tsx")] satisfies RouteConfig;
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/__tests__/fixtures/basic/app/root.tsx | packages/create-react-router/__tests__/fixtures/basic/app/root.tsx | import { Links, Meta, Outlet, Scripts, ScrollRestoration } from "react-router";
export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<Met... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/create-react-router/__tests__/fixtures/basic/app/routes/home.tsx | packages/create-react-router/__tests__/fixtures/basic/app/routes/home.tsx | import type { MetaFunction } from "react-router";
export const meta: MetaFunction = () => {
return [
{ title: "New React Router App" },
{ name: "description", content: "Welcome to React Router!" },
];
};
export default function Index() {
return <h1>Welcome to React Router</h1>;
}
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-serve/cli.ts | packages/react-router-serve/cli.ts | #!/usr/bin/env node
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import url from "node:url";
import type { ServerBuild } from "react-router";
import { createRequestHandler } from "@react-router/express";
import { createRequestListener } from "@mjackson/node-fetch-server";
import com... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-serve/tsup.config.ts | packages/react-router-serve/tsup.config.ts | import { defineConfig } from "tsup";
// @ts-ignore - out of scope
import { createBanner } from "../../build.utils.js";
import pkg from "./package.json";
const entry = ["cli.ts"];
export default defineConfig([
{
clean: true,
entry,
format: ["cjs"],
outDir: "dist",
dts: true,
banner: {
... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/split-route-modules-spa/react-router.config.ts | playground/split-route-modules-spa/react-router.config.ts | import type { Config } from "@react-router/dev/config";
export default {
ssr: false,
future: {
v8_splitRouteModules: true,
},
} satisfies Config;
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/split-route-modules-spa/vite.config.ts | playground/split-route-modules-spa/vite.config.ts | import { reactRouter } from "@react-router/dev/vite";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
export default defineConfig({
plugins: [reactRouter(), tsconfigPaths()],
});
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/split-route-modules-spa/app/routes.ts | playground/split-route-modules-spa/app/routes.ts | import { type RouteConfig, index, route } from "@react-router/dev/routes";
export default [
index("routes/_index.tsx"),
route("splittable", "routes/splittable.tsx"),
route("unsplittable", "routes/unsplittable.tsx"),
route("semi-splittable", "routes/semi-splittable.tsx"),
] satisfies RouteConfig;
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/split-route-modules-spa/app/root.tsx | playground/split-route-modules-spa/app/root.tsx | import { Links, Meta, Outlet, Scripts, ScrollRestoration } from "react-router";
export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<Met... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/split-route-modules-spa/app/routes/splittable.tsx | playground/split-route-modules-spa/app/routes/splittable.tsx | import type { Route } from "./+types/splittable";
import { Form } from "react-router";
export const clientLoader = async () => {
await new Promise((resolve) => setTimeout(resolve, 1000));
return "Hello from splittable client loader";
};
export const clientAction = async () => {
await new Promise((resolve) => se... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/split-route-modules-spa/app/routes/unsplittable.tsx | playground/split-route-modules-spa/app/routes/unsplittable.tsx | import type { Route } from "./+types/unsplittable";
import { Form } from "react-router";
// Dummy variable to prevent route exports from being split
let shared: null = null;
export const clientLoader = async () => {
await new Promise((resolve) => setTimeout(resolve, 1000));
return shared ?? "Hello from unsplittab... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/split-route-modules-spa/app/routes/_index.tsx | playground/split-route-modules-spa/app/routes/_index.tsx | import { Link, type MetaFunction } from "react-router";
export const meta: MetaFunction = () => {
return [
{ title: "New React Router App" },
{ name: "description", content: "Welcome to React Router!" },
];
};
export default function Index() {
return (
<div style={{ fontFamily: "system-ui, sans-seri... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/split-route-modules-spa/app/routes/semi-splittable.tsx | playground/split-route-modules-spa/app/routes/semi-splittable.tsx | import type { Route } from "./+types/semi-splittable";
import { Form } from "react-router";
// Dummy variable to prevent route exports from being split
let shared: null = null;
export const clientLoader = async () => {
await new Promise((resolve) => setTimeout(resolve, 1000));
return shared ?? "Hello from unsplit... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite/vite.config.ts | playground/rsc-vite/vite.config.ts | import rsc from "@vitejs/plugin-rsc";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [
react(),
rsc({
entries: {
client: "src/entry.browser.tsx",
rsc: "src/entry.rsc.tsx",
ssr: "src/entry.ssr.tsx",
},
... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite/src/entry.ssr.tsx | playground/rsc-vite/src/entry.ssr.tsx | import { createFromReadableStream } from "@vitejs/plugin-rsc/ssr";
// @ts-expect-error
import * as ReactDomServer from "react-dom/server.edge";
import {
unstable_RSCStaticRouter as RSCStaticRouter,
unstable_routeRSCServerRequest as routeRSCServerRequest,
} from "react-router";
export default async function handler... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite/src/routes.ts | playground/rsc-vite/src/routes.ts | import type { unstable_RSCRouteConfig as RSCRouteConfig } from "react-router";
export const routes = [
{
id: "root",
path: "",
lazy: () => import("./routes/root/root"),
children: [
{
id: "home",
index: true,
lazy: () => import("./routes/home/home"),
},
{
... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite/src/entry.rsc.tsx | playground/rsc-vite/src/entry.rsc.tsx | import {
createTemporaryReferenceSet,
decodeAction,
decodeFormState,
decodeReply,
loadServerAction,
renderToReadableStream,
} from "@vitejs/plugin-rsc/rsc";
import { unstable_matchRSCServerRequest as matchRSCServerRequest } from "react-router";
import { routes } from "./routes";
export async function fetc... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite/src/entry.browser.tsx | playground/rsc-vite/src/entry.browser.tsx | import { startTransition, StrictMode } from "react";
import { hydrateRoot } from "react-dom/client";
import {
createFromReadableStream,
createTemporaryReferenceSet,
encodeReply,
setServerCallback,
} from "@vitejs/plugin-rsc/browser";
import {
unstable_createCallServer as createCallServer,
unstable_getRSCStr... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite/src/counter.tsx | playground/rsc-vite/src/counter.tsx | "use client";
import { useState } from "react";
export function Counter() {
const [count, setCount] = useState(0);
return (
<div>
<h1>Counter</h1>
<p>Current count: {count}</p>
<button type="button" onClick={() => setCount(count + 1)}>
Increment
</button>
</div>
);
}
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite/src/routes/redirect.ts | playground/rsc-vite/src/routes/redirect.ts | import { redirectDocument } from "react-router";
export function loader() {
throw redirectDocument("/about?redirected");
}
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite/src/routes/render-redirects.tsx | playground/rsc-vite/src/routes/render-redirects.tsx | import { Link, redirect } from "react-router";
export default function RenderRedirect({
params: { id },
}: {
params: { id?: string };
}) {
if (id === "redirect") {
throw redirect("/render-redirect/redirected");
}
if (id === "external") {
throw redirect("https://example.com/");
}
return (
<>... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite/src/routes/root/root.client.tsx | playground/rsc-vite/src/routes/root/root.client.tsx | "use client";
import {
useRouteError,
useNavigation,
isRouteErrorResponse,
Outlet,
ScrollRestoration,
Link,
Links,
} from "react-router";
import { Counter } from "../../counter";
import type { loader } from "./root";
export default function RootRoute({
loaderData,
}: {
loaderData: Awaited<ReturnType... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite/src/routes/root/root.tsx | playground/rsc-vite/src/routes/root/root.tsx | // import { Link, Links, Outlet, ScrollRestoration } from "react-router";
import { type MiddlewareFunction } from "react-router";
import { Counter } from "../../counter";
// import { ErrorReporter, NavigationState } from "./root.client";
import "./root.css";
export {
shouldRevalidate,
default,
ErrorBoundary,
... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite/src/routes/about/about.client.tsx | playground/rsc-vite/src/routes/about/about.client.tsx | "use client";
import {
type ClientLoaderFunctionArgs,
useLoaderData,
useRouteError,
Form,
useActionData,
type ClientActionFunctionArgs,
isRouteErrorResponse,
} from "react-router";
import { Counter } from "../../counter";
import type { action, loader } from "./about";
export async function clientActio... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite/src/routes/about/about.tsx | playground/rsc-vite/src/routes/about/about.tsx | import { data } from "react-router";
export {
ErrorBoundary,
// clientLazy,
clientLoader,
clientAction,
default,
} from "./about.client";
export function headers({
parentHeaders,
loaderHeaders,
}: {
parentHeaders: Headers;
loaderHeaders: Headers;
}) {
let headers = new Headers(parentHeaders);
lo... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite/src/routes/home/home.client.tsx | playground/rsc-vite/src/routes/home/home.client.tsx | "use client";
import * as React from "react";
import { type ClientLoaderFunctionArgs, useLoaderData } from "react-router";
import { Counter } from "../../counter";
import "./home.client.css";
import type { loader } from "./home";
export async function clientLoader({ serverLoader }: ClientLoaderFunctionArgs) {
con... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite/src/routes/home/home.tsx | playground/rsc-vite/src/routes/home/home.tsx | import { HomeForm, RedirectForm } from "./home.client";
export { clientLoader } from "./home.client";
import { Counter } from "../../counter";
import { redirect } from "react-router";
import type { LoaderFunctionArgs } from "react-router";
import "./home.css";
export async function loader({ request }: LoaderFunction... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite/src/routes/child/child.tsx | playground/rsc-vite/src/routes/child/child.tsx | async function loader() {
await new Promise((r) => setTimeout(r, 500));
return {
message: `Child route loader ran at ${new Date().toISOString()}`,
};
}
export async function Component() {
let loaderData = await loader();
return (
<div style={{ border: "1px solid black", padding: "10px" }}>
<h3>... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite/src/routes/parent-index/parent-index.tsx | playground/rsc-vite/src/routes/parent-index/parent-index.tsx | export async function loader() {
await new Promise((r) => setTimeout(r, 500));
return {
message: `Parent Index route loader ran at ${new Date().toISOString()}`,
};
}
export default function ParentIndexRoute({
loaderData,
}: {
loaderData: Awaited<ReturnType<typeof loader>>;
}) {
return (
<div style=... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite/src/routes/parent/parent.tsx | playground/rsc-vite/src/routes/parent/parent.tsx | import { Outlet } from "react-router";
export function loader() {
return {
message: `Parent route loader ran at ${new Date().toISOString()}`,
};
}
export default function ParentRoute({
loaderData,
}: {
loaderData: Awaited<ReturnType<typeof loader>>;
}) {
return (
<div style={{ border: "1px solid bla... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/middleware/react-router.config.ts | playground/middleware/react-router.config.ts | import type { Config } from "@react-router/dev/config";
export default {
future: {
v8_middleware: true,
v8_splitRouteModules: true,
},
} satisfies Config;
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/middleware/dev-server.ts | playground/middleware/dev-server.ts | import express from "express";
const PORT = Number.parseInt(process.env.PORT || "3000");
const app = express();
console.log("Starting development server");
const viteDevServer = await import("vite").then((vite) =>
vite.createServer({
server: { middlewareMode: true },
forceOptimizeDeps: process.argv.include... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/middleware/server.ts | playground/middleware/server.ts | import { createRequestHandler } from "@react-router/express";
import compression from "compression";
import express from "express";
import morgan from "morgan";
import "react-router";
import { RouterContextProvider } from "react-router";
import { expressContext } from "~/contexts";
export const app = express();
app.us... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/middleware/vite.config.ts | playground/middleware/vite.config.ts | import { reactRouter } from "@react-router/dev/vite";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
export default defineConfig(({ isSsrBuild }) => ({
build: {
minify: false,
rollupOptions: isSsrBuild
? {
input: "./server.ts",
}
: undefine... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/middleware/app/contexts.ts | playground/middleware/app/contexts.ts | import { createContext } from "react-router";
export const expressContext = createContext<string>("default");
export const rootContext = createContext<string>();
export const aContext = createContext<string>();
export const bContext = createContext<string>("empty");
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/middleware/app/routes.ts | playground/middleware/app/routes.ts | import type { RouteConfig } from "@react-router/dev/routes";
import { flatRoutes } from "@react-router/fs-routes";
export default flatRoutes() satisfies RouteConfig;
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/middleware/app/root.tsx | playground/middleware/app/root.tsx | import {
Link,
Links,
Meta,
Outlet,
Scripts,
ScrollRestoration,
} from "react-router";
import type { Route } from "./+types/root";
import { rootContext } from "./contexts";
export const middleware: Route.MiddlewareFunction[] = [
async ({ context }, next) => {
console.log("start root middleware");
... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/middleware/app/routes/server.a.tsx | playground/middleware/app/routes/server.a.tsx | import { Outlet, createContext } from "react-router";
import type { Route } from "./+types/server.a";
import { aContext, expressContext, rootContext } from "~/contexts";
export const middleware: Route.MiddlewareFunction[] = [
async ({ context }, next) => {
console.log("start a middleware");
context.set(aCont... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/middleware/app/routes/client.a.b.tsx | playground/middleware/app/routes/client.a.b.tsx | import { Outlet, createContext } from "react-router";
import type { Route } from "./+types/client.a.b";
import { aContext, bContext, rootContext } from "~/contexts";
export const clientMiddleware: Route.ClientMiddlewareFunction[] = [
async ({ context }, next) => {
console.log("start b middleware");
context.s... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/middleware/app/routes/server.a.b.tsx | playground/middleware/app/routes/server.a.b.tsx | import { Outlet, createContext } from "react-router";
import type { Route } from "./+types/server.a.b";
import { aContext, bContext, expressContext, rootContext } from "~/contexts";
export const middleware: Route.MiddlewareFunction[] = [
async ({ context }, next) => {
console.log("start b middleware");
conte... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/middleware/app/routes/_index.tsx | playground/middleware/app/routes/_index.tsx | import type { Route } from "./+types/_index";
export default function Index({}: Route.ComponentProps) {
return <></>;
}
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/middleware/app/routes/client.a.tsx | playground/middleware/app/routes/client.a.tsx | import { Outlet } from "react-router";
import type { Route } from "./+types/client.a";
import { aContext, rootContext } from "~/contexts";
export const clientMiddleware: Route.ClientMiddlewareFunction[] = [
async ({ context }, next) => {
console.log("start a middleware");
context.set(aContext, "A");
awai... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/framework-rolldown-vite/react-router.config.ts | playground/framework-rolldown-vite/react-router.config.ts | import type { Config } from "@react-router/dev/config";
export default {} satisfies Config;
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/framework-rolldown-vite/vite.config.ts | playground/framework-rolldown-vite/vite.config.ts | import { reactRouter } from "@react-router/dev/vite";
import { defineConfig, type UserConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
export default defineConfig(({ isSsrBuild }) => {
const config: UserConfig = {
plugins: [
// @ts-expect-error `dev` depends on Vite 6, Plugin type is ... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/framework-rolldown-vite/app/routes.ts | playground/framework-rolldown-vite/app/routes.ts | import { type RouteConfig, index, route } from "@react-router/dev/routes";
export default [
index("routes/_index.tsx"),
route("products/:id", "routes/product.tsx"),
] satisfies RouteConfig;
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/framework-rolldown-vite/app/root.tsx | playground/framework-rolldown-vite/app/root.tsx | import { Links, Meta, Outlet, Scripts, ScrollRestoration } from "react-router";
export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<Met... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/framework-rolldown-vite/app/routes/product.tsx | playground/framework-rolldown-vite/app/routes/product.tsx | import type { Route } from "./+types/product";
export function loader({ params }: Route.LoaderArgs) {
return { name: `Super cool product #${params.id}` };
}
export default function Component({ loaderData }: Route.ComponentProps) {
return <h1>{loaderData.name}</h1>;
}
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/framework-rolldown-vite/app/routes/_index.tsx | playground/framework-rolldown-vite/app/routes/_index.tsx | import type { Route } from "./+types/_index";
export function loader({ params }: Route.LoaderArgs) {
return { planet: "world", date: new Date(), fn: () => 1 };
}
export default function Index({ loaderData }: Route.ComponentProps) {
return <h1>Hello, {loaderData.planet}!</h1>;
}
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/react-router.config.ts | playground/rsc-vite-framework/react-router.config.ts | import type { Config } from "@react-router/dev/config";
export default {} satisfies Config;
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/mdx.d.ts | playground/rsc-vite-framework/mdx.d.ts | declare module "*.mdx" {
export default (...args: any[]) => unknown;
}
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/vite.config.ts | playground/rsc-vite-framework/vite.config.ts | import { defineConfig } from "vite";
import { unstable_reactRouterRSC as reactRouterRSC } from "@react-router/dev/vite";
import rsc from "@vitejs/plugin-rsc";
import mdx from "@mdx-js/rollup";
import remarkFrontmatter from "remark-frontmatter";
import remarkMdxFrontmatter from "remark-mdx-frontmatter";
export default ... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/app/routes.ts | playground/rsc-vite-framework/app/routes.ts | import { type RouteConfig } from "@react-router/dev/routes";
import { flatRoutes } from "@react-router/fs-routes";
export default flatRoutes() satisfies RouteConfig;
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/app/entry.ssr.ts | playground/rsc-vite-framework/app/entry.ssr.ts | import { generateHTML as defaultGenerateHTML } from "@react-router/dev/config/default-rsc-entries/entry.ssr";
export function generateHTML(request: Request, serverResponse: Response) {
console.log("custom entry.ssr");
return defaultGenerateHTML(request, serverResponse);
}
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/app/root.tsx | playground/rsc-vite-framework/app/root.tsx | import type { Route } from "./+types/root";
import { Meta, Link, Outlet, isRouteErrorResponse } from "react-router";
import "./root.css";
export const meta = () => [{ title: "React Router Vite" }];
export function Layout({ children }: { children: React.ReactNode }) {
console.log("Layout");
return (
<html lan... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/app/entry.rsc.ts | playground/rsc-vite-framework/app/entry.rsc.ts | import defaultEntry from "@react-router/dev/config/default-rsc-entries/entry.rsc";
import { RouterContextProvider } from "react-router";
export default {
fetch(request: Request) {
console.log("custom entry.rsc");
const requestContext = new RouterContextProvider();
return defaultEntry.fetch(request, req... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/app/routes/optimistic/form.tsx | playground/rsc-vite-framework/app/routes/optimistic/form.tsx | "use client";
import {
// @ts-expect-error React types for the repo are set to v18
useOptimistic,
} from "react";
import { useHydrated } from "remix-utils/use-hydrated";
export function ToggleLikedForm({
liked,
toggleLikedAction,
}: {
liked: boolean;
toggleLikedAction: () => Promise<void>;
}) {
const hy... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/app/routes/optimistic/actions.ts | playground/rsc-vite-framework/app/routes/optimistic/actions.ts | "use server";
import { toggleLiked } from "./liked";
export async function toggleLikedAction() {
await new Promise((resolve) => setTimeout(resolve, 1000));
toggleLiked();
}
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/app/routes/optimistic/liked.ts | playground/rsc-vite-framework/app/routes/optimistic/liked.ts | let liked = false;
export function getLiked() {
return liked;
}
export function toggleLiked() {
liked = !liked;
}
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/app/routes/optimistic/route.tsx | playground/rsc-vite-framework/app/routes/optimistic/route.tsx | import { ToggleLikedForm } from "./form";
import { getLiked } from "./liked";
import { toggleLikedAction } from "./actions";
export function ServerComponent() {
return (
<div>
<h1>Server Component</h1>
<ToggleLikedForm
liked={getLiked()}
toggleLikedAction={toggleLikedAction}
/>
... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/app/routes/fixture.client-component/route.tsx | playground/rsc-vite-framework/app/routes/fixture.client-component/route.tsx | import type { Route } from "./+types/route";
export function loader() {
return {
message: <p>From the loader.</p>,
};
}
export default function ClientComponent({ loaderData }: Route.ComponentProps) {
return (
<div>
<h1>Client Component</h1>
{loaderData.message}
</div>
);
}
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/app/routes/client-loader-without-server-loader/route.tsx | playground/rsc-vite-framework/app/routes/client-loader-without-server-loader/route.tsx | import type { Route } from "./+types/route";
export function clientLoader() {
return "hello, world from client loader";
}
export default function ClientLoaderWithoutServerLoaderRoute({
loaderData,
}: Route.ComponentProps) {
return (
<main>
<h1>Client loader without server loader</h1>
<p>Loader d... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/app/routes/mdx-glob._index/route.tsx | playground/rsc-vite-framework/app/routes/mdx-glob._index/route.tsx | import { Link } from "react-router";
import { getPosts } from "../mdx-glob.$post/posts/posts";
export async function ServerComponent() {
const posts = await getPosts();
return (
<>
<h1>MDX glob</h1>
<ul>
{Object.values(posts).map(({ path, title }) => (
<li key={path}>
... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/app/routes/mdx/message.tsx | playground/rsc-vite-framework/app/routes/mdx/message.tsx | import { useLoaderData } from "react-router";
export function Message() {
const { message } = useLoaderData();
return <div>Loader data: {message}</div>;
}
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/app/routes/client-loader/route.tsx | playground/rsc-vite-framework/app/routes/client-loader/route.tsx | import type { Route } from "./+types/route";
import styles from "./styles.module.css";
export function loader() {
return "hello, world from server loader";
}
export function clientLoader() {
return "hello, world from client loader";
}
export default function ClientLoaderRoute({
loaderData,
}: Route.ComponentP... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/app/routes/fixture.server-component/route.tsx | playground/rsc-vite-framework/app/routes/fixture.server-component/route.tsx | import type { Route } from "./+types/route";
export function loader() {
return {
message: <p key="loader">From the loader.</p>,
};
}
export async function ServerComponent({ loaderData }: Route.ComponentProps) {
const message = await Promise.resolve("From the component.");
return (
<div>
<h1>Clie... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/app/routes/_index/actions.ts | playground/rsc-vite-framework/app/routes/_index/actions.ts | "use server";
export async function log() {
console.log("hello from server");
}
| typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/app/routes/_index/route.tsx | playground/rsc-vite-framework/app/routes/_index/route.tsx | import type { Route } from "./+types/route";
import { log } from "./actions";
import "./styles.css";
export function loader({}: Route.LoaderArgs) {
return "hello, world";
}
export function ServerComponent({ loaderData }: Route.ComponentProps) {
return (
<main>
<h1 className="home__heading">Home</h1>
... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/app/routes/server-loader/route.tsx | playground/rsc-vite-framework/app/routes/server-loader/route.tsx | import type { Route } from "./+types/route";
import styles from "./styles.module.css";
export function loader() {
return "hello, world from server loader";
}
export default function ServerLoaderRoute({
loaderData,
}: Route.ComponentProps) {
return (
<main>
<h1 className={styles.heading}>Server loader<... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
remix-run/react-router | https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/playground/rsc-vite-framework/app/routes/mdx-glob.$post/route.tsx | playground/rsc-vite-framework/app/routes/mdx-glob.$post/route.tsx | import type { Route } from "./+types/route";
import { getPost } from "./posts/posts";
export async function loader({ params }: Route.LoaderArgs) {
const post = await getPost(params.post);
if (!post) {
throw new Response("Not Found", { status: 404, statusText: "Not Found" });
}
return {
title: post.ti... | typescript | MIT | aaa150616e619efc8d26c092e8625962c2fb4246 | 2026-01-04T15:29:26.871957Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.