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 Apr 30, 2024
2 parents b579661 + 94f7fb7 commit b000b21
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 29 deletions.
33 changes: 23 additions & 10 deletions .github/workflows/release-experimental.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
name: 🚀 Release (experimental)
name: 🧪 Experimental Release

on:
push:
tags:
- "v0.0.0-experimental*"
workflow_dispatch:
inputs:
branch:
required: true

concurrency: ${{ github.workflow }}-${{ github.ref }}

env:
CI: true

jobs:
release:
name: 🧑‍🔬 Experimental Release
if: |
github.repository == 'remix-run/react-router' &&
contains(github.ref, 'experimental')
experimental:
name: 🧪 Experimental Release
if: github.repository == 'remix-run/react-router'
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
# checkout using a custom token so that we can push later on
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: 📦 Setup pnpm
Expand All @@ -28,12 +31,22 @@ jobs:
- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
cache: pnpm
node-version-file: ".nvmrc"
cache: "pnpm"

- name: 📥 Install deps
run: pnpm install --frozen-lockfile

- name: ⤴️ Update version
run: |
git config --local user.email "[email protected]"
git config --local user.name "Remix Run Bot"
SHORT_SHA=$(git rev-parse --short HEAD)
NEXT_VERSION=0.0.0-experimental-${SHORT_SHA}
git checkout -b experimental/${NEXT_VERSION}
pnpm run version ${NEXT_VERSION}
git push origin --tags
- name: 🏗 Build
run: pnpm build

Expand Down
8 changes: 8 additions & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
- chensokheng
- chrisngobanh
- christopherchudzicki
- ChristophP
- christowiz
- codeape2
- coryhouse
Expand All @@ -60,6 +61,7 @@
- david-bezero
- david-crespo
- decadentsavant
- dgrijuela
- DigitalNaut
- dmitrytarassov
- dokeet
Expand All @@ -75,6 +77,7 @@
- ericschn
- faergeek
- FilipJirsak
- focusotter
- frontsideair
- fyzhu
- fz6m
Expand Down Expand Up @@ -125,6 +128,8 @@
- kachun333
- Kakamotobi
- kantuni
- kapil-patel
- kapilepatel
- KaranRandhir
- kark
- KAROTT7
Expand Down Expand Up @@ -174,9 +179,11 @@
- mikib0
- minami-minami
- minthulim
- mlewando
- modex98
- morleytatro
- ms10596
- mtliendo
- ned-park
- nilubisan
- Nismit
Expand All @@ -202,6 +209,7 @@
- ryanflorence
- ryanhiebert
- sanketshah19
- saul-atomrigs
- sbolel
- scarf005
- senseibarni
Expand Down
4 changes: 2 additions & 2 deletions docs/components/link.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function EditContact() {
}
```

Please note that `relative: "path"` only impacts the resolution of a relative path. It does not change the the "starting" location for that relative path resolution. This resolution is always relative to the current location in the Route hierarchy (i.e., the route `Link` is rendered in).
Please note that `relative: "path"` only impacts the resolution of a relative path. It does not change the "starting" location for that relative path resolution. This resolution is always relative to the current location in the Route hierarchy (i.e., the route `Link` is rendered in).

If you wish to use path-relative routing against the current URL instead of the route hierarchy, you can do that with the current [`location`][use-location] and the `URL` constructor (note the trailing slash behavior):

Expand All @@ -107,7 +107,7 @@ new URL("..", window.origin + location.pathname);

// With trailing slashes:
new URL(".", window.origin + location.pathname + "/");
// 'https://remix.run/docs/en/main/start/future-flags/'
// 'https://remix.run/docs/en/main/start/quickstart/'
new URL("..", window.origin + location.pathname + "/");
// 'https://remix.run/docs/en/main/start/'
```
Expand Down
2 changes: 1 addition & 1 deletion docs/route/loader.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Note that the APIs here are not React Router specific, but rather standard web o

## `loader.hydrate`

