-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Logan McAnsh <logan@mcan.sh>
- Loading branch information
Showing
24 changed files
with
481 additions
and
165 deletions.
There are no files selected for viewing
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
12 changes: 12 additions & 0 deletions
12
examples/playground/vite.config.ts.timestamp-1731715104505-f49232386f5ef.mjs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// vite.config.ts | ||
import { vitePlugin as remix } from "file:///Users/lmcansh/remix-fastify/node_modules/.pnpm/@remix-run+dev@2.10.0_@remix-run+react@2.14.0_react-dom@19.0.0-rc-100dfd7dab-20240701_react@1_fdtw53wollluzaehojg7fjacfe/node_modules/@remix-run/dev/dist/index.js"; | ||
import { defineConfig } from "file:///Users/lmcansh/remix-fastify/node_modules/.pnpm/vite@5.4.9_@types+node@22.7.7_lightningcss@1.26.0/node_modules/vite/dist/node/index.js"; | ||
import tsconfigPaths from "file:///Users/lmcansh/remix-fastify/node_modules/.pnpm/vite-tsconfig-paths@5.0.1_typescript@5.6.3_vite@5.4.9_@types+node@22.7.7_lightningcss@1.26.0_/node_modules/vite-tsconfig-paths/dist/index.js"; | ||
import tailwindcss from "file:///Users/lmcansh/remix-fastify/node_modules/.pnpm/@tailwindcss+vite@4.0.0-alpha.28_vite@5.4.9_@types+node@22.7.7_lightningcss@1.26.0_/node_modules/@tailwindcss/vite/dist/index.mjs"; | ||
var vite_config_default = defineConfig({ | ||
plugins: [remix(), tsconfigPaths(), tailwindcss()] | ||
}); | ||
export { | ||
vite_config_default as default | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywK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U0FBUyxDQUFDLE1BQU0sR0FBRyxjQUFjLEdBQUcsWUFBWSxDQUFDO0FBQ25ELENBQUM7IiwKICAibmFtZXMiOiBbXQp9Cg== |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require("./dist/react-router"); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type * from "./dist/react-router"; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type * from "./dist/react-router"; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./dist/react-router"; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require("./dist/remix"); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type * from "./dist/remix"; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type * from "./dist/remix"; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./dist/remix"; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
export type { GetLoadContextFunction, RequestHandler } from "./server"; | ||
export { createRequestHandler } from "./server"; | ||
export { remixFastify } from "./plugin"; | ||
export type { RemixFastifyOptions } from "./plugin"; | ||
export type { | ||
GetLoadContextFunction, | ||
RequestHandler, | ||
RemixFastifyOptions, | ||
} from "./remix"; | ||
export { createRequestHandler, remixFastify } from "./remix"; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import fp from "fastify-plugin"; | ||
|
||
import type { HttpServer } from "../shared"; | ||
import type { AppLoadContext, ServerBuild } from "react-router"; | ||
import { createRequestHandler } from "../servers/react-router"; | ||
import { createPlugin, type PluginOptions } from "."; | ||
|
||
export type ReactRouterFastifyOptions = Omit< | ||
PluginOptions<HttpServer, AppLoadContext, ServerBuild>, | ||
"virtualModule" | ||
>; | ||
|
||
export const reactRouterFastify = fp<ReactRouterFastifyOptions>( | ||
async (fastify, options) => { | ||
let plugin = createPlugin( | ||
fastify, | ||
{ | ||
...options, | ||
virtualModule: "virtual:react-router/server-build", | ||
}, | ||
createRequestHandler, | ||
); | ||
return plugin(); | ||
}, | ||
{ | ||
// replaced with the package name during build | ||
name: process.env.__PACKAGE_NAME__, | ||
fastify: process.env.__FASTIFY_VERSION__, | ||
}, | ||
); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import fp from "fastify-plugin"; | ||
import type { AppLoadContext, ServerBuild } from "@remix-run/node"; | ||
|
||
import { createRequestHandler } from "../servers/remix"; | ||
import type { HttpServer } from "../shared"; | ||
import { createPlugin, type PluginOptions } from "."; | ||
|
||
export type RemixFastifyOptions = Omit< | ||
PluginOptions<HttpServer, AppLoadContext, ServerBuild>, | ||
"virtualModule" | ||
>; | ||
|
||
export const remixFastify = fp<RemixFastifyOptions>( | ||
async (fastify, options) => { | ||
let plugin = createPlugin( | ||
fastify, | ||
{ | ||
...options, | ||
virtualModule: "virtual:remix/server-build", | ||
}, | ||
createRequestHandler, | ||
); | ||
return plugin(); | ||
}, | ||
{ | ||
// replaced with the package name during build | ||
name: process.env.__PACKAGE_NAME__, | ||
fastify: process.env.__FASTIFY_VERSION__, | ||
}, | ||
); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { AppLoadContext } from "react-router"; | ||
import type { | ||
HttpServer, | ||
GetLoadContextFunction as SharedGetLoadContextFunction, | ||
} from "./shared"; | ||
export type { RequestHandler } from "./shared"; | ||
export { createRequestHandler } from "./servers/react-router"; | ||
export { reactRouterFastify } from "./plugins/react-router"; | ||
export type { ReactRouterFastifyOptions } from "./plugins/react-router"; | ||
|
||
export type GetLoadContextFunction<Server extends HttpServer> = | ||
SharedGetLoadContextFunction<Server, AppLoadContext>; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { AppLoadContext } from "@remix-run/node"; | ||
import type { | ||
HttpServer, | ||
GetLoadContextFunction as SharedGetLoadContextFunction, | ||
} from "./shared"; | ||
export type { RequestHandler } from "./shared"; | ||
export { createRequestHandler } from "./servers/remix"; | ||
export { remixFastify } from "./plugins/remix"; | ||
export type { RemixFastifyOptions } from "./plugins/remix"; | ||
|
||
export type GetLoadContextFunction<Server extends HttpServer> = | ||
SharedGetLoadContextFunction<Server, AppLoadContext>; |
Oops, something went wrong.