Skip to content

Commit

Permalink
Lift startViewTransition implementation to react-router-dom (#10928)
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Oct 13, 2023
1 parent b916689 commit c48341d
Show file tree
Hide file tree
Showing 9 changed files with 358 additions and 235 deletions.
6 changes: 6 additions & 0 deletions .changeset/lift-start-view-transition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"react-router-dom": patch
"react-router": patch
---

Export a separate `RouterProvider` from `react-router-dom` with `startViewTransition` support
1 change: 0 additions & 1 deletion .changeset/start-view-transition.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
"react-router-dom": minor
"react-router": minor
"@remix-run/router": minor
---

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,16 @@
"none": "48.3 kB"
},
"packages/react-router/dist/react-router.production.min.js": {
"none": "15.2 kB"
"none": "13.9 kB"
},
"packages/react-router/dist/umd/react-router.production.min.js": {
"none": "17.61 kB"
"none": "16.3 kB"
},
"packages/react-router-dom/dist/react-router-dom.production.min.js": {
"none": "13.61 kB"
"none": "15.9 kB"
},
"packages/react-router-dom/dist/umd/react-router-dom.production.min.js": {
"none": "19.91 kB"
"none": "22.1 kB"
}
}
}
17 changes: 12 additions & 5 deletions packages/react-router-dom/__tests__/exports-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,23 @@ let nonReExportedKeys = new Set([
"UNSAFE_useRoutesImpl",
]);

let modifiedExports = new Set(["RouterProvider"]);

describe("react-router-dom", () => {
for (let key in ReactRouter) {
if (!nonReExportedKeys.has(key)) {
it(`re-exports ${key} from react-router`, () => {
expect(ReactRouterDOM[key]).toBe(ReactRouter[key]);
});
} else {
if (nonReExportedKeys.has(key)) {
it(`does not re-export ${key} from react-router`, () => {
expect(ReactRouterDOM[key]).toBe(undefined);
});
} else if (modifiedExports.has(key)) {
it(`re-exports a different version of ${key}`, () => {
expect(ReactRouterDOM[key]).toBeDefined();
expect(ReactRouterDOM[key]).not.toBe(ReactRouter[key]);
});
} else {
it(`re-exports ${key} from react-router`, () => {
expect(ReactRouterDOM[key]).toBe(ReactRouter[key]);
});
}
}
});

0 comments on commit c48341d

Please sign in to comment.