Skip to content

Commit

Permalink
Merge branch 'dev' into pedro/vite-plugin-react
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish committed May 9, 2024
2 parents 268e2d9 + 45c7552 commit cef3e66
Show file tree
Hide file tree
Showing 319 changed files with 5,449 additions and 1,771 deletions.
5 changes: 5 additions & 0 deletions .changeset/five-planets-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": patch
---

Fix `dest already exists` error when running `remix vite:build`
5 changes: 5 additions & 0 deletions .changeset/happy-ladybugs-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/react": patch
---

Add `undefined` to `useActionData` type override
5 changes: 0 additions & 5 deletions .changeset/heavy-steaks-remember.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/hot-suits-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": patch
---

Vite: Fix issue resolving critical CSS during development when route files are located outside of the app directory.
5 changes: 5 additions & 0 deletions .changeset/nasty-pandas-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": patch
---

Remove `@remix-run/node` from Vite plugin's `optimizeDeps.include` list since it was unnecessary and resulted in Vite warnings when not depending on this package.
5 changes: 5 additions & 0 deletions .changeset/nasty-vans-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/react": patch
---

Allow a nonce to be set on single fetch stream transfer inline scripts
5 changes: 5 additions & 0 deletions .changeset/rare-dodos-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/server-runtime": patch
---

Don't log thrown response stubs via `handleError` in Single Fetch
5 changes: 5 additions & 0 deletions .changeset/rich-spoons-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/server-runtime": patch
---

Automatically wrap resource route naked object returns in `json()` for back-compat in v2 (and log deprecation warning)
50 changes: 50 additions & 0 deletions .changeset/rotten-geckos-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
"@remix-run/cloudflare": patch
"@remix-run/deno": patch
"@remix-run/node": patch
"@remix-run/react": patch
"@remix-run/server-runtime": patch
---

Typesafety for single-fetch: defineLoader, defineClientLoader, defineAction, defineClientAction

`defineLoader` and `defineAction` are helpers for authoring `loader`s and `action`s.
They are identity functions; they don't modify your loader or action at runtime.
Rather, they exist solely for typesafety by providing types for args and by ensuring valid return types.

```ts
export let loader = defineLoader(({ request }) => {
// ^? Request
return { a: 1, b: () => 2 };
// ^ type error: `b` is not serializable
});
```

Note that `defineLoader` and `defineAction` are not technically necessary for defining loaders and actions if you aren't concerned with typesafety:

```ts
// this totally works! and typechecking is happy too!
export let loader = () => {
return { a: 1 };
};
```

This means that you can opt-in to `defineLoader` incrementally, one loader at a time.

You can return custom responses via the `json`/`defer` utilities, but doing so will revert back to the old JSON-based typesafety mechanism:

```ts
let loader1 = () => {
return { a: 1, b: new Date() };
};
let data1 = useLoaderData<typeof loader1>();
// ^? {a: number, b: Date}

let loader2 = () => {
return json({ a: 1, b: new Date() }); // this opts-out of turbo-stream
};
let data2 = useLoaderData<typeof loader2>();
// ^? JsonifyObject<{a: number, b: Date}> which is really {a: number, b: string}
```

You can also continue to return totally custom responses with `Response` though this continues to be outside of the typesystem since the built-in `Response` type is not generic
6 changes: 0 additions & 6 deletions .changeset/shy-buttons-buy.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/single-fetch-client-loaders.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/single-fetch-spa-mode.md

This file was deleted.

15 changes: 0 additions & 15 deletions .changeset/single-fetch.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/slimy-shrimps-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": patch
---

Clean up redundant `?client-route=1` imports in development
5 changes: 5 additions & 0 deletions .changeset/slow-peaches-matter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/server-runtime": patch
---

Pass `response` stub to resource route handlerså when single fetch is enabled
5 changes: 5 additions & 0 deletions .changeset/tame-otters-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": patch
---

Ensure Babel config files are not referenced when applying the `react-refresh` Babel transform within the Remix Vite plugin
6 changes: 3 additions & 3 deletions .github/workflows/test-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
uses: ./.github/workflows/shared-test-integration.yml
with:
os: "ubuntu-latest"
node_version: '[18, "20.5.1"]'
node_version: "[18, 20]"
browser: '["chromium", "firefox"]'

integration-windows:
Expand All @@ -54,7 +54,7 @@ jobs:
uses: ./.github/workflows/shared-test-integration.yml
with:
os: "windows-latest"
node_version: '[18, "20.5.1"]'
node_version: "[18, 20]"
browser: '["msedge"]'

integration-macos:
Expand All @@ -63,5 +63,5 @@ jobs:
uses: ./.github/workflows/shared-test-integration.yml
with:
os: "macos-latest"
node_version: '[18, "20.5.1"]'
node_version: "[18, 20]"
browser: '["webkit"]'
4 changes: 2 additions & 2 deletions .github/workflows/test-pr-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ jobs:
uses: ./.github/workflows/shared-test-unit.yml
with:
os: "ubuntu-latest"
node_version: '["20.5.1"]'
node_version: "[20]"

integration-chromium:
name: "👀 Integration Test"
if: github.repository == 'remix-run/remix'
uses: ./.github/workflows/shared-test-integration.yml
with:
os: "ubuntu-latest"
node_version: '["20.5.1"]'
node_version: "[20]"
browser: '["chromium"]'
8 changes: 4 additions & 4 deletions .github/workflows/test-pr-windows-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
uses: ./.github/workflows/shared-test-unit.yml
with:
os: "windows-latest"
node_version: '["20.5.1"]'
node_version: "[20]"

integration-firefox:
name: "👀 Integration Test"
if: github.repository == 'remix-run/remix'
uses: ./.github/workflows/shared-test-integration.yml
with:
os: "ubuntu-latest"
node_version: '["20.5.1"]'
node_version: "[20]"
browser: '["firefox"]'

integration-msedge:
Expand All @@ -37,7 +37,7 @@ jobs:
uses: ./.github/workflows/shared-test-integration.yml
with:
os: "windows-latest"
node_version: '["20.5.1"]'
node_version: "[20]"
browser: '["msedge"]'

integration-webkit:
Expand All @@ -46,5 +46,5 @@ jobs:
uses: ./.github/workflows/shared-test-integration.yml
with:
os: "macos-latest"
node_version: '["20.5.1"]'
node_version: "[20]"
browser: '["webkit"]'

0 comments on commit cef3e66

Please sign in to comment.