Skip to content

Commit

Permalink
Merge branch 'main' into release-next
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Jul 30, 2024
2 parents c00e365 + ede2012 commit 5a9bcd5
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 20 deletions.
5 changes: 5 additions & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- AdiRishi
- ahabhgk
- ahbruns
- AhmadMayo
- ahmedeldessouki
- ahuth
- aiji42
Expand All @@ -35,6 +36,7 @@
- alongdate
- AltanS
- alvinthen
- amanape
- amir-ziaei
- amorriscode
- andreiduca
Expand Down Expand Up @@ -84,6 +86,7 @@
- bogas04
- BogdanDevBst
- bolchowka
- brenr
- brettscott
- brookslybrand
- brophdawg11
Expand Down Expand Up @@ -500,6 +503,7 @@
- nobeeakon
- nordiauwu
- not-ivy
- npapagna
- nrako
- nurul3101
- nvh95
Expand All @@ -522,6 +526,7 @@
- plastic041
- plondon
- pmbanugo
- Pouet--
- prasook-jain
- pratikdevdas
- princerajroy
Expand Down
2 changes: 1 addition & 1 deletion docs/discussion/pending-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function ProjectListItem({ project }) {
value={starred ? "0" : "1"}
>
{/* 👇 display optimistic value */}
{starred ? "" : ""}
{starred ? "" : ""}
</button>
</fetcher.Form>
</>
Expand Down
4 changes: 2 additions & 2 deletions docs/file-conventions/routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Large applications with hundred or thousands of routes will _always_ be a bit ch
So, before we dive into the details of the Remix default convention, here's some community alternatives you can check out if you decide that our default is not your cup of tea.

- [`remix-flat-routes`][flat_routes] - The Remix default is basically a simplified version of this package. The author has continued to iterate on and evolve this package so if you generally like the "flat routes" idea but want a bit more power (including a hybrid approach of files and folders), definitely check this one out.
- [`remix-custom-routes`][custom_routes] - If you want even more customization, this package lets you define that types of files should be treated as routes. This let's you go beyond simply flat/nested and do something such as _"any file with an extension of `.route.tsx` is a route"_.
- [`remix-json-routes`][json_routes] - If you just want to specify your routes in a config, this is your jam - just give Remix a JSON object with your routes and skip the flat/nested concept entirely. There's even a JSX option in there too.
- [`remix-custom-routes`][custom_routes] - If you want even more customization, this package lets you define that types of files should be treated as routes. This lets you go beyond the simple flat/nested concept and do something such as _"any file with an extension of `.route.tsx` is a route"_.
- [`remix-json-routes`][json_routes] - If you just want to specify your routes via a config file, this is your jam - just provide Remix a JSON object with your routes and skip the flat/nested concept entirely. There's even a JSX option in there too.

## Root Route

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/single-fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Single Fetch

<docs-warning>This is an unstable API and will continue to change, do not adopt in production</docs-warning>

Single Fetch is a new data data loading strategy and streaming format. When you enable Single Fetch, Remix will make a single HTTP call to your server on client-side transitions, instead of multiple HTTP calls in parallel (one per loader). Additionally, Single Fetch also allows you to send down naked objects from your `loader` and `action`, such as `Date`, `Error`, `Promise`, `RegExp`, and more.
Single Fetch is a new data loading strategy and streaming format. When you enable Single Fetch, Remix will make a single HTTP call to your server on client-side transitions, instead of multiple HTTP calls in parallel (one per loader). Additionally, Single Fetch also allows you to send down naked objects from your `loader` and `action`, such as `Date`, `Error`, `Promise`, `RegExp`, and more.

## Overview

Expand Down
2 changes: 1 addition & 1 deletion docs/hooks/use-action-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ toc: false

# `useActionData`

Returns the serialized data from the most recent route action or `undefined` if there isn't one.
Returns the serialized data from the most recent route [action][action] or `undefined` if there isn't one. This hook only returns action data from the route in context - it can not access data from other parent or child routes.

```tsx lines=[10,14]
import type { ActionFunctionArgs } from "@remix-run/node"; // or cloudflare/deno
Expand Down
4 changes: 2 additions & 2 deletions docs/start/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ First build the app for production:
npx remix vite:build
```

You should now see a `build` folder containing a `server` folder (the server version of your app) and a `client` folder (the browser version) with some build artifacts in them. (This is all [configurable][remix_config].)
You should now see a `build` folder containing a `server` folder (the server version of your app) and a `client` folder (the browser version) with some build artifacts in them. (This is all [configurable][vite_config].)

👉 **Run the app with `remix-serve`**

Expand Down Expand Up @@ -276,7 +276,7 @@ What's next?
[runtimes]: ../discussion/runtimes
[inspect]: https://nodejs.org/en/docs/guides/debugging-getting-started/
[tutorial]: ./tutorial
[remix_config]: ../file-conventions/remix-config
[vite_config]: ../file-conventions/vite-config
[templates]: /resources?category=templates
[http-localhost-3000]: http://localhost:3000
[es-modules]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
Expand Down
8 changes: 7 additions & 1 deletion templates/cloudflare-workers/load-context.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { type PlatformProxy } from "wrangler";

// PlatformProxy’s caches property is incompatible with the caches global
// https://github.com/cloudflare/workers-sdk/blob/main/packages/wrangler/src/api/integrations/platform/caches.ts
type Cloudflare = Omit<PlatformProxy<Env>, "dispose" | "caches"> & {
caches: CacheStorage;
};

declare module "@remix-run/cloudflare" {
interface AppLoadContext {
cloudflare: Omit<PlatformProxy<Env>, "dispose">;
cloudflare: Cloudflare;
}
}
2 changes: 1 addition & 1 deletion templates/cloudflare-workers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"deploy": "wrangler deploy",
"dev": "remix vite:dev",
"lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .",
"start": "wrangler dev ./server.js",
"start": "wrangler dev",
"typegen": "wrangler types",
"typecheck": "tsc"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { getAssetFromKV } from "@cloudflare/kv-asset-handler";
import { createRequestHandler } from "@remix-run/cloudflare";
import * as remixBuild from "./build/server";
import { createRequestHandler, type ServerBuild } from "@remix-run/cloudflare";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore This file won’t exist if it hasn’t yet been built
import * as build from "./build/server"; // eslint-disable-line import/no-unresolved
// eslint-disable-next-line import/no-unresolved
import __STATIC_CONTENT_MANIFEST from "__STATIC_CONTENT_MANIFEST";

const MANIFEST = JSON.parse(__STATIC_CONTENT_MANIFEST);
const handleRemixRequest = createRequestHandler(remixBuild);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const handleRemixRequest = createRequestHandler(build as any as ServerBuild);

export default {
async fetch(request, env, ctx) {
Expand Down Expand Up @@ -50,4 +53,4 @@ export default {
return new Response("An unexpected error occurred", { status: 500 });
}
},
};
} satisfies ExportedHandler<Env & { __STATIC_CONTENT: KVNamespace<string> }>;
2 changes: 1 addition & 1 deletion templates/cloudflare-workers/wrangler.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "remix-cloudflare-workers-template"

main = "./server.js"
main = "./server.ts"
workers_dev = true
# https://developers.cloudflare.com/workers/platform/compatibility-dates
compatibility_date = "2023-04-20"
Expand Down
6 changes: 0 additions & 6 deletions templates/cloudflare/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ You will need to rerun typegen whenever you make changes to `wrangler.toml`.

## Deployment

> [!WARNING]
> Cloudflare does _not_ use `wrangler.toml` to configure deployment bindings.
> You **MUST** [configure deployment bindings manually in the Cloudflare dashboard][bindings].
First, build your app for production:

```sh
Expand All @@ -46,8 +42,6 @@ Then, deploy your app to Cloudflare Pages:
npm run deploy
```

[bindings]: https://developers.cloudflare.com/pages/functions/bindings/

## Styling

This template comes with [Tailwind CSS](https://tailwindcss.com/) already configured for a simple default starting experience. You can use whatever css framework you prefer. See the [Vite docs on css](https://vitejs.dev/guide/features.html#css) for more information.

0 comments on commit 5a9bcd5

Please sign in to comment.