Skip to content

Commit

Permalink
Docs contributions (#7255)
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavoguichard authored Aug 25, 2023
1 parent fd72e00 commit 99a3490
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
- guatedude2
- guerra08
- gunners6518
- gustavoguichard
- gustavopch
- gyx1000
- hadizz
Expand Down
8 changes: 4 additions & 4 deletions docs/discussion/01-runtimes.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ Each runtime has varying support for the standard Web APIs that Remix is built o

The following runtimes packages are available:

- `@remix-run/node`
- `@remix-run/cloudflare-pages`
- etc.
- TODO: add links to each one
- [`@remix-run/cloudflare-pages`](https://www.npmjs.com/package/@remix-run/cloudflare-pages)
- [`@remix-run/cloudflare-workers`](https://www.npmjs.com/package/@remix-run/cloudflare-workers)
- [`@remix-run/deno`](https://www.npmjs.com/package/@remix-run/deno)
- [`@remix-run/node`](https://www.npmjs.com/package/@remix-run/node)

The majority of the APIs you interact with in your app are not imported directly from these packages, so your code is fairly portable between runtimes. However, occasionally you'll import something from these packages for a specific feature that isn't a standard Web API.

Expand Down
6 changes: 3 additions & 3 deletions docs/start/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ export async function action({

Loaders and actions can both [return a `Response`][returningresponses] (makes sense, since they received a [`Request`][request]!). The [`redirect`][redirect] helper just makes it easier to return a [response][response] that tells the app to change locations.

Without client side routing, if a server redirected after a POST request, the new page would fetch the latest data and render. As we learned before, REmix emulates this model and automatically revalidates the data on the page after the action. That's why the sidebar automatically updates when we save the form. The extra revalidation code doesn't exist without client side routing, so it doesn't need to exist with client side routing in Remix either!
Without client side routing, if a server redirected after a POST request, the new page would fetch the latest data and render. As we learned before, Remix emulates this model and automatically revalidates the data on the page after the action. That's why the sidebar automatically updates when we save the form. The extra revalidation code doesn't exist without client side routing, so it doesn't need to exist with client side routing in Remix either!

One last thing. Without JavaScript, the `redirect` would be a normal redirect. However, with JavaScript it's a clientside redirect, so the user doesn't lose client state like scroll positions or component state.

Expand Down Expand Up @@ -820,7 +820,7 @@ In our case, we add a `"loading"` class to the main part of the app if we're not

If we review code in the contact route, we can find the delete button looks like this:

```jsx filename=src/routes/contact.jsx lines=[3]
```jsx filename=src/routes/contacts.$contactId.tsx lines=[3]
<Form
method="post"
action="destroy"
Expand Down Expand Up @@ -1224,7 +1224,7 @@ When nothing is happening, `navigation.location` will be `undefined`, but when t

👉 **Add classes to search form elements using the state**

```tsx filename=app/routes/root.tsx lines=[3,14]
```tsx filename=app/routes/root.tsx lines=[3,17]
<Form id="search-form" role="search">
<input
className={searching ? "loading" : ""}
Expand Down

0 comments on commit 99a3490

Please sign in to comment.