Skip to content

Commit

Permalink
Merge branch 'release-6.4.3' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Nov 1, 2022
2 parents 328718e + 54c3e39 commit a9b75e8
Show file tree
Hide file tree
Showing 34 changed files with 492 additions and 135 deletions.
6 changes: 0 additions & 6 deletions .changeset/cyan-poems-clean.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fluffy-buttons-push.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/funny-hotels-repeat.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/funny-shirts-admire.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/green-dragons-vanish.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/hot-badgers-grow.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/metal-drinks-melt.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/moody-bulldogs-enjoy.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/nine-apricots-notice.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/odd-kids-buy.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/smart-ants-decide.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/weak-lizards-occur.md

This file was deleted.

14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

comment:
needs: [release]
name: 📝 Comment on related issues and pull requests
if: github.repository == 'remix-run/react-router'
uses: remix-run/react-router/.github/workflows/release-comments.yml@main
with:
ref: ${{ github.ref }}
# comment:
# needs: [release]
# name: 📝 Comment on related issues and pull requests
# if: github.repository == 'remix-run/react-router'
# uses: remix-run/react-router/.github/workflows/release-comments.yml@main
# with:
# ref: ${{ github.ref }}
5 changes: 5 additions & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
- abdallah-nour
- abhi-kr-2100
- adamdotjs
- AchThomas
- Ajayff4
- alany411
- alexlbr
- AmRo045
- andreiduca
- arnassavickas
- aroyan
- avipatel97
- awreese
Expand All @@ -30,6 +32,7 @@
- dauletbaev
- david-crespo
- dokeet
- Drishtantr
- edwin177
- ekaansharora
- elanis
Expand Down Expand Up @@ -75,6 +78,7 @@
- loun4
- lqze
- lukerSpringTree
- Manc
- manzano78
- marc2332
- markivancho
Expand Down Expand Up @@ -109,6 +113,7 @@
- SkayuX
- souzasmatheus
- srmagura
- stasundr
- tanayv
- theostavrides
- thisiskartik
Expand Down
2 changes: 2 additions & 0 deletions docs/hooks/use-route-loader-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ const user = useRouteLoaderData("root");
```

The only data available is the routes that are currently rendered. If you ask for data from a route that is not currently rendered, the hook will return `undefined`.

[pickingarouter]: ../routers/picking-a-router
11 changes: 10 additions & 1 deletion docs/routers/picking-a-router.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ new: true

# Picking a Router

While your app will only use a single router, several routers are available depending on the environment you're app is running in. This document should help you figure out which one to use.
While your app will only use a single router, several routers are available depending on the environment your app is running in. This document should help you figure out which one to use.

## Using v6.4 Data APIs

Expand Down Expand Up @@ -68,6 +68,15 @@ If you're not interested in the data APIs, you can continue to use [`<BrowserRou

Testing components that use React Router APIs is easiest with [`createMemoryRouter`][creatememoryrouter] or [`<MemoryRouter>`][memoryrouter] instead of the routers you use in your app that require DOM history APIs.

