Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
20df571
feat: configure export conditions properly
jacob-ebey Oct 16, 2024
3739e7e
Merge branch 'dev' of https://github.com/remix-run/react-router into …
jacob-ebey Oct 16, 2024
e0f35d8
update lockfile
jacob-ebey Oct 16, 2024
145ccfc
revert prettier dep
jacob-ebey Oct 16, 2024
a11b298
revert prettier version
jacob-ebey Oct 17, 2024
841acd3
feat: add ESM build for architect, express and node packages
jacob-ebey Oct 17, 2024
1e3820b
update HMR test to ignore warning log
jacob-ebey Oct 18, 2024
de17f6d
chore: add module-sync export condition
jacob-ebey Oct 18, 2024
adbe17f
fix: react-router should not reference itself, that's weird (use tsco…
jacob-ebey Oct 18, 2024
8ee2aa5
chore: add turborepo to help cache build for faster integration test …
jacob-ebey Oct 18, 2024
259eb86
update import conditions specifically for node to avoid dual module h…
jacob-ebey Oct 18, 2024
2f78fd7
update conditions to "default" instead of "require" so something alwa…
jacob-ebey Oct 18, 2024
ecb306e
Update e2e test warning assertion
brophdawg11 Oct 18, 2024
c5119e8
add vite ignore comment for dynamic import
jacob-ebey Oct 18, 2024
4505a29
update optimizeDeps
jacob-ebey Oct 21, 2024
64dac52
update turbo
jacob-ebey Oct 21, 2024
cd804bd
add wireit for caching
jacob-ebey Oct 23, 2024
e0b4c6a
add wireit caching
jacob-ebey Oct 23, 2024
23d2783
Merge branch 'dev' of https://github.com/remix-run/react-router into …
jacob-ebey Oct 23, 2024
9495f7b
add cache to other workflows
jacob-ebey Oct 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/shared-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
node-version-file: ".nvmrc"
cache: "pnpm"

- uses: google/wireit@setup-github-actions-caching/v2

- name: Disable GitHub Actions Annotations
run: |
echo "::remove-matcher owner=tsc::"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/shared-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:
node-version: ${{ matrix.node }}
cache: "pnpm"

- uses: google/wireit@setup-github-actions-caching/v2

- name: Disable GitHub Actions Annotations
run: |
echo "::remove-matcher owner=tsc::"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:
cache: pnpm
check-latest: true

- uses: google/wireit@setup-github-actions-caching/v2

- name: Disable GitHub Actions Annotations
run: |
echo "::remove-matcher owner=tsc::"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ node_modules/
/packages/*/dist/
/packages/*/LICENSE.md

.wireit
.eslintcache
.tmp
/.env
Expand Down
12 changes: 12 additions & 0 deletions build.utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export function createBanner(packageName: string, version: string) {
return `/**
* ${packageName} v${version}
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/`;
}
6 changes: 4 additions & 2 deletions integration/helpers/playwright-fixture.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import cp from "node:child_process";
import type { Page, Response, Request } from "@playwright/test";
import { test } from "@playwright/test";
import cheerio from "cheerio";
import { load } from "cheerio";
import prettier from "prettier";

let cheerio = load("");

import type { AppFixture } from "./create-fixture.js";

