Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/remix-run/remix
Browse files Browse the repository at this point in the history
Closes #136.
  • Loading branch information
TooTallNate committed Oct 22, 2024
2 parents 481e474 + b98a53e commit 2ad39ba
Show file tree
Hide file tree
Showing 128 changed files with 1,310 additions and 671 deletions.
265 changes: 176 additions & 89 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ We are happy you're here!

[Remix](https://remix.run) is a full stack web framework that lets you focus on the user interface and work back through web fundamentals to deliver a fast, slick, and resilient user experience that deploys to any Node.js server and even non-Node.js environments at the edge like Cloudflare Workers.

Want to know more? Read the [Technical Explanation of Remix](https://remix.run/discussion/introduction)
Want to know more? Read the [Technical Explanation of Remix](https://remix.run/discussion/introduction).

This repository contains the Remix source code. This repo is a work in progress, so we appreciate your patience as we figure things out.

Expand Down
4 changes: 4 additions & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@
- harmony7
- harshmangalam
- helderburato
- HenryPereira
- HenryVogt
- hi-ogawa
- hicksy
Expand All @@ -269,6 +270,7 @@
- IgnusG
- ikarus-akhil
- illright
- imzivko
- imzshh
- infomiho
- ionut-botizan
Expand Down Expand Up @@ -468,6 +470,7 @@
- mikechabot
- mikeybinnswebdesign
- mirzafaizan
- mischah
- mitchelldirt
- mjackson
- mjangir
Expand Down Expand Up @@ -531,6 +534,7 @@
- penspinner
- penx
- petetnt
- petrpacas
- philandstuff
- phishy
- plastic041
Expand Down
8 changes: 2 additions & 6 deletions docs/components/form.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,9 @@ If true, it will submit the form with the browser instead of client side routing

This is recommended over [`<form>`][form_element]. When the `action` prop is omitted, `<Form>` and `<form>` will sometimes call different actions depending on what the current URL is since `<form>` uses the current URL as the default, but `<Form>` uses the URL for the route the form is rendered in.

### `unstable_viewTransition`
### `viewTransition`

The `unstable_viewTransition` prop enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in [`document.startViewTransition()`][document-start-view-transition]. If you need to apply specific styles for this view transition, you will also need to leverage the [`unstable_useViewTransitionState()`][use-view-transition-state].

<docs-warning>
Please note that this API is marked unstable and may be subject to breaking changes without a major release.
</docs-warning>
The `viewTransition` prop enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in [`document.startViewTransition()`][document-start-view-transition]. If you need to apply specific styles for this view transition, you will also need to leverage the [`useViewTransitionState()`][use-view-transition-state].

## Notes

Expand Down
19 changes: 7 additions & 12 deletions docs/components/link.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ You can also pass a `Partial<Path>` value:

### `discover`

Defines the route discovery behavior when using [`future.unstable_lazyRouteDiscovery`][lazy-route-discovery].
Defines the route discovery behavior when using [`future.v3_lazyRouteDiscovery`][lazy-route-discovery].

```tsx
<>
Expand Down Expand Up @@ -185,24 +185,23 @@ function SomeComp() {

This state is inaccessible on the server as it is implemented on top of [`history.state`][history-state].

## `unstable_viewTransition`
## `viewTransition`

The `unstable_viewTransition` prop enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in [`document.startViewTransition()`][document-start-view-transition]:
The `viewTransition` prop enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in [`document.startViewTransition()`][document-start-view-transition]:

```jsx
<Link to={to} unstable_viewTransition>
<Link to={to} viewTransition>
Click me
</Link>
```

If you need to apply specific styles for this view transition, you will also need to leverage the [`unstable_useViewTransitionState()`][use-view-transition-state]:
If you need to apply specific styles for this view transition, you will also need to leverage the [`useViewTransitionState()`][use-view-transition-state]:

```jsx
function ImageLink(to) {
const isTransitioning =
unstable_useViewTransitionState(to);
const isTransitioning = useViewTransitionState(to);
return (
<Link to={to} unstable_viewTransition>
<Link to={to} viewTransition>
<p
style={{
viewTransitionName: isTransitioning
Expand All @@ -226,10 +225,6 @@ function ImageLink(to) {
}
```

<docs-warning>
Please note that this API is marked unstable and may be subject to breaking changes without a major release.
</docs-warning>

[scroll-restoration-component]: ./scroll-restoration
[history-state]: https://developer.mozilla.org/en-US/docs/Web/API/History/state
[view-transitions]: https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API
Expand Down
16 changes: 6 additions & 10 deletions docs/components/nav-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ a.pending {

### `.transitioning`

A `transitioning` class is added to a [`<NavLink unstable_viewTransition>`][view-transition-prop] component when it is transitioning during a navigation, so you can use CSS to style it.
A `transitioning` class is added to a [`<NavLink viewTransition>`][view-transition-prop] component when it is transitioning during a navigation, so you can use CSS to style it.

```tsx
<NavLink to="/messages" unstable_viewTransition />
<NavLink to="/messages" viewTransition />
```

```css
Expand Down Expand Up @@ -136,9 +136,9 @@ Adding the `caseSensitive` prop changes the matching logic to make it case-sensi
| `<NavLink to="/SpOnGe-bOB" />` | `/sponge-bob` | true |
| `<NavLink to="/SpOnGe-bOB" caseSensitive />` | `/sponge-bob` | false |

## `unstable_viewTransition`
## `viewTransition`

The `unstable_viewTransition` prop enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in [`document.startViewTransition()`][document-start-view-transition]. By default, during the transition a [`transitioning` class][transitioning-class] will be added to the [`<a>` element][a-element] that you can use to customize the view transition.
The `viewTransition` prop enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in [`document.startViewTransition()`][document-start-view-transition]. By default, during the transition a [`transitioning` class][transitioning-class] will be added to the [`<a>` element][a-element] that you can use to customize the view transition.

```css
a.transitioning p {
Expand All @@ -151,7 +151,7 @@ a.transitioning img {
```

```tsx
<NavLink to={to} unstable_viewTransition>
<NavLink to={to} viewTransition>
<p>Image Number {idx}</p>
<img src={src} alt={`Img ${idx}`} />
</NavLink>
Expand All @@ -160,7 +160,7 @@ a.transitioning img {
You may also use the [`className`][class-name-prop]/[`style`][style-prop] props or the render props passed to [`children`][children-prop] to further customize based on the `isTransitioning` value.

```tsx
<NavLink to={to} unstable_viewTransition>
<NavLink to={to} viewTransition>
{({ isTransitioning }) => (
<>
<p
Expand All @@ -186,10 +186,6 @@ You may also use the [`className`][class-name-prop]/[`style`][style-prop] props
</NavLink>
```

<docs-warning>
Please note that this API is marked unstable and may be subject to breaking changes without a major release.
</docs-warning>

### `<Link>` props

All other props of [`<Link>`][link-component] are supported.
Expand Down
8 changes: 4 additions & 4 deletions docs/file-conventions/entry.server.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ _Note that you generally want to avoid logging when the request was aborted, sin

### Streaming Rendering Errors

When you are streaming your HTML responses via [`renderToPipeableStream`][rendertopipeablestream] or [`renderToReadableStream`][rendertoreadablestream], your own `handleError` implementation will only handle errors encountered during the initial shell render. If you encounter a rendering error during subsequent streamed rendering you will need handle these errors manually since the Remix server has already sent the Response by that point.
When you are streaming your HTML responses via [`renderToPipeableStream`][rendertopipeablestream] or [`renderToReadableStream`][rendertoreadablestream], your own `handleError` implementation will only handle errors encountered during the initial shell render. If you encounter a rendering error during subsequent streamed rendering you will need to handle these errors manually since the Remix server has already sent the Response by that point.

- For `renderToPipeableStream`, you can handle these errors in the `onError` callback function. You will need to toggle a boolean when the in `onShellReady` so you know if the error was a shell rendering error (and can be ignored) or an async rendering error (and must be handled).
- For an example, please see the default [`entry.server.tsx`][node-streaming-entry-server] for Node.
- For `renderToPipeableStream`, you can handle these errors in the `onError` callback function. You will need to toggle a boolean in `onShellReady` so you know if the error was a shell rendering error (and can be ignored) or an async rendering error (and must be handled).
- For an example, please refer to the default [`entry.server.tsx`][node-streaming-entry-server] for Node.
- For `renderToReadableStream`, you can handle these errors in the `onError` callback function
- For an example, please see the default [`entry.server.tsx`][cloudflare-streaming-entry-server] for Cloudflare
- For an example, please refer to the default [`entry.server.tsx`][cloudflare-streaming-entry-server] for Cloudflare

### Thrown Responses

Expand Down
2 changes: 1 addition & 1 deletion docs/file-conventions/routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Before we go too far into the Remix convention though, we'd like to point out th

The point is, we are well aware of this and from the get-go, Remix has always given you a first-class way to opt-out via the [`routes`][routes_config]/[`ignoredRouteFiles`][ignoredroutefiles_config] and [configure your routes manually][manual-route-configuration]. But, there has to be _some_ default so that folks can get up and running quickly and easily - and we think that the flat routes convention document below is a pretty good default that scales well for small-to-medium sized apps.

Large applications with hundred or thousands of routes will _always_ be a bit chaotic no matter what convention you use - and the idea is that via the `routes` config, you get to build _exactly_ the convention that works best for your application/team. It would be quite literally impossible for Remix to have a default convention that made everyone happy. We'd much rather give you a fairly straightforward default, and then let the community build any number of conventions you can pick and choose from.
Large applications with hundreds or thousands of routes will _always_ be a bit chaotic no matter what convention you use - and the idea is that via the `routes` config, you get to build _exactly_ the convention that works best for your application/team. It would be quite literally impossible for Remix to have a default convention that made everyone happy. We'd much rather give you a fairly straightforward default, and then let the community build any number of conventions you can pick and choose from.

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.

Expand Down
2 changes: 1 addition & 1 deletion docs/file-conventions/vite-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,6 @@ You may also want to enable the `manifest` option since, when server bundles are
[minimatch]: https://npm.im/minimatch
[presets]: ../guides/presets
[server-bundles]: ../guides/server-bundles
[rr-basename]: https://reactrouter.com/routers/create-browser-router#basename
[rr-basename]: https://reactrouter.com/v6/routers/create-browser-router#basename
[vite-public-base-path]: https://vitejs.dev/config/shared-options.html#base
[vite-base]: https://vitejs.dev/config/shared-options.html#base
3 changes: 1 addition & 2 deletions docs/guides/dependency-optimization.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ title: Dependency optimization

# Dependency optimization

Remix introduced automatic dependency optimization in development behind the `future.unstable_optimizeDeps` [Future Flag][future-flags].
This allows you to opt-into this behavior which will become the default in the next major version of Remix - a.k.a. React Router v7 ([1][rr-v7], [2][rr-v7-2]).
Remix introduced automatic dependency optimization in development behind the `future.unstable_optimizeDeps` [Future Flag][future-flags]. This allows you to opt-into this behavior which will eventually become the default in some future version of Remix - a.k.a. React Router ([1][rr-v7], [2][rr-v7-2]). This flag is intended to remain "unstable" into React Router v7 as there is some additional bundling-related work coming that will ease adoption of the flag. We plan to stabilize the flag once that work is completed in v7.

In development, Vite aims to [prebundle dependencies][prebundle-dependencies] so that it can efficiently serve up those dependencies on-demand.
To do this, Vite needs to know where to start crawling your app's module graph to look for dependencies.
Expand Down
5 changes: 2 additions & 3 deletions docs/guides/lazy-route-discovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ title: Lazy Route Discovery

# Lazy Route Discovery (a.k.a. "Fog of War")

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

Remix introduced support for Lazy Route Discovery (a.k.a. "Fog of War") ([RFC][rfc]) behind the `future.unstable_lazyRouteDiscovery` [Future Flag][future-flags] in [`v2.10.0`][2.10.0]. This allows you to opt-into this behavior which will become the default in the next major version of Remix - a.k.a. React Router v7 ([1][rr-v7], [2][rr-v7-2]). For more information on this feature, please check out the [blog post][blog-post].
Remix introduced support for Lazy Route Discovery (a.k.a. "Fog of War") ([RFC][rfc]) behind the `future.unstable_lazyRouteDiscovery` [Future Flag][future-flags] in [`v2.10.0`][2.10.0] (later stabilized as `future.v3_lazyRouteDiscovery` in [`v2.13.0`][2.13.0]). This allows you to opt-into this behavior which will become the default in the next major version of Remix - a.k.a. React Router v7 ([1][rr-v7], [2][rr-v7-2]). For more information on this feature, please check out the [blog post][blog-post].

## Current Behavior

Expand Down Expand Up @@ -56,6 +54,7 @@ If you wish to opt-out of this eager route discovery on a per-link basis, you ca
[rfc]: https://github.com/remix-run/react-router/discussions/11113
[future-flags]: ../guides/api-development-strategy
[2.10.0]: https://github.com/remix-run/remix/blob/main/CHANGELOG.md#v2100
[2.13.0]: https://github.com/remix-run/remix/blob/main/CHANGELOG.md#v2130
[link]: ../components/link
[navlink]: ../components/nav-link
[link-discover]: ../components/link#discover
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/migrating-react-router-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ Now then, go off and _remix your app_. We think you'll like what you build along
- [Common "gotchas"][common-gotchas]

[react-router]: https://reactrouter.com
[react-router-docs]: https://reactrouter.com/start/concepts
[react-router-docs]: https://reactrouter.com/v6/start/concepts
[migration-guide-from-v5-to-v6]: https://reactrouter.com/en/6.22.3/upgrading/v5
[backwards-compatibility-package]: https://www.npmjs.com/package/react-router-dom-v5-compat
[a-few-tweaks-to-improve-progressive-enhancement]: ../pages/philosophy#progressive-enhancement
Expand Down
Loading

0 comments on commit 2ad39ba

Please sign in to comment.