Skip to content

Commit

Permalink
Merge branch 'release-next' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Sep 19, 2024
2 parents 4a95727 + e596b9b commit bda73d7
Show file tree
Hide file tree
Showing 78 changed files with 1,193 additions and 302 deletions.
5 changes: 0 additions & 5 deletions .changeset/hungry-experts-suffer.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/many-donuts-tie.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/tender-pears-confess.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/unlucky-pigs-tap.md

This file was deleted.

125 changes: 75 additions & 50 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,151 +13,154 @@ We manage release notes in this file instead of the paginated Github Releases Pa
<summary>Table of Contents</summary>

- [Remix Releases](#remix-releases)
- [v2.12.1](#v2121)
- [Patch Changes](#patch-changes)
- [Changes by Package](#changes-by-package)
- [v2.12.0](#v2120)
- [What's Changed](#whats-changed)
- [Future Flag for Automatic Dependency Optimization (unstable)](#future-flag-for-automatic-dependency-optimization-unstable)
- [Improved Single Fetch Type Safety (unstable)](#improved-single-fetch-type-safety-unstable)
- [Updates to Single Fetch Revalidation Behavior (unstable)](#updates-to-single-fetch-revalidation-behavior-unstable)
- [Minor Changes](#minor-changes)
- [Patch Changes](#patch-changes)
- [Updated Dependencies](#updated-dependencies)
- [Changes by Package](#changes-by-package)
- [v2.11.2](#v2112)
- [Patch Changes](#patch-changes-1)
- [Updated Dependencies](#updated-dependencies-1)
- [Updated Dependencies](#updated-dependencies)
- [Changes by Package](#changes-by-package-1)
- [v2.11.1](#v2111)
- [v2.11.2](#v2112)
- [Patch Changes](#patch-changes-2)
- [Updated Dependencies](#updated-dependencies-1)
- [Changes by Package](#changes-by-package-2)
- [v2.11.1](#v2111)
- [Patch Changes](#patch-changes-3)
- [Changes by Package](#changes-by-package-3)
- [v2.11.0](#v2110)
- [What's Changed](#whats-changed-1)
- [Renamed `unstable_fogOfWar` future flag to `unstable_lazyRouteDiscovery` (unstable)](#renamed-unstable_fogofwar-future-flag-to-unstable_lazyroutediscovery-unstable)
- [Removed `response` stub in Single Fetch (unstable)](#removed-response-stub-in-single-fetch-unstable)
- [Minor Changes](#minor-changes-1)
- [Patch Changes](#patch-changes-3)
- [Updated Dependencies](#updated-dependencies-2)
- [Changes by Package](#changes-by-package-3)
- [v2.10.3](#v2103)
- [Patch Changes](#patch-changes-4)
- [Updated Dependencies](#updated-dependencies-3)
- [Updated Dependencies](#updated-dependencies-2)
- [Changes by Package](#changes-by-package-4)
- [v2.10.2](#v2102)
- [v2.10.3](#v2103)
- [Patch Changes](#patch-changes-5)
- [Updated Dependencies](#updated-dependencies-3)
- [Changes by Package](#changes-by-package-5)
- [v2.10.1](#v2101)
- [v2.10.2](#v2102)
- [Patch Changes](#patch-changes-6)
- [Updated Dependencies](#updated-dependencies-4)
- [Changes by Package](#changes-by-package-6)
- [v2.10.1](#v2101)
- [Patch Changes](#patch-changes-7)
- [Updated Dependencies](#updated-dependencies-4)
- [Changes by Package](#changes-by-package-7)
- [v2.10.0](#v2100)
- [What's Changed](#whats-changed-2)
- [Lazy Route Discovery (a.k.a. "Fog of War")](#lazy-route-discovery-aka-fog-of-war)
- [Minor Changes](#minor-changes-2)
- [Patch Changes](#patch-changes-7)
- [Patch Changes](#patch-changes-8)
- [Updated Dependencies](#updated-dependencies-5)
- [Changes by Package](#changes-by-package-7)
- [Changes by Package](#changes-by-package-8)
- [v2.9.2](#v292)
- [What's Changed](#whats-changed-3)
- [Updated Type-Safety for Single Fetch](#updated-type-safety-for-single-fetch)
- [Patch Changes](#patch-changes-8)
- [Updated Dependencies](#updated-dependencies-6)
- [Changes by Package](#changes-by-package-8)
- [v2.9.1](#v291)
- [Patch Changes](#patch-changes-9)
- [Updated Dependencies](#updated-dependencies-6)
- [Changes by Package](#changes-by-package-9)
- [v2.9.1](#v291)
- [Patch Changes](#patch-changes-10)
- [Changes by Package](#changes-by-package-10)
- [v2.9.0](#v290)
- [What's Changed](#whats-changed-4)
- [Single Fetch (unstable)](#single-fetch-unstable)
- [Undici](#undici)
- [Minor Changes](#minor-changes-3)
- [Patch Changes](#patch-changes-10)
- [Patch Changes](#patch-changes-11)
- [Updated Dependencies](#updated-dependencies-7)
- [Changes by Package](#changes-by-package-10)
- [Changes by Package](#changes-by-package-11)
- [v2.8.1](#v281)
- [Patch Changes](#patch-changes-11)
- [Patch Changes](#patch-changes-12)
- [Updated Dependencies](#updated-dependencies-8)
- [Changes by Package](#changes-by-package-11)
- [Changes by Package](#changes-by-package-12)
- [v2.8.0](#v280)
- [Minor Changes](#minor-changes-4)
- [Patch Changes](#patch-changes-12)
- [Patch Changes](#patch-changes-13)
- [Updated Dependencies](#updated-dependencies-9)
- [Changes by Package](#changes-by-package-12)
- [Changes by Package](#changes-by-package-13)
- [2.7.2](#272)
- [Patch Changes](#patch-changes-13)
- [2.7.1](#271)
- [Patch Changes](#patch-changes-14)
- [2.7.1](#271)
- [Patch Changes](#patch-changes-15)
- [v2.7.0](#v270)
- [What's Changed](#whats-changed-5)
- [Stabilized Vite Plugin](#stabilized-vite-plugin)
- [New `Layout` Export](#new-layout-export)
- [Basename support](#basename-support)
- [Cloudflare Proxy as a Vite Plugin](#cloudflare-proxy-as-a-vite-plugin)
- [Minor Changes](#minor-changes-5)
- [Patch Changes](#patch-changes-15)
- [Patch Changes](#patch-changes-16)
- [Updated Dependencies](#updated-dependencies-10)
- [Changes by Package](#changes-by-package-13)
- [Changes by Package](#changes-by-package-14)
- [v2.6.0](#v260)
- [What's Changed](#whats-changed-6)
- [Unstable Vite Plugin updates](#unstable-vite-plugin-updates)
- [Minor Changes](#minor-changes-6)
- [Patch Changes](#patch-changes-16)
- [Patch Changes](#patch-changes-17)
- [Updated Dependencies](#updated-dependencies-11)
- [Changes by Package](#changes-by-package-14)
- [Changes by Package](#changes-by-package-15)
- [v2.5.1](#v251)
- [Patch Changes](#patch-changes-17)
- [Patch Changes](#patch-changes-18)
- [Updated Dependencies](#updated-dependencies-12)
- [Changes by Package](#changes-by-package-15)
- [Changes by Package](#changes-by-package-16)
- [v2.5.0](#v250)
- [What's Changed](#whats-changed-7)
- [SPA Mode (unstable)](#spa-mode-unstable)
- [Server Bundles (unstable)](#server-bundles-unstable)
- [Minor Changes](#minor-changes-7)
- [Patch Changes](#patch-changes-18)
- [Patch Changes](#patch-changes-19)
- [Updated Dependencies](#updated-dependencies-13)
- [Changes by Package](#changes-by-package-16)
- [Changes by Package](#changes-by-package-17)
- [v2.4.1](#v241)
- [Patch Changes](#patch-changes-19)
- [Patch Changes](#patch-changes-20)
- [Updated Dependencies](#updated-dependencies-14)
- [Changes by Package](#changes-by-package-17)
- [Changes by Package](#changes-by-package-18)
- [v2.4.0](#v240)
- [What's Changed](#whats-changed-8)
- [Client Data](#client-data)
- [`future.v3_relativeSplatPath`](#futurev3_relativesplatpath)
- [Vite Updates (Unstable)](#vite-updates-unstable)
- [Minor Changes](#minor-changes-8)
- [Patch Changes](#patch-changes-20)
- [Patch Changes](#patch-changes-21)
- [Updated Dependencies](#updated-dependencies-15)
- [Changes by Package](#changes-by-package-18)
- [Changes by Package](#changes-by-package-19)
- [v2.3.1](#v231)
- [Patch Changes](#patch-changes-21)
- [Patch Changes](#patch-changes-22)
- [Updated Dependencies](#updated-dependencies-16)
- [Changes by Package](#changes-by-package-19)
- [Changes by Package](#changes-by-package-20)
- [v2.3.0](#v230)
- [What's Changed](#whats-changed-9)
- [Stabilized `useBlocker`](#stabilized-useblocker)
- [`unstable_flushSync` API](#unstable_flushsync-api)
- [Minor Changes](#minor-changes-9)
- [Patch Changes](#patch-changes-22)
- [Patch Changes](#patch-changes-23)
- [Updated Dependencies](#updated-dependencies-17)
- [Changes by Package](#changes-by-package-20)
- [Changes by Package](#changes-by-package-21)
- [v2.2.0](#v220)
- [What's Changed](#whats-changed-10)
- [Vite!](#vite)
- [New Fetcher APIs](#new-fetcher-apis)
- [Persistence Future Flag](#persistence-future-flag)
- [Minor Changes](#minor-changes-10)
- [Patch Changes](#patch-changes-23)
- [Patch Changes](#patch-changes-24)
- [Updated Dependencies](#updated-dependencies-18)
- [Changes by Package](#changes-by-package-21)
- [Changes by Package](#changes-by-package-22)
- [v2.1.0](#v210)
- [What's Changed](#whats-changed-11)
- [View Transitions](#view-transitions)
- [Stable `createRemixStub`](#stable-createremixstub)
- [Minor Changes](#minor-changes-11)
- [Patch Changes](#patch-changes-24)
- [Patch Changes](#patch-changes-25)
- [Updated Dependencies](#updated-dependencies-19)
- [Changes by Package](#changes-by-package-22)
- [Changes by Package](#changes-by-package-23)
- [v2.0.1](#v201)
- [Patch Changes](#patch-changes-25)
- [Patch Changes](#patch-changes-26)
- [Changes by Package 🔗](#changes-by-package-)
- [v2.0.0](#v200)
- [Breaking Changes](#breaking-changes)
Expand All @@ -170,7 +173,7 @@ We manage release notes in this file instead of the paginated Github Releases Pa
- [New Features](#new-features)
- [Other Notable Changes](#other-notable-changes)
- [Updated Dependencies](#updated-dependencies-20)
- [Changes by Package](#changes-by-package-23)
- [Changes by Package](#changes-by-package-24)

</details>

Expand Down Expand Up @@ -218,6 +221,28 @@ Date: YYYY-MM-DD
-->

## v2.12.1

Date: 2024-09-19

### Patch Changes

- `@remix-run/dev` - Properly abort `request.signal` during `vite dev` when the node response is closed ([#9976](https://github.com/remix-run/remix/pull/9976))
- `@remix-run/dev` - CSS imports with `?inline`, `?inline-css` and `?raw` are no longer incorrectly injected during SSR in development ([#9910](https://github.com/remix-run/remix/pull/9910))
- `@remix-run/server-runtime`: Single Fetch: Fix types when `loader`, `action`, `clientLoader`, or `clientAction` return a mixture of bare objects, `json(...)`, `defer(...)`, and `unstable_data(...)`. ([#9999](https://github.com/remix-run/remix/pull/9999))
- `@remix-run/node`/`@remix-run/cloudflare`/`@remix-run/deno` - Single Fetch: Re-export `interface Future` through runtime packages so that `pnpm` doesn't complain about `@remix-run/server-runtime` not being a dependency ([#9982](https://github.com/remix-run/remix/pull/9982))
- If you've already opted into Single Fetch, you can change your [Single Fetch type augmentation](https://remix.run/docs/guides/single-fetch#enable-single-fetch-types) in `vite.config.ts` to augment `@remix-run/node` (or `cloudflare`/`deno`) instead of `@remix-run/server-runtime`

### Changes by Package

- [`@remix-run/cloudflare`](https://github.com/remix-run/remix/blob/remix%402.X.Y/packages/remix-cloudflare/CHANGELOG.md#2XY)
- [`@remix-run/deno`](https://github.com/remix-run/remix/blob/remix%402.X.Y/packages/remix-deno/CHANGELOG.md#2XY)
- [`@remix-run/dev`](https://github.com/remix-run/remix/blob/remix%402.X.Y/packages/remix-dev/CHANGELOG.md#2XY)
- [`@remix-run/node`](https://github.com/remix-run/remix/blob/remix%402.X.Y/packages/remix-node/CHANGELOG.md#2XY)
- [`@remix-run/server-runtime`](https://github.com/remix-run/remix/blob/remix%402.X.Y/packages/remix-server-runtime/CHANGELOG.md#2XY)

**Full Changelog**: [`v2.12.0...v2.12.1`](https://github.com/remix-run/remix/compare/[email protected]@2.12.1)

## v2.12.0

Date: 2024-09-09
Expand Down
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@
- twhitbeck
- tylerbrostrom
- udasitharani
- udohjeremiah
- uerkw
- uhoh-itsmaciek
- unhackit
Expand Down
2 changes: 1 addition & 1 deletion docs/file-conventions/root.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export function ErrorBoundary() {

Because your `Layout` component is used in both success and error flows, this same restriction holds. If you need to fork logic in your `Layout` depending on if it was a successful request or not, you can use `useRouteLoaderData("root")` and `useRouteError()`.

<docs-warn>Because your `<Layout>` component is used for rendering the `ErrorBoundary`, you should be _very defensive_ to ensure that you can render your `ErrorBoundary` without encountering any render errors. If your `Layout` throws another error trying to render the boundary, then it can't can't be used and your UI will fall back to the very minimal built-in default `ErrorBoundary`.</docs-warn>
<docs-warn>Because your `<Layout>` component is used for rendering the `ErrorBoundary`, you should be _very defensive_ to ensure that you can render your `ErrorBoundary` without encountering any render errors. If your `Layout` throws another error trying to render the boundary, then it can't be used and your UI will fall back to the very minimal built-in default `ErrorBoundary`.</docs-warn>

```tsx filename="app/root.tsx" lines=[6-7,19-29,32-34]
export function Layout({
Expand Down
17 changes: 7 additions & 10 deletions docs/guides/single-fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,26 +82,25 @@ There are a handful of breaking changes introduced with Single Fetch - some of w

- **[New streaming Data format][streaming-format]**: Single fetch uses a new streaming format under the hood via [`turbo-stream`][turbo-stream], which means that we can stream down more complex data than just JSON
- **No more auto-serialization**: Naked objects returned from `loader` and `action` functions are no longer automatically converted into a JSON `Response` and are serialized as-is over the wire
- **Updates to type inference**: To get the most accurate type inference, you should do two things:
- Add `@remix-run/react/future/single-fetch.d.ts` to the end of your `tsconfig.json`'s `compilerOptions.types` array
- Begin using `unstable_defineLoader`/`unstable_defineAction` in your routes
- This can be done incrementally - you should have _mostly_ accurate type inference in your current state
- [**Updates to type inference**][type-inference-section]: To get the most accurate type inference, you should [augment][augment] Remix's `Future` interface with `unstable_singleFetch: true`
- [**Default revalidation behavior changes to opt-out on GET navigations**][revalidation]: Default revalidation behavior on normal navigations changes from opt-in to opt-out and your server loaders will re-run by default
- [**Opt-in `action` revalidation**][action-revalidation]: Revalidation after an `action` `4xx`/`5xx` `Response` is now opt-in, versus opt-out

## Adding a New Route with Single Fetch

With Single Fetch enabled, you can go ahead and author routes that take advantage of the more powerful streaming format.

<docs-info>In order to get proper type inference, you first need to add `@remix-run/react/future/single-fetch.d.ts` to the end of your `tsconfig.json`'s `compilerOptions.types` array. You can read more about this in the [Type Inference section][type-inference-section].</docs-info>
<docs-info>In order to get proper type inference, you need to [augment][augment] Remix's `Future` interface with `unstable_singleFetch: true`. You can read more about this in the [Type Inference section][type-inference-section].</docs-info>

With Single Fetch you can return the following data types from your loader: `BigInt`, `Date`, `Error`, `Map`, `Promise`, `RegExp`, `Set`, `Symbol`, and `URL`.

```tsx
// routes/blog.$slug.tsx
import { unstable_defineLoader as defineLoader } from "@remix-run/node";
import type { LoaderFunctionArgs } from "@remix-run/node";

export const loader = defineLoader(async ({ params }) => {
export async function loader({
params,
}: LoaderFunctionArgs) {
const { slug } = params;

const comments = fetchComments(slug);
Expand All @@ -112,7 +111,7 @@ export const loader = defineLoader(async ({ params }) => {
published: blogData.date, // <- Date
comments, // <- Promise
};
});
}

export default function BlogPost() {
const blogData = useLoaderData<typeof loader>();
Expand Down Expand Up @@ -361,8 +360,6 @@ The Remix v2 behavior with Single Fetch enabled is as follows:
}
```

Note: It is _not_ recommended to use `defineLoader`/`defineAction` for externally-accessed resource routes that need to return specific `Response` instances. It's best to just stick with `loader`/`LoaderFunctionArgs` for these cases.

## Additional Details

### Streaming Data Format
Expand Down
2 changes: 1 addition & 1 deletion docs/route/loader.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ Here is a full example showing how you can create utility functions that throw r
```ts filename=app/db.ts
import { json } from "@remix-run/node"; // or cloudflare/deno

export function getInvoice(id, user) {
export function getInvoice(id) {
const invoice = db.invoice.find({ where: { id } });
if (invoice === null) {
throw json("Not Found", { status: 404 });
Expand Down
6 changes: 3 additions & 3 deletions integration/helpers/vite-cloudflare-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"typecheck": "tsc"
},
"dependencies": {
"@remix-run/cloudflare": "2.12.0",
"@remix-run/cloudflare-pages": "2.12.0",
"@remix-run/react": "2.12.0",
"@remix-run/cloudflare": "2.12.1",
"@remix-run/cloudflare-pages": "2.12.1",
"@remix-run/react": "2.12.1",
"isbot": "^4.1.0",
"miniflare": "^3.20231030.4",
"react": "^18.2.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/create-remix/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# `create-remix`

## 2.12.1

No significant changes to this package were made in this release. [See the repo `CHANGELOG.md`](https://github.com/remix-run/remix/blob/main/CHANGELOG.md) for an overview of all changes in v2.12.1.

## 2.12.0

No significant changes to this package were made in this release. [See the repo `CHANGELOG.md`](https://github.com/remix-run/remix/blob/main/CHANGELOG.md) for an overview of all changes in v2.12.0.
Expand Down
2 changes: 1 addition & 1 deletion packages/create-remix/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-remix",
"version": "2.12.0",
"version": "2.12.1",
"description": "Create a new Remix app",
"homepage": "https://remix.run",
"bugs": {
Expand Down
7 changes: 7 additions & 0 deletions packages/remix-architect/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# `@remix-run/architect`

## 2.12.1

### Patch Changes

- Updated dependencies:
- `@remix-run/[email protected]`

## 2.12.0

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/remix-architect/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@remix-run/architect",
"version": "2.12.0",
"version": "2.12.1",
"description": "Architect server request handler for Remix",
"bugs": {
"url": "https://github.com/remix-run/remix/issues"
Expand Down
Loading

0 comments on commit bda73d7

Please sign in to comment.