export class PlaywrightFixture {
Expand Down Expand Up @@ -239,7 +241,7 @@ export function selectHtml(source: string, selector: string) {
return prettyHtml(cheerio.html(el)).trim();
}

export function prettyHtml(source: string): string {
export function prettyHtml(source: string) {
return prettier.format(source, { parser: "html" });
}

Expand Down
11 changes: 9 additions & 2 deletions integration/vite-spa-mode-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,15 @@ test.describe("SPA Mode", () => {
expect(await page.locator("[data-root]").textContent()).toBe("Root");
expect(await page.locator("[data-index]").textContent()).toBe("Index");

// Hydrates without issues
expect(logs).toEqual([]);
// Hydrates without issues - this message is expected due to the nested <Routes>
expect(logs).toEqual([
'You rendered descendant <Routes> (or called `useRoutes()`) at "/" ' +
'(under <Route path="">) but the parent route path has no trailing "*". ' +
"This means if you navigate deeper, the parent won't match anymore and " +
"therefore the child routes will never render." +
"\n\n" +
'Please change the parent <Route path=""> to <Route path="/*">.',
]);
});

test("wraps default root HydrateFallback in user-provided Layout", async ({
Expand Down
10 changes: 1 addition & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@remix-run/react-router",
"private": true,
"scripts": {
"build": "rollup -c",
"build": "pnpm run --filter=\"./packages/**/*\" build",
"clean": "git clean -fdX .",
"clean:build": "git clean -fdx -e node_modules .",
"clean:integration": "node ./integration/helpers/cleanup.mjs",
Expand Down Expand Up @@ -57,10 +57,6 @@
"@octokit/rest": "^18.12.0",
"@playwright/test": "^1.33.0",
"@remix-run/changelog-github": "^0.0.5",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-node-resolve": "^11.0.1",
"@rollup/plugin-replace": "^4.0.0",
"@rollup/plugin-typescript": "^8.5.0",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.5.2",
Expand Down Expand Up @@ -104,10 +100,6 @@
"remark-gfm": "3.0.1",
"remark-parse": "^10.0.1",
"remark-stringify": "^10.0.2",
"rollup": "^2.79.1",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-prettier": "^2.3.0",
"rollup-plugin-terser": "^7.0.2",
"semver": "^7.5.4",
"tslib": "^2.6.2",
"type-fest": "^2.19.0",
Expand Down
35 changes: 31 additions & 4 deletions packages/react-router-architect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,38 @@
"typings": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
"node": {
"types": "./dist/index.d.ts",
"module-sync": "./dist/index.mjs",
"default": "./dist/index.js"
},
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"default": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"./package.json": "./package.json"
},
"scripts": {
"tsc": "tsc"
"build": "wireit"
},
"wireit": {
"build": {
"command": "tsup",
"files": [
"sessions/**",
"*.ts",
"tsconfig.json",
"package.json"
],
"output": [
"dist/**"
]
}
},
"dependencies": {
"@architect/functions": "^5.2.0",
Expand All @@ -35,7 +60,9 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router": "workspace:*",
"typescript": "^5.1.0"
"tsup": "^8.3.0",
"typescript": "^5.1.6",
"wireit": "0.14.9"
},
"peerDependencies": {
"@react-router/node": "workspace:^",
Expand Down
56 changes: 0 additions & 56 deletions packages/react-router-architect/rollup.config.js

This file was deleted.

21 changes: 21 additions & 0 deletions packages/react-router-architect/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { defineConfig } from "tsup";

// @ts-ignore - out of scope
import { createBanner } from "../../build.utils.js";

import pkg from "./package.json";

const entry = ["index.ts"];

export default defineConfig([
{
clean: true,
entry,
format: ["cjs", "esm"],
outDir: "dist",
dts: true,
banner: {
js: createBanner(pkg.name, pkg.version),
},
},
]);
32 changes: 27 additions & 5 deletions packages/react-router-cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,45 @@
"typings": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"default": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"./package.json": "./package.json"
},
"scripts": {
"build": "rollup -c",
"tsc": "tsc"
"build": "wireit"
},
"wireit": {
"build": {
"command": "tsup",
"files": [
"sessions/**",
"*.ts",
"tsconfig.json",
"package.json"
],
"output": [
"dist/**"
]
}
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20230518.0",
"react-router": "workspace:*",
"typescript": "^5.1.0"
"tsup": "^8.3.0",
"typescript": "^5.1.6",
"wireit": "0.14.9"
},
"peerDependencies": {
"@cloudflare/workers-types": "^4.0.0",
"react-router": "workspace:^",
"tsup": "^8.3.0",
"typescript": "^5.1.0"
},
"peerDependenciesMeta": {
Expand Down
55 changes: 0 additions & 55 deletions packages/react-router-cloudflare/rollup.config.js

This file was deleted.

21 changes: 21 additions & 0 deletions packages/react-router-cloudflare/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { defineConfig } from "tsup";

// @ts-ignore - out of scope
import { createBanner } from "../../build.utils.js";

import pkg from "./package.json";

const entry = ["index.ts"];

export default defineConfig([
{
clean: true,
entry,
format: ["cjs", "esm"],
outDir: "dist",
dts: true,
banner: {
js: createBanner(pkg.name, pkg.version),
},
},
]);
Loading