Some of the React Router APIs internally use `fetch`, which is only supported starting from Node.js v18. If your project uses v17 or lower, you should add a `fetch` polyfill manually. One way to do that, is to install [`whatwg-fetch`](https://www.npmjs.com/package/whatwg-fetch) and add it to your `jest.config.js` file like so:

```js
module.exports = {
setupFiles: ["whatwg-fetch"],
// ...rest of the config
};
```

## React Native

You will use [`<NativeRouter>`][nativerouter] from React Native projects.
Expand Down
4 changes: 2 additions & 2 deletions docs/start/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ order: 2

# Tutorial

Welcome to the tutorial! We'll be building a small, but feature-rich app that let's you keep track of your contacts. We expect it to take between 30-60m if you're following along.
Welcome to the tutorial! We'll be building a small, but feature-rich app that lets you keep track of your contacts. We expect it to take between 30-60m if you're following along.

<img class="tutorial" src="/_docs/tutorial/15.webp" />

Expand Down Expand Up @@ -519,7 +519,7 @@ const router = createBrowserRouter([

👉 **Access and render the data**

```jsx filename=src/routes/root.jsx lines=[4,11,19-39]
```jsx filename=src/routes/root.jsx lines=[4,11,19-40]
import {
Outlet,
Link,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@
"node": ">=14"
},
"filesize": {
"packages/router/dist/router.js": {
"none": "108 kB"
"packages/router/dist/router.umd.min.js": {
"none": "34 kB"
},
"packages/react-router/dist/react-router.production.min.js": {
"none": "12.5 kB"
Expand Down
8 changes: 8 additions & 0 deletions packages/react-router-dom-v5-compat/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# `react-router-dom-v5-compat`

## 6.4.3

### Patch Changes

- Updated dependencies:
- `react-router-dom@6.4.3`
- `react-router@6.4.3`

## 6.4.2

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/react-router-dom-v5-compat/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-router-dom-v5-compat",
"version": "6.4.2",
"version": "6.4.3",
"description": "Migration path to React Router v6 from v4/5",
"keywords": [
"react",
Expand All @@ -24,7 +24,7 @@
"types": "./dist/index.d.ts",
"dependencies": {
"history": "^5.3.0",
"react-router": "6.4.2"
"react-router": "6.4.3"
},
"peerDependencies": {
"react": ">=16.8",
Expand Down
13 changes: 13 additions & 0 deletions packages/react-router-dom/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# `react-router-dom`

## 6.4.3

### Patch Changes

- Fix hrefs generated for `createHashRouter` ([#9409](https://github.com/remix-run/react-router/pull/9409))
- fix encoding/matching issues with special chars ([#9477](https://github.com/remix-run/react-router/pull/9477), [#9496](https://github.com/remix-run/react-router/pull/9496))
- Properly support `index` routes with a `path` in `useResolvedPath` ([#9486](https://github.com/remix-run/react-router/pull/9486))
- Respect `relative=path` prop on `NavLink` ([#9453](https://github.com/remix-run/react-router/pull/9453))
- Fix `NavLink` behavior for root urls ([#9497](https://github.com/remix-run/react-router/pull/9497))
- Updated dependencies:
- `@remix-run/router@1.0.3`
- `react-router@6.4.3`

## 6.4.2

### Patch Changes
Expand Down
51 changes: 51 additions & 0 deletions packages/react-router-dom/__tests__/nav-link-active-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,57 @@ describe("NavLink", () => {

expect(anchors.map((a) => a.props.className)).toEqual(["active", ""]);
});

it("does not automatically apply to root non-layout segments", () => {
let renderer: TestRenderer.ReactTestRenderer;
TestRenderer.act(() => {
renderer = TestRenderer.create(
<MemoryRouter initialEntries={["/home"]}>
<Routes>
<Route index element={<h1>Root</h1>} />
<Route
path="home"
element={<NavLink to="/">Root</NavLink>}
></Route>
</Routes>
</MemoryRouter>
);
});

let anchor = renderer.root.findByType("a");

expect(anchor.props.className).not.toMatch("active");
});

it("does not automatically apply to root layout segments", () => {
let renderer: TestRenderer.ReactTestRenderer;
TestRenderer.act(() => {
renderer = TestRenderer.create(
<MemoryRouter initialEntries={["/home"]}>
<Routes>
<Route
path="/"
element={
<>
<h1>Root</h1>
<Outlet />
</>
}
>
<Route
path="home"
element={<NavLink to="/">Root</NavLink>}
></Route>
</Route>
</Routes>
</MemoryRouter>
);
});

let anchor = renderer.root.findByType("a");

expect(anchor.props.className).not.toMatch("active");
});
});

describe("when it matches just the beginning but not to the end", () => {
Expand Down

0 comments on commit a9b75e8

Please sign in to comment.