-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef2d8b3
commit 6bef59f
Showing
167 changed files
with
682 additions
and
3,824 deletions.
There are no files selected for viewing
File renamed without changes.
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,4 @@ | ||
{ | ||
"root": true, | ||
"extends": ["react-spring"] | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,31 @@ | ||
import { RemixBrowser } from '@remix-run/react' | ||
import * as React from 'react' | ||
import { hydrateRoot } from 'react-dom/client' | ||
|
||
import { ClientStyleContext } from '~/styles/client.context' | ||
import { getCssText } from '~/styles/stitches.config' | ||
|
||
interface ClientCacheProviderProps { | ||
children: React.ReactNode | ||
} | ||
|
||
function ClientCacheProvider({ children }: ClientCacheProviderProps) { | ||
const [sheet, setSheet] = React.useState(getCssText()) | ||
|
||
const reset = React.useCallback(() => { | ||
setSheet(getCssText()) | ||
}, []) | ||
|
||
return ( | ||
<ClientStyleContext.Provider value={{ reset, sheet }}> | ||
{children} | ||
</ClientStyleContext.Provider> | ||
) | ||
} | ||
|
||
hydrateRoot( | ||
document, | ||
<ClientCacheProvider> | ||
<RemixBrowser /> | ||
</ClientCacheProvider> | ||
) |
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,28 @@ | ||
import { renderToString } from 'react-dom/server' | ||
import type { EntryContext } from '@vercel/remix' | ||
import { RemixServer } from '@remix-run/react' | ||
|
||
import { getCssText } from './styles/stitches.config' | ||
|
||
export default function handleRequest( | ||
request: Request, | ||
responseStatusCode: number, | ||
responseHeaders: Headers, | ||
remixContext: EntryContext | ||
) { | ||
let markup = renderToString( | ||
<RemixServer context={remixContext} url={request.url} /> | ||
) | ||
|
||
markup = markup.replace( | ||
/<style id="stitches">.*<\/style>/g, | ||
`<style id="stitches">${getCssText()}</style>` | ||
) | ||
|
||
responseHeaders.set('Content-Type', 'text/html') | ||
|
||
return new Response('<!DOCTYPE html>' + markup, { | ||
status: responseStatusCode, | ||
headers: responseHeaders, | ||
}) | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,133 @@ | ||
import * as React from 'react' | ||
|
||
import { | ||
MetaFunction, | ||
LinksFunction, | ||
LoaderFunction, | ||
json, | ||
} from '@vercel/remix' | ||
import { | ||
Links, | ||
Meta, | ||
Outlet, | ||
Scripts, | ||
ScrollRestoration, | ||
useLoaderData, | ||
} from '@remix-run/react' | ||
import docusearch from '@docsearch/css/dist/style.css?url' | ||
|
||
import { globalStyles } from './styles/global' | ||
|
||
import { WidgetTheme } from './components/Widgets/WidgetTheme' | ||
import { WidgetPlausible } from './components/Widgets/WidgetPlausible' | ||
import { SiteFooter } from './components/Site/SiteFooter' | ||
import { ClientStyleContext } from './styles/client.context' | ||
|
||
export const meta: MetaFunction = () => { | ||
return [ | ||
{ title: 'react-spring' }, | ||
{ | ||
name: 'description', | ||
content: | ||
'Bring your components to life with simple spring animation primitives for React', | ||
}, | ||
{ property: 'og:site_name', content: 'React Spring' }, | ||
{ property: 'og:title', content: 'React Spring' }, | ||
{ | ||
property: 'og:description', | ||
content: | ||
'Bring your components to life with simple spring animation primitives for React', | ||
}, | ||
{ property: 'og:image', content: 'https://www.react-spring.dev/share.jpg' }, | ||
{ property: 'og:type', content: 'website' }, | ||
{ property: 'og:image:width', content: '1200' }, | ||
{ property: 'og:image:height', content: '630' }, | ||
{ property: 'og:url', content: 'https://www.react-spring.dev' }, | ||
{ property: 'twitter:card', content: 'summary_large_image' }, | ||
{ property: 'twitter:domain', content: 'react-spring.dev' }, | ||
{ property: 'twitter:url', content: 'https://www.react-spring.dev' }, | ||
{ property: 'twitter:title', content: 'React Spring' }, | ||
{ | ||
property: 'twitter:description', | ||
content: | ||
'Bring your components to life with simple spring animation primitives for React', | ||
}, | ||
{ | ||
property: 'twitter:image', | ||
content: 'https://www.react-spring.dev/share.jpg', | ||
}, | ||
] | ||
} | ||
|
||
export const links: LinksFunction = () => [ | ||
{ rel: 'stylesheet', href: docusearch }, | ||
{ rel: 'stylesheet', href: 'https://rsms.me/inter/inter.css' }, | ||
{ rel: 'preconnect', href: 'https://fonts.googleapis.com' }, | ||
{ rel: 'preconnect', href: 'https://fonts.gstatic.com' }, | ||
{ | ||
rel: 'stylesheet', | ||
href: 'https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap', | ||
}, | ||
] | ||
|
||
export const loader: LoaderFunction = () => { | ||
return json({ | ||
ENV: { | ||
ENABLE_PLAUSIBLE: process.env.ENABLE_PLAUSIBLE, | ||
ALGOLIA_APP_ID: process.env.ALGOLIA_APP_ID, | ||
ALGOLIA_API_KEY: process.env.ALGOLIA_API_KEY, | ||
ENABLE_CARBON: process.env.ENABLE_CARBON, | ||
}, | ||
}) | ||
} | ||
|
||
function Document({ children }: { children: React.ReactNode }) { | ||
globalStyles() | ||
|
||
const clientStyleData = React.useContext(ClientStyleContext) | ||
|
||
// Only executed on client | ||
React.useEffect(() => { | ||
// reset cache to re-apply global styles | ||
clientStyleData.reset() | ||
}, [clientStyleData]) | ||
|
||
const data = useLoaderData<{ ENV: object }>() | ||
|
||
return ( | ||
<html lang="en"> | ||
<head> | ||
<meta charSet="utf-8" /> | ||
<meta name="viewport" content="width=device-width,initial-scale=1" /> | ||
<Meta /> | ||
<Links /> | ||
<style | ||
id="stitches" | ||
dangerouslySetInnerHTML={{ __html: clientStyleData.sheet }} | ||
suppressHydrationWarning | ||
/> | ||
<WidgetPlausible /> | ||
{/* <WidgetTheme /> */} | ||
</head> | ||
<body> | ||
{children} | ||
<SiteFooter /> | ||
<script | ||
dangerouslySetInnerHTML={{ | ||
__html: `window.env = ${JSON.stringify(data.ENV)}`, | ||
}} | ||
/> | ||
<Scripts /> | ||
</body> | ||
</html> | ||
) | ||
} | ||
|
||
export default function App() { | ||
return ( | ||
<Document> | ||
<Outlet /> | ||
<ScrollRestoration /> | ||
</Document> | ||
) | ||
} |
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
2 changes: 1 addition & 1 deletion
2
docs/app/routes/api/feedback.ts → docs-old/app/routes/api/feedback.ts
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,65 @@ | ||
{ | ||
"name": "@react-spring/docs", | ||
"license": "MIT", | ||
"author": "Josh Ellis", | ||
"version": "1.0.0", | ||
"private": true, | ||
"scripts": { | ||
"build": "vite build && vite build --ssr", | ||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf .cache && rm -rf api", | ||
"dev": "concurrently \"yarn dev:remix\" \"yarn scripts:watch\"", | ||
"dev:remix": "vite dev", | ||
"lint": "TIMING=1 eslint \"app/**/*.ts*\" \"scripts/**/*.ts*\"", | ||
"scripts:build": "ts-node ./scripts/build.ts", | ||
"scripts:watch": "ts-node ./scripts/watch.ts" | ||
}, | ||
"dependencies": { | ||
"@codesandbox/sandpack-react": "^1.20.9", | ||
"@docsearch/react": "^3.5.2", | ||
"@mdx-js/react": "^3.0.1", | ||
"@mdx-js/rollup": "^3.0.1", | ||
"@radix-ui/react-accordion": "^1.1.2", | ||
"@radix-ui/react-dialog": "^1.0.5", | ||
"@radix-ui/react-popover": "^1.0.7", | ||
"@radix-ui/react-toolbar": "^1.0.4", | ||
"@radix-ui/react-tooltip": "^1.0.7", | ||
"@react-spring/rafz": "workspace:^", | ||
"@react-spring/web": "9.7.3", | ||
"@remix-run/node": "^2.9.2", | ||
"@remix-run/react": "^2.9.2", | ||
"@remix-run/serve": "^2.9.2", | ||
"@stitches/react": "^1.2.8", | ||
"@supabase/supabase-js": "^2.39.3", | ||
"@use-gesture/react": "^10.2.24", | ||
"gray-matter": "^4.0.3", | ||
"hast-util-to-html": "7.1.3", | ||
"jotai": "^2.0.3", | ||
"parse-numeric-range": "^1.3.0", | ||
"phosphor-react": "^1.4.1", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-select": "^5.7.0", | ||
"react-use-measure": "^2.1.1", | ||
"refractor": "4.8.1", | ||
"rehype-autolink-headings": "7.1.0", | ||
"rehype-parse": "9.0.0", | ||
"rehype-slug": "6.0.0", | ||
"remark-directive": "3.0.0", | ||
"remix": "^2.9.2", | ||
"unified": "11.0.4", | ||
"unist-util-visit": "5.0.0", | ||
"vite": "^5.2.11", | ||
"zod": "^3.21.4" | ||
}, | ||
"devDependencies": { | ||
"@remix-run/v1-route-convention": "^0.1.4", | ||
"@vercel/remix": "^2.9.2-patch.2", | ||
"chokidar": "^3.5.3", | ||
"concurrently": "^8.2.2", | ||
"remark-frontmatter": "^5.0.0", | ||
"remark-mdx-frontmatter": "^4.0.0", | ||
"ts-node": "^10.9.2", | ||
"vite-tsconfig-paths": "^4.3.2" | ||
}, | ||
"sideEffects": false | ||
} |
File renamed without changes
File renamed without changes
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,28 @@ | ||
{ | ||
"include": [ | ||
"env.d.ts", | ||
"**/*.ts", | ||
"**/*.tsx", | ||
"**/*.js", | ||
"*.d.ts", | ||
"vite.config.ts" | ||
], | ||
"exclude": ["build"], | ||
"compilerOptions": { | ||
"lib": ["DOM", "DOM.Iterable", "ESNext"], | ||
"isolatedModules": true, | ||
"esModuleInterop": true, | ||
"jsx": "react-jsx", | ||
"moduleResolution": "Bundler", | ||
"resolveJsonModule": true, | ||
"target": "ESNext", | ||
"strict": true, | ||
"paths": { | ||
"~/*": ["./app/*"] | ||
}, | ||
"noEmit": true, | ||
"baseUrl": ".", | ||
"allowJs": true, | ||
"forceConsistentCasingInFileNames": true | ||
} | ||
} |
File renamed without changes.
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,11 @@ | ||
node_modules | ||
|
||
.cache | ||
.env | ||
.vercel | ||
.output | ||
|
||
build | ||
public/build | ||
api/index.js* | ||
api/_assets* |
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,34 @@ | ||
# Welcome to Remix! | ||
|
||
- [Remix Docs](https://remix.run/docs) | ||
|
||
## Deployment | ||
|
||
After having run the `create-remix` command and selected "Vercel" as a deployment target, you only need to [import your Git repository](https://vercel.com/new) into Vercel, and it will be deployed. | ||
|
||
If you'd like to avoid using a Git repository, you can also deploy the directory by running [Vercel CLI](https://vercel.com/cli): | ||
|
||
```sh | ||
npm i -g vercel | ||
vercel | ||
``` | ||
|
||
It is generally recommended to use a Git repository, because future commits will then automatically be deployed by Vercel, through its [Git Integration](https://vercel.com/docs/concepts/git). | ||
|
||
## Development | ||
|
||
To run your Remix app locally, make sure your project's local dependencies are installed: | ||
|
||
```sh | ||
npm install | ||
``` | ||
|
||
Afterwards, start the Remix development server like so: | ||
|
||
```sh | ||
npm run dev | ||
``` | ||
|
||
Open up [http://localhost:3000](http://localhost:3000) and you should be ready to go! | ||
|
||
If you're used to using the `vercel dev` command provided by [Vercel CLI](https://vercel.com/cli) instead, you can also use that, but it's not needed. |
Oops, something went wrong.