If you are [Server-Side Rendering][ssr] and leveraging the `fututre.v7_partialHydration` flag for [Partial Hydration][partialhydration], then you may wish to opt-into running a route `loader` on initial hydration _even though it has hydration data_ (for example, to let a user prime a cache with the hydration data). To force a `loader` to run on hydration in a partial hydration scenario, you can set a `hydrate` property on the `loader` function:
If you are [Server-Side Rendering][ssr] and leveraging the `future.v7_partialHydration` flag for [Partial Hydration][partialhydration], then you may wish to opt-into running a route `loader` on initial hydration _even though it has hydration data_ (for example, to let a user prime a cache with the hydration data). To force a `loader` to run on hydration in a partial hydration scenario, you can set a `hydrate` property on the `loader` function:

## Returning Responses

Expand Down
6 changes: 3 additions & 3 deletions docs/routers/create-browser-router.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,14 @@ const routes [
];

let router = createBrowserRouter(routes, {
unstable_dataStrategy({ request, params, matches }) {
async unstable_dataStrategy({ request, params, matches }) {
// Run middleware sequentially and let them add data to `context`
let context = {};
for (match of matches) {
for (const match of matches) {
if (match.route.handle?.middleware) {
await match.route.handle.middleware({ request, params }, context);
}
});
}

// Run loaders in parallel with the `context` value
return Promise.all(
Expand Down
10 changes: 5 additions & 5 deletions docs/start/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -768,14 +768,14 @@ export default function EditContact() {
aria-label="First name"
type="text"
name="first"
defaultValue={contact.first}
defaultValue={contact?.first}
/>
<input
placeholder="Last"
aria-label="Last name"
type="text"
name="last"
defaultValue={contact.last}
defaultValue={contact?.last}
/>
</p>
<label>
Expand All @@ -784,7 +784,7 @@ export default function EditContact() {
type="text"
name="twitter"
placeholder="@jack"
defaultValue={contact.twitter}
defaultValue={contact?.twitter}
/>
</label>
<label>
Expand All @@ -794,14 +794,14 @@ export default function EditContact() {
aria-label="Avatar URL"
type="text"
name="avatar"
defaultValue={contact.avatar}
defaultValue={contact?.avatar}
/>
</label>
<label>
<span>Notes</span>
<textarea
name="notes"
defaultValue={contact.notes}
defaultValue={contact?.notes}
rows={6}
/>
</label>
Expand Down
16 changes: 8 additions & 8 deletions docs/upgrading/v6-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ import {

// 3️⃣ Router singleton created
const router = createBrowserRouter([
{ path: "*", Component: Root },
{ path: "*", element: <Root /> },
]);

// 4️⃣ RouterProvider added
Expand Down Expand Up @@ -133,12 +133,12 @@ function UserApp() {

### Start lifting routes and leveraging the data APIs

Let's start with the `/` route for the `<Home>` component. All we need to do is lift the `<Route>` definition up to the data router:
Let's start with the `/` route for the `<Home>` element. All we need to do is lift the `<Route>` definition up to the data router:

```tsx lines=[2,13]
const router = createBrowserRouter([
{ path: "/", Component: Home }, // 🆕
{ path: "*", Component: Root },
{ path: "/", element: <Home /> }, // 🆕
{ path: "*", element: <Root /> },
]);

export default function App() {
Expand All @@ -162,18 +162,18 @@ Now let's look at lifting the Blog App upwards, but still doing it one leaf rout

```tsx lines=[3-12,23,32]
const router = createBrowserRouter([
{ path: "/", Component: Home },
{ path: "/", element: <Home /> },
{
// Lifted blog splat route
path: "/blog/*",
children: [
// New blog index route
{ index: true, Component: () => <h1>Blog Index</h1> },
{ index: true, element: <h1>Blog Index</h1> },
// Blog subapp splat route added for /blog/posts matching
{ path: "*", Component: BlogApp },
{ path: "*", element: <BlogApp /> },
],
},
{ path: "*", Component: Root },
{ path: "*", element: <Root /> },
]);

export default function App() {
Expand Down

0 comments on commit b000b21

Please sign in to comment.