Skip to content

Commit

Permalink
feat: support configurable deployment basepath
Browse files Browse the repository at this point in the history
  • Loading branch information
feugy committed Nov 21, 2024
1 parent 5acf92b commit c7a2916
Show file tree
Hide file tree
Showing 28 changed files with 2,958 additions and 3,566 deletions.
1 change: 0 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module.exports = {
extends: [
require.resolve('@vercel/style-guide/eslint/browser'),
require.resolve('@vercel/style-guide/eslint/typescript'),
require.resolve('@vercel/style-guide/eslint/jest'),
],
env: {
node: true,
Expand Down
8 changes: 4 additions & 4 deletions apps/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
},
"dependencies": {
"@vercel/speed-insights": "workspace:*",
"next": "15.0.1",
"react": "19.0.0-rc-69d4b800-20241021",
"react-dom": "19.0.0-rc-69d4b800-20241021"
"next": "latest",
"react": "latest",
"react-dom": "latest"
},
"devDependencies": {
"@playwright/test": "1.37.1"
"@playwright/test": "1.49.0"
}
}
47 changes: 0 additions & 47 deletions apps/nextjs/playwright.config.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/remix/.eslintrc.cjs

This file was deleted.

18 changes: 0 additions & 18 deletions apps/remix/app/entry.client.tsx

This file was deleted.

137 changes: 0 additions & 137 deletions apps/remix/app/entry.server.tsx

This file was deleted.

18 changes: 10 additions & 8 deletions apps/remix/app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import { cssBundleHref } from '@remix-run/css-bundle';
// import { cssBundleHref } from '@remix-run/css-bundle';
import type { LinksFunction } from '@remix-run/node';
import {
Links,
LiveReload,
Meta,
Outlet,
Scripts,
ScrollRestoration,
} from '@remix-run/react';
import { SpeedInsights } from '@vercel/speed-insights/remix';

export const links: LinksFunction = () => [
...(cssBundleHref ? [{ rel: 'stylesheet', href: cssBundleHref }] : []),
];
// export const links: LinksFunction = () => [
// ...(cssBundleHref ? [{ rel: 'stylesheet', href: cssBundleHref }] : []),
// ];

export default function App() {
export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
Expand All @@ -24,12 +23,15 @@ export default function App() {
<Links />
</head>
<body>
<Outlet />
{children}
<ScrollRestoration />
<Scripts />
<LiveReload />
<SpeedInsights />
</body>
</html>
);
}

export default function App() {
return <Outlet />;
}
45 changes: 8 additions & 37 deletions apps/remix/app/routes/_index.tsx
Original file line number Diff line number Diff line change
@@ -1,41 +1,12 @@
import type { MetaFunction } from '@remix-run/node';
import { Link } from '@remix-run/react';

export const meta: MetaFunction = () => {
return [
{ title: 'New Remix App' },
{ name: 'description', content: 'Welcome to Remix!' },
];
};

export default function Index() {
export default function Home() {
return (
<div style={{ fontFamily: 'system-ui, sans-serif', lineHeight: '1.8' }}>
<h1>Welcome to Remix</h1>
<ul>
<li>
<a
target="_blank"
href="https://remix.run/tutorials/blog"
rel="noreferrer"
>
15m Quickstart Blog Tutorial
</a>
</li>
<li>
<a
target="_blank"
href="https://remix.run/tutorials/jokes"
rel="noreferrer"
>
Deep Dive Jokes App Tutorial
</a>
</li>
<li>
<a target="_blank" href="https://remix.run/docs" rel="noreferrer">
Remix Docs
</a>
</li>
</ul>
</div>
<main>
<h1>Speed Insights Demo</h1>
<Link to="/blog/henri">About Henri</Link>
<br />
<Link to="/blog/bruno">About Bruno</Link>
</main>
);
}
14 changes: 10 additions & 4 deletions apps/remix/app/routes/blog.$slug.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import { Link } from '@remix-run/react';
import { json, type LoaderFunctionArgs } from '@remix-run/node';
import { Link, useLoaderData } from '@remix-run/react';

export const loader = async ({ params }: LoaderFunctionArgs) => {
return json({ slug: params.slug });
};

export default function BlogPage() {
const { slug } = useLoaderData<typeof loader>();
return (
<div>
<h1>Blog</h1>
<p>Blog content goes here</p>
<Link to="/blog/first">First post</Link>
<Link to="/blog/second">First second</Link>
<p>We don&apos;t talk about {slug}</p>
<br />
<Link to="/">Back</Link>
</div>
);
}
32 changes: 17 additions & 15 deletions apps/remix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,32 @@
"sideEffects": false,
"type": "module",
"scripts": {
"build": "remix build",
"dev": "remix dev --manual",
"start": "remix-serve ./build/index.js",
"build": "remix vite:build",
"dev": "remix vite:dev",
"start": "remix-serve ./build/server/index.js",
"typecheck": "tsc"
},
"dependencies": {
"@remix-run/css-bundle": "^2.5.0",
"@remix-run/node": "^2.5.0",
"@remix-run/react": "^2.5.0",
"@remix-run/serve": "^2.5.0",
"@remix-run/node": "latest",
"@remix-run/react": "latest",
"@remix-run/serve": "latest",
"@vercel/speed-insights": "workspace:*",
"isbot": "^3.6.8",
"isbot": "^4.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@remix-run/dev": "^2.5.0",
"@remix-run/eslint-config": "^2.5.0",
"@types/react": "^18.2.48",
"@types/react-dom": "^18.2.18",
"eslint": "^8.56.0",
"typescript": "^5.3.3"
"@remix-run/dev": "latest",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"autoprefixer": "^10.4.19",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.4",
"typescript": "^5.1.6",
"vite": "^5.1.0",
"vite-tsconfig-paths": "^4.2.1"
},
"engines": {
"node": ">=18.0.0"
"node": ">=20.0.0"
}
}
Loading

0 comments on commit c7a2916

Please sign in to comment.