diff --git a/integration/cf-compiler-test.ts b/integration/cf-compiler-test.ts
index 39e20139e9d..10b0cd89e09 100644
--- a/integration/cf-compiler-test.ts
+++ b/integration/cf-compiler-test.ts
@@ -34,11 +34,10 @@ test.describe("cloudflare compiler", () => {
name: "remix-template-cloudflare-workers",
private: true,
sideEffects: false,
- main: "build/index.js",
type: "module",
dependencies: {
+ "@cloudflare/kv-asset-handler": "0.0.0-local-version",
"@remix-run/cloudflare": "0.0.0-local-version",
- "@remix-run/cloudflare-workers": "0.0.0-local-version",
"@remix-run/react": "0.0.0-local-version",
isbot: "0.0.0-local-version",
react: "0.0.0-local-version",
@@ -50,7 +49,6 @@ test.describe("cloudflare compiler", () => {
},
devDependencies: {
"@remix-run/dev": "0.0.0-local-version",
- "@remix-run/eslint-config": "0.0.0-local-version",
},
}),
"app/routes/_index.tsx": js`
diff --git a/integration/deno-compiler-test.ts b/integration/deno-compiler-test.ts
index 506fabf6f62..d0580ddcfe1 100644
--- a/integration/deno-compiler-test.ts
+++ b/integration/deno-compiler-test.ts
@@ -37,6 +37,7 @@ test.beforeAll(async () => {
template: "deno-template",
files: {
"package.json": json({
+ name: "remix-template-deno",
private: true,
sideEffects: false,
type: "module",
diff --git a/integration/helpers/cf-template/app/root.tsx b/integration/helpers/cf-template/app/root.tsx
index 1f082523e7b..0294fbd3907 100644
--- a/integration/helpers/cf-template/app/root.tsx
+++ b/integration/helpers/cf-template/app/root.tsx
@@ -1,3 +1,5 @@
+import type { LinksFunction } from "@remix-run/cloudflare";
+import { cssBundleHref } from "@remix-run/css-bundle";
import {
Links,
LiveReload,
@@ -7,6 +9,10 @@ import {
ScrollRestoration,
} from "@remix-run/react";
+export const links: LinksFunction = () => [
+ ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
+];
+
export default function App() {
return (
diff --git a/packages/remix-dev/__tests__/fixtures/cloudflare/app/routes/index.tsx b/integration/helpers/cf-template/app/routes/_index.tsx
similarity index 78%
rename from packages/remix-dev/__tests__/fixtures/cloudflare/app/routes/index.tsx
rename to integration/helpers/cf-template/app/routes/_index.tsx
index cbca6124ea7..b1fae9c0941 100644
--- a/packages/remix-dev/__tests__/fixtures/cloudflare/app/routes/index.tsx
+++ b/integration/helpers/cf-template/app/routes/_index.tsx
@@ -1,6 +1,13 @@
+import type { MetaFunction } from "@remix-run/cloudflare";
+
+export const meta: MetaFunction = () => [
+ { title: "New Remix App" },
+ { name: "description", content: "Welcome to Remix!" },
+];
+
export default function Index() {
return (
-
+
Welcome to Remix
-
diff --git a/integration/helpers/cf-template/package.json b/integration/helpers/cf-template/package.json
index 95528f2f2a4..3ceb2b28b65 100644
--- a/integration/helpers/cf-template/package.json
+++ b/integration/helpers/cf-template/package.json
@@ -2,12 +2,16 @@
"name": "remix-template-cloudflare-workers",
"private": true,
"sideEffects": false,
- "main": "build/index.js",
"type": "module",
- "scripts": {},
+ "scripts": {
+ "build": "node ../../../build/node_modules/@remix-run/dev/dist/cli.js build",
+ "dev": "node ../../../build/node_modules/@remix-run/dev/dist/cli.js dev --manual -c \"npm start\"",
+ "start": "node ../../../node_modules/wrangler/bin/wrangler.js dev ./build/index.js"
+ },
"dependencies": {
+ "@cloudflare/kv-asset-handler": "0.0.0-local-version",
"@remix-run/cloudflare": "0.0.0-local-version",
- "@remix-run/cloudflare-workers": "0.0.0-local-version",
+ "@remix-run/css-bundle": "0.0.0-local-version",
"@remix-run/react": "0.0.0-local-version",
"isbot": "0.0.0-local-version",
"react": "0.0.0-local-version",
@@ -18,7 +22,8 @@
"@remix-run/dev": "0.0.0-local-version",
"@types/react": "0.0.0-local-version",
"@types/react-dom": "0.0.0-local-version",
- "typescript": "0.0.0-local-version"
+ "typescript": "0.0.0-local-version",
+ "wrangler": "0.0.0-local-version"
},
"engines": {
"node": ">=18.0.0"
diff --git a/integration/helpers/cf-template/remix.config.js b/integration/helpers/cf-template/remix.config.js
index a192bd98314..8f68936af97 100644
--- a/integration/helpers/cf-template/remix.config.js
+++ b/integration/helpers/cf-template/remix.config.js
@@ -2,8 +2,11 @@
export default {
ignoredRouteFiles: ["**/.*"],
server: "./server.ts",
- serverConditions: ["worker"],
- serverDependenciesToBundle: "all",
+ serverConditions: ["workerd", "worker", "browser"],
+ serverDependenciesToBundle: [
+ // bundle everything except the virtual module for the static content manifest provided by wrangler
+ /^(?!.*\b__STATIC_CONTENT_MANIFEST\b).*$/,
+ ],
serverMainFields: ["browser", "module", "main"],
serverMinify: true,
serverModuleFormat: "esm",
@@ -13,7 +16,7 @@ export default {
// serverBuildPath: "build/index.js",
// publicPath: "/build/",
- // !!! Don't adust this without changing the code that overwrites this
+ // !!! Don't adjust this without changing the code that overwrites this
// in createFixtureProject()
...global.INJECTED_FIXTURE_REMIX_CONFIG,
};
diff --git a/integration/helpers/cf-template/remix.env.d.ts b/integration/helpers/cf-template/remix.env.d.ts
index 71ee668d012..b5be9ba3bbe 100644
--- a/integration/helpers/cf-template/remix.env.d.ts
+++ b/integration/helpers/cf-template/remix.env.d.ts
@@ -1,3 +1,8 @@
///
-///
+///
///
+
+declare module "__STATIC_CONTENT_MANIFEST" {
+ const manifest: string;
+ export default manifest;
+}
diff --git a/integration/helpers/cf-template/server.ts b/integration/helpers/cf-template/server.ts
index 49eda486cf8..7408ed39813 100644
--- a/integration/helpers/cf-template/server.ts
+++ b/integration/helpers/cf-template/server.ts
@@ -1,4 +1,53 @@
-import { createEventHandler } from "@remix-run/cloudflare-workers";
+import { getAssetFromKV } from "@cloudflare/kv-asset-handler";
+import type { AppLoadContext } from "@remix-run/cloudflare";
+import { createRequestHandler, logDevReady } from "@remix-run/cloudflare";
import * as build from "@remix-run/dev/server-build";
+import __STATIC_CONTENT_MANIFEST from "__STATIC_CONTENT_MANIFEST";
-addEventListener("fetch", createEventHandler({ build, mode: build.mode }));
+const MANIFEST = JSON.parse(__STATIC_CONTENT_MANIFEST);
+const handleRemixRequest = createRequestHandler(build, process.env.NODE_ENV);
+
+if (process.env.NODE_ENV === "development") {
+ logDevReady(build);
+}
+
+export default {
+ async fetch(
+ request: Request,
+ env: {
+ __STATIC_CONTENT: Fetcher;
+ },
+ ctx: ExecutionContext
+ ): Promise {
+ try {
+ const url = new URL(request.url);
+ const ttl = url.pathname.startsWith("/build/")
+ ? 60 * 60 * 24 * 365 // 1 year
+ : 60 * 5; // 5 minutes
+ return await getAssetFromKV(
+ {
+ request,
+ waitUntil: ctx.waitUntil.bind(ctx),
+ } as FetchEvent,
+ {
+ ASSET_NAMESPACE: env.__STATIC_CONTENT,
+ ASSET_MANIFEST: MANIFEST,
+ cacheControl: {
+ browserTTL: ttl,
+ edgeTTL: ttl,
+ },
+ }
+ );
+ } catch (error) {}
+
+ try {
+ const loadContext: AppLoadContext = {
+ env,
+ };
+ return await handleRemixRequest(request, loadContext);
+ } catch (error) {
+ console.log(error);
+ return new Response("An unexpected error occurred", { status: 500 });
+ }
+ },
+};
diff --git a/integration/helpers/cf-template/wrangler.toml b/integration/helpers/cf-template/wrangler.toml
index cbbc0cf510c..b4ddc4387f8 100644
--- a/integration/helpers/cf-template/wrangler.toml
+++ b/integration/helpers/cf-template/wrangler.toml
@@ -1,19 +1,9 @@
name = "remix-cloudflare-workers"
-type = "javascript"
-compatibility_date = "2022-04-05"
-compatibility_flags = ["streams_enable_constructors"]
-zone_id = ""
-account_id = ""
-route = ""
workers_dev = true
+main = "./build/index.js"
+# https://developers.cloudflare.com/workers/platform/compatibility-dates
+compatibility_date = "2023-04-20"
[site]
-bucket = "./public"
-entry-point = "."
-
-[build]
-command = "npm run build"
-
-[build.upload]
-format="service-worker"
+ bucket = "./public"
diff --git a/integration/helpers/deno-template/app/root.tsx b/integration/helpers/deno-template/app/root.tsx
index a6a08d93909..60ddcdf8f82 100644
--- a/integration/helpers/deno-template/app/root.tsx
+++ b/integration/helpers/deno-template/app/root.tsx
@@ -1,3 +1,5 @@
+import { cssBundleHref } from "@remix-run/css-bundle";
+import type { LinksFunction } from "@remix-run/deno";
import {
Links,
LiveReload,
@@ -8,12 +10,16 @@ import {
} from "@remix-run/react";
import * as React from "react";
+export const links: LinksFunction = () => [
+ ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
+];
+
export default function App() {
return (
-
+
diff --git a/integration/helpers/deno-template/app/routes/_index.tsx b/integration/helpers/deno-template/app/routes/_index.tsx
new file mode 100644
index 00000000000..5c0faa5a595
--- /dev/null
+++ b/integration/helpers/deno-template/app/routes/_index.tsx
@@ -0,0 +1,40 @@
+import * as React from "react";
+import type { MetaFunction } from "@remix-run/deno";
+
+export const meta: MetaFunction = () => [
+ { title: "New Remix App" },
+ { name: "description", content: "Welcome to Remix!" },
+];
+
+export default function Index() {
+ return (
+
+ );
+}
diff --git a/integration/helpers/deno-template/package.json b/integration/helpers/deno-template/package.json
index 2526103e527..23ea8c301b9 100644
--- a/integration/helpers/deno-template/package.json
+++ b/integration/helpers/deno-template/package.json
@@ -3,7 +3,15 @@
"private": true,
"sideEffects": false,
"type": "module",
+ "scripts": {
+ "build": "node ../../../build/node_modules/@remix-run/dev/dist/cli.js build",
+ "dev": "node ../../../node_modules/npm-run-all/bin/npm-run-all/index.js build --parallel \"dev:*\"",
+ "dev:deno": "node ../../../node_modules/cross-env/src/bin/cross-env.js NODE_ENV=development deno run --unstable --watch --allow-net --allow-read --allow-env ./build/index.js",
+ "dev:remix": "node ../../../build/node_modules/@remix-run/dev/dist/cli.js watch",
+ "start": "node ../../../node_modules/cross-env/src/bin/cross-env.js NODE_ENV=production deno run --unstable --allow-net --allow-read --allow-env ./build/index.js"
+ },
"dependencies": {
+ "@remix-run/css-bundle": "0.0.0-local-version",
"@remix-run/deno": "0.0.0-local-version",
"@remix-run/react": "0.0.0-local-version",
"isbot": "0.0.0-local-version",
@@ -11,7 +19,9 @@
"react-dom": "0.0.0-local-version"
},
"devDependencies": {
- "@remix-run/dev": "0.0.0-local-version"
+ "@remix-run/dev": "0.0.0-local-version",
+ "cross-env": "0.0.0-local-version",
+ "npm-run-all": "0.0.0-local-version"
},
"engines": {
"node": ">=18.0.0"
diff --git a/integration/helpers/deno-template/remix.config.js b/integration/helpers/deno-template/remix.config.js
index d74be09dad3..a534ab1b7da 100644
--- a/integration/helpers/deno-template/remix.config.js
+++ b/integration/helpers/deno-template/remix.config.js
@@ -12,7 +12,7 @@ export default {
// serverBuildPath: "build/index.js",
// publicPath: "/build/",
- // !!! Don't adust this without changing the code that overwrites this
+ // !!! Don't adjust this without changing the code that overwrites this
// in createFixtureProject()
...global.INJECTED_FIXTURE_REMIX_CONFIG,
};
diff --git a/integration/helpers/node-template/app/root.tsx b/integration/helpers/node-template/app/root.tsx
index 1f082523e7b..b46b8fb15bc 100644
--- a/integration/helpers/node-template/app/root.tsx
+++ b/integration/helpers/node-template/app/root.tsx
@@ -1,3 +1,5 @@
+import { cssBundleHref } from "@remix-run/css-bundle";
+import type { LinksFunction } from "@remix-run/node";
import {
Links,
LiveReload,
@@ -7,12 +9,16 @@ import {
ScrollRestoration,
} from "@remix-run/react";
+export const links: LinksFunction = () => [
+ ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
+];
+
export default function App() {
return (
-
+
diff --git a/packages/remix-dev/__tests__/fixtures/deno/app/routes/index.tsx b/integration/helpers/node-template/app/routes/_index.tsx
similarity index 84%
rename from packages/remix-dev/__tests__/fixtures/deno/app/routes/index.tsx
rename to integration/helpers/node-template/app/routes/_index.tsx
index 119e458e105..9b0c0668062 100644
--- a/packages/remix-dev/__tests__/fixtures/deno/app/routes/index.tsx
+++ b/integration/helpers/node-template/app/routes/_index.tsx
@@ -1,13 +1,13 @@
-import * as React from "react";
import type { MetaFunction } from "@remix-run/node";
-export const meta: MetaFunction = () => {
- return [{ title: "New Remix App" }];
-};
+export const meta: MetaFunction = () => [
+ { title: "New Remix App" },
+ { name: "description", content: "Welcome to Remix!" },
+];
export default function Index() {
return (
-
+
Welcome to Remix
-
diff --git a/integration/helpers/node-template/package.json b/integration/helpers/node-template/package.json
index e202cff6ca6..2b38620b2b4 100644
--- a/integration/helpers/node-template/package.json
+++ b/integration/helpers/node-template/package.json
@@ -9,6 +9,7 @@
"start": "node ../../../build/node_modules/@remix-run/serve/dist/cli.js build"
},
"dependencies": {
+ "@remix-run/css-bundle": "0.0.0-local-version",
"@remix-run/node": "0.0.0-local-version",
"@remix-run/react": "0.0.0-local-version",
"@remix-run/serve": "0.0.0-local-version",
diff --git a/integration/helpers/node-template/remix.config.js b/integration/helpers/node-template/remix.config.js
index a340a1c21d6..9a5c3f53d44 100644
--- a/integration/helpers/node-template/remix.config.js
+++ b/integration/helpers/node-template/remix.config.js
@@ -6,7 +6,7 @@ export default {
// serverBuildPath: "build/index.js",
// publicPath: "/build/",
- // !!! Don't adust this without changing the code that overwrites this
+ // !!! Don't adjust this without changing the code that overwrites this
// in createFixtureProject()
...global.INJECTED_FIXTURE_REMIX_CONFIG,
};
diff --git a/package.json b/package.json
index b895b422f02..c3a3ac3d7ac 100644
--- a/package.json
+++ b/package.json
@@ -56,6 +56,7 @@
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.21.5",
"@changesets/cli": "^2.25.2",
+ "@cloudflare/kv-asset-handler": "^0.3.0",
"@mcansh/remark-definition-links": "2.4.1",
"@octokit/core": "^3.6.0",
"@octokit/graphql": "^4.8.0",
diff --git a/packages/remix-dev/__tests__/fixtures/cloudflare/.eslintrc.js b/packages/remix-dev/__tests__/fixtures/cloudflare/.eslintrc.cjs
similarity index 100%
rename from packages/remix-dev/__tests__/fixtures/cloudflare/.eslintrc.js
rename to packages/remix-dev/__tests__/fixtures/cloudflare/.eslintrc.cjs
diff --git a/packages/remix-dev/__tests__/fixtures/cloudflare/.gitignore b/packages/remix-dev/__tests__/fixtures/cloudflare/.gitignore
index ccbe641499b..7c0736ebf5a 100644
--- a/packages/remix-dev/__tests__/fixtures/cloudflare/.gitignore
+++ b/packages/remix-dev/__tests__/fixtures/cloudflare/.gitignore
@@ -4,4 +4,4 @@ node_modules
/functions/\[\[path\]\].js
/functions/\[\[path\]\].js.map
/public/build
-.env
+.dev.vars
diff --git a/packages/remix-dev/__tests__/fixtures/cloudflare/app/root.tsx b/packages/remix-dev/__tests__/fixtures/cloudflare/app/root.tsx
index 1f082523e7b..0294fbd3907 100644
--- a/packages/remix-dev/__tests__/fixtures/cloudflare/app/root.tsx
+++ b/packages/remix-dev/__tests__/fixtures/cloudflare/app/root.tsx
@@ -1,3 +1,5 @@
+import type { LinksFunction } from "@remix-run/cloudflare";
+import { cssBundleHref } from "@remix-run/css-bundle";
import {
Links,
LiveReload,
@@ -7,6 +9,10 @@ import {
ScrollRestoration,
} from "@remix-run/react";
+export const links: LinksFunction = () => [
+ ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
+];
+
export default function App() {
return (
diff --git a/packages/remix-dev/__tests__/fixtures/cloudflare/app/routes/_index.tsx b/packages/remix-dev/__tests__/fixtures/cloudflare/app/routes/_index.tsx
new file mode 100644
index 00000000000..b1fae9c0941
--- /dev/null
+++ b/packages/remix-dev/__tests__/fixtures/cloudflare/app/routes/_index.tsx
@@ -0,0 +1,39 @@
+import type { MetaFunction } from "@remix-run/cloudflare";
+
+export const meta: MetaFunction = () => [
+ { title: "New Remix App" },
+ { name: "description", content: "Welcome to Remix!" },
+];
+
+export default function Index() {
+ return (
+
+ );
+}
diff --git a/packages/remix-dev/__tests__/fixtures/cloudflare/package.json b/packages/remix-dev/__tests__/fixtures/cloudflare/package.json
index ed124986811..852e589357d 100644
--- a/packages/remix-dev/__tests__/fixtures/cloudflare/package.json
+++ b/packages/remix-dev/__tests__/fixtures/cloudflare/package.json
@@ -1,34 +1,31 @@
{
"private": true,
"sideEffects": false,
+ "type": "module",
"scripts": {
"build": "remix build",
- "dev:remix": "remix watch",
- "dev:wrangler": "cross-env NODE_ENV=development npm run wrangler",
- "dev": "remix build && run-p \"dev:*\"",
- "start": "cross-env NODE_ENV=production npm run wrangler",
- "typecheck": "tsc",
- "wrangler": "wrangler pages dev ./public"
+ "dev": "remix dev --manual -c \"npm run start\"",
+ "start": "wrangler pages dev --compatibility-date=2023-06-21 ./public",
+ "typecheck": "tsc"
},
"dependencies": {
- "@remix-run/cloudflare": "^1.12.0",
- "@remix-run/cloudflare-pages": "^1.12.0",
- "@remix-run/react": "^1.12.0",
- "cross-env": "^7.0.3",
- "isbot": "^3.6.5",
+ "@remix-run/cloudflare": "^1.19.3",
+ "@remix-run/cloudflare-pages": "^1.19.3",
+ "@remix-run/css-bundle": "^1.19.3",
+ "@remix-run/react": "^1.19.3",
+ "isbot": "^3.6.8",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
- "@cloudflare/workers-types": "^3.18.0",
- "@remix-run/dev": "^1.12.0",
- "@remix-run/eslint-config": "^1.12.0",
+ "@cloudflare/workers-types": "^4.20230518.0",
+ "@remix-run/dev": "^1.19.3",
+ "@remix-run/eslint-config": "^1.19.3",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
- "eslint": "^8.27.0",
- "npm-run-all": "^4.1.5",
- "typescript": "^5.1.6",
- "wrangler": "^2.2.1"
+ "eslint": "^8.38.0",
+ "typescript": "^5.1.0",
+ "wrangler": "^3.1.1"
},
"engines": {
"node": ">=18.0.0"
diff --git a/packages/remix-dev/__tests__/fixtures/cloudflare/public/_headers b/packages/remix-dev/__tests__/fixtures/cloudflare/public/_headers
index 2fb104e7af1..c5129f35cd3 100644
--- a/packages/remix-dev/__tests__/fixtures/cloudflare/public/_headers
+++ b/packages/remix-dev/__tests__/fixtures/cloudflare/public/_headers
@@ -1,2 +1,4 @@
+/favicon.ico
+ Cache-Control: public, max-age=3600, s-maxage=3600
/build/*
- Cache-Control: public, max-age=31536000, s-maxage=31536000
+ Cache-Control: public, max-age=31536000, immutable
diff --git a/packages/remix-dev/__tests__/fixtures/cloudflare/public/_routes.json b/packages/remix-dev/__tests__/fixtures/cloudflare/public/_routes.json
index 5826b059c08..4b57270dae9 100644
--- a/packages/remix-dev/__tests__/fixtures/cloudflare/public/_routes.json
+++ b/packages/remix-dev/__tests__/fixtures/cloudflare/public/_routes.json
@@ -1,5 +1,5 @@
{
"version": 1,
"include": ["/*"],
- "exclude": ["/build/*"]
+ "exclude": ["/favicon.ico", "/build/*"]
}
diff --git a/packages/remix-dev/__tests__/fixtures/cloudflare/remix.config.js b/packages/remix-dev/__tests__/fixtures/cloudflare/remix.config.js
index dd63725771c..e35ffadbb5d 100644
--- a/packages/remix-dev/__tests__/fixtures/cloudflare/remix.config.js
+++ b/packages/remix-dev/__tests__/fixtures/cloudflare/remix.config.js
@@ -1,9 +1,9 @@
/** @type {import('@remix-run/dev').AppConfig} */
-module.exports = {
+export default {
ignoredRouteFiles: ["**/.*"],
server: "./server.ts",
serverBuildPath: "functions/[[path]].js",
- serverConditions: ["worker"],
+ serverConditions: ["workerd", "worker", "browser"],
serverDependenciesToBundle: "all",
serverMainFields: ["browser", "module", "main"],
serverMinify: true,
@@ -11,6 +11,5 @@ module.exports = {
serverPlatform: "neutral",
// appDirectory: "app",
// assetsBuildDirectory: "public/build",
- // serverBuildPath: "functions/[[path]].js",
// publicPath: "/build/",
};
diff --git a/packages/remix-dev/__tests__/fixtures/cloudflare/server.ts b/packages/remix-dev/__tests__/fixtures/cloudflare/server.ts
index b2006d7930a..56df96a4aa7 100644
--- a/packages/remix-dev/__tests__/fixtures/cloudflare/server.ts
+++ b/packages/remix-dev/__tests__/fixtures/cloudflare/server.ts
@@ -1,8 +1,13 @@
+import { logDevReady } from "@remix-run/cloudflare";
import { createPagesFunctionHandler } from "@remix-run/cloudflare-pages";
import * as build from "@remix-run/dev/server-build";
+if (process.env.NODE_ENV === "development") {
+ logDevReady(build);
+}
+
export const onRequest = createPagesFunctionHandler({
build,
- getLoadContext: (context) => context.env,
+ getLoadContext: (context) => ({ env: context.env }),
mode: build.mode,
});
diff --git a/packages/remix-dev/__tests__/fixtures/deno/.vscode/resolve_npm_imports.json b/packages/remix-dev/__tests__/fixtures/deno/.vscode/resolve_npm_imports.json
index a99a407595b..ca2ae22b5d0 100644
--- a/packages/remix-dev/__tests__/fixtures/deno/.vscode/resolve_npm_imports.json
+++ b/packages/remix-dev/__tests__/fixtures/deno/.vscode/resolve_npm_imports.json
@@ -7,13 +7,16 @@
"Deno-only dependencies may be imported via URL imports (without using import maps)."
],
"imports": {
+ "@remix-run/css-bundle": "https://esm.sh/@remix-run/css-bundle@1.16.0",
"// `@remix-run/deno` code is already a Deno module, so just get types for it directly from `node_modules/`": "",
"@remix-run/deno": "../node_modules/@remix-run/deno/index.ts",
- "@remix-run/server-runtime": "https://esm.sh/@remix-run/server-runtime@1.9.0",
- "@remix-run/dev/server-build": "https://esm.sh/@remix-run/dev@1.9.0/server-build",
- "@remix-run/react": "https://esm.sh/@remix-run/react@1.9.0",
- "react": "https://esm.sh/react@18.2.0",
- "react-dom": "https://esm.sh/react-dom@18.2.0",
- "react-dom/server": "https://esm.sh/react-dom@18.2.0/server"
+ "@remix-run/dev/server-build": "https://esm.sh/@remix-run/dev@1.16.0/server-build",
+ "@remix-run/react": "https://esm.sh/@remix-run/react@1.16.0",
+ "@remix-run/server-runtime": "https://esm.sh/@remix-run/server-runtime@1.16.0",
+ "isbot": "https://esm.sh/isbot@^3.6.8",
+ "react": "https://esm.sh/react@^18.2.0",
+ "react-dom": "https://esm.sh/react-dom@^18.2.0",
+ "react-dom/client": "https://esm.sh/react-dom@^18.2.0/client",
+ "react-dom/server": "https://esm.sh/react-dom@^18.2.0/server"
}
}
diff --git a/packages/remix-dev/__tests__/fixtures/deno/app/root.tsx b/packages/remix-dev/__tests__/fixtures/deno/app/root.tsx
index a6a08d93909..7bd9545748a 100644
--- a/packages/remix-dev/__tests__/fixtures/deno/app/root.tsx
+++ b/packages/remix-dev/__tests__/fixtures/deno/app/root.tsx
@@ -6,8 +6,14 @@ import {
Scripts,
ScrollRestoration,
} from "@remix-run/react";
+import type { LinksFunction } from "@remix-run/deno";
+import { cssBundleHref } from "@remix-run/css-bundle";
import * as React from "react";
+export const links: LinksFunction = () => [
+ ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
+];
+
export default function App() {
return (
diff --git a/packages/remix-dev/__tests__/fixtures/deno/app/routes/_index.tsx b/packages/remix-dev/__tests__/fixtures/deno/app/routes/_index.tsx
new file mode 100644
index 00000000000..5c0faa5a595
--- /dev/null
+++ b/packages/remix-dev/__tests__/fixtures/deno/app/routes/_index.tsx
@@ -0,0 +1,40 @@
+import * as React from "react";
+import type { MetaFunction } from "@remix-run/deno";
+
+export const meta: MetaFunction = () => [
+ { title: "New Remix App" },
+ { name: "description", content: "Welcome to Remix!" },
+];
+
+export default function Index() {
+ return (
+
+ );
+}
diff --git a/packages/remix-dev/__tests__/fixtures/deno/package.json b/packages/remix-dev/__tests__/fixtures/deno/package.json
index cf4c121b700..8ea02e64c66 100644
--- a/packages/remix-dev/__tests__/fixtures/deno/package.json
+++ b/packages/remix-dev/__tests__/fixtures/deno/package.json
@@ -4,7 +4,7 @@
"scripts": {
"build": "remix build",
"deploy": "deployctl deploy --prod --include=build,public --project= ./build/index.js",
- "dev": "remix build && run-p \"dev:*\"",
+ "dev": "npm-run-all build --parallel \"dev:*\"",
"dev:deno": "cross-env NODE_ENV=development deno run --unstable --watch --allow-net --allow-read --allow-env ./build/index.js",
"dev:remix": "remix watch",
"format": "deno fmt --ignore=node_modules,build,public/build",
@@ -13,14 +13,15 @@
"typecheck": "deno check"
},
"dependencies": {
- "@remix-run/deno": "^1.12.0",
- "@remix-run/react": "^1.12.0",
- "isbot": "^3.6.5",
+ "@remix-run/css-bundle": "^1.19.3",
+ "@remix-run/deno": "^1.19.3",
+ "@remix-run/react": "^1.19.3",
+ "isbot": "^3.6.8",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
- "@remix-run/dev": "^1.12.0",
+ "@remix-run/dev": "^1.19.3",
"cross-env": "^7.0.3",
"npm-run-all": "^4.1.5"
},
diff --git a/packages/remix-dev/__tests__/fixtures/node/app/root.tsx b/packages/remix-dev/__tests__/fixtures/node/app/root.tsx
index 1f082523e7b..8cb74a167f8 100644
--- a/packages/remix-dev/__tests__/fixtures/node/app/root.tsx
+++ b/packages/remix-dev/__tests__/fixtures/node/app/root.tsx
@@ -1,3 +1,5 @@
+import { cssBundleHref } from "@remix-run/css-bundle";
+import type { LinksFunction } from "@remix-run/node";
import {
Links,
LiveReload,
@@ -7,6 +9,10 @@ import {
ScrollRestoration,
} from "@remix-run/react";
+export const links: LinksFunction = () => [
+ ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
+];
+
export default function App() {
return (
diff --git a/packages/remix-dev/__tests__/fixtures/node/app/routes/index.tsx b/packages/remix-dev/__tests__/fixtures/node/app/routes/_index.tsx
similarity index 84%
rename from packages/remix-dev/__tests__/fixtures/node/app/routes/index.tsx
rename to packages/remix-dev/__tests__/fixtures/node/app/routes/_index.tsx
index f024a40f924..9b0c0668062 100644
--- a/packages/remix-dev/__tests__/fixtures/node/app/routes/index.tsx
+++ b/packages/remix-dev/__tests__/fixtures/node/app/routes/_index.tsx
@@ -1,12 +1,13 @@
import type { MetaFunction } from "@remix-run/node";
-export const meta: MetaFunction = () => {
- return [{ title: "New Remix App" }];
-};
+export const meta: MetaFunction = () => [
+ { title: "New Remix App" },
+ { name: "description", content: "Welcome to Remix!" },
+];
export default function Index() {
return (
-
+
Welcome to Remix
-
diff --git a/packages/remix-dev/__tests__/fixtures/node/package.json b/packages/remix-dev/__tests__/fixtures/node/package.json
index 65714ad2302..3e986973c73 100644
--- a/packages/remix-dev/__tests__/fixtures/node/package.json
+++ b/packages/remix-dev/__tests__/fixtures/node/package.json
@@ -1,6 +1,7 @@
{
"private": true,
"sideEffects": false,
+ "type": "module",
"scripts": {
"build": "remix build",
"dev": "remix dev",
@@ -8,19 +9,20 @@
"typecheck": "tsc"
},
"dependencies": {
- "@remix-run/node": "^1.12.0",
- "@remix-run/react": "^1.12.0",
- "@remix-run/serve": "^1.12.0",
- "isbot": "^3.6.5",
+ "@remix-run/css-bundle": "^1.19.3",
+ "@remix-run/node": "^1.19.3",
+ "@remix-run/react": "^1.19.3",
+ "@remix-run/serve": "^1.19.3",
+ "isbot": "^3.6.8",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
- "@remix-run/dev": "^1.12.0",
- "@remix-run/eslint-config": "^1.12.0",
+ "@remix-run/dev": "^1.19.3",
+ "@remix-run/eslint-config": "^1.19.3",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
- "eslint": "^8.27.0",
+ "eslint": "^8.38.0",
"typescript": "^5.1.6"
},
"engines": {
diff --git a/packages/remix-dev/__tests__/fixtures/node/remix.config.js b/packages/remix-dev/__tests__/fixtures/node/remix.config.js
index adf2a0b5d3e..7fac2d305eb 100644
--- a/packages/remix-dev/__tests__/fixtures/node/remix.config.js
+++ b/packages/remix-dev/__tests__/fixtures/node/remix.config.js
@@ -1,8 +1,8 @@
/** @type {import('@remix-run/dev').AppConfig} */
-module.exports = {
+export default {
ignoredRouteFiles: ["**/.*"],
// appDirectory: "app",
// assetsBuildDirectory: "public/build",
- // serverBuildPath: "build/index.js",
// publicPath: "/build/",
+ // serverBuildPath: "build/index.js",
};
diff --git a/scripts/copy-templates-to-fixtures.sh b/scripts/copy-templates-to-fixtures.sh
new file mode 100644
index 00000000000..9c8dbe61194
--- /dev/null
+++ b/scripts/copy-templates-to-fixtures.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+set -x
+
+cp -r templates/cloudflare-pages/* packages/remix-dev/__tests__/fixtures/cloudflare/
+rm -f packages/remix-dev/__tests__/fixtures/cloudflare/app/entry.client.tsx
+rm -f packages/remix-dev/__tests__/fixtures/cloudflare/app/entry.server.tsx
+
+cp -r templates/deno/* packages/remix-dev/__tests__/fixtures/deno/
+rm -f packages/remix-dev/__tests__/fixtures/deno/app/entry.client.tsx
+rm -f packages/remix-dev/__tests__/fixtures/deno/app/entry.server.tsx
+
+cp -r templates/remix/* packages/remix-dev/__tests__/fixtures/node/
+rm -f packages/remix-dev/__tests__/fixtures/node/app/entry.client.tsx
+rm -f packages/remix-dev/__tests__/fixtures/node/app/entry.server.tsx
+rm -f packages/remix-dev/__tests__/fixtures/node/server.js
+
+set +x
\ No newline at end of file
diff --git a/yarn.lock b/yarn.lock
index f161055e2d5..462036abc9f 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1260,6 +1260,13 @@
dependencies:
mime "^2.5.2"
+"@cloudflare/kv-asset-handler@^0.3.0":
+ version "0.3.0"
+ resolved "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.3.0.tgz#11f0af0749a400ddadcca16dcd6f4696d7036991"
+ integrity sha512-9CB/MKf/wdvbfkUdfrj+OkEwZ5b7rws0eogJ4293h+7b6KX5toPwym+VQKmILafNB9YiehqY0DlNrDcDhdWHSQ==
+ dependencies:
+ mime "^3.0.0"
+
"@cloudflare/workers-types@^4.20230518.0":
version "4.20230628.0"
resolved "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20230628.0.tgz#2aacc7ec8c250cd02213b331f1e267cc25db7299"