Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 4 additions & 8 deletions .agents/skills/fix-bug/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,16 @@ pnpm lint
pnpm typecheck
```

### 6. Create a Changeset
### 6. Create a Change file

Create `.changeset/<descriptive-name>.md`:
Create a change file at `packages/<package>/.changes/<type>.<unique-meaningful-name>.md`. `<type>` should be either `patch`, `minor`, `major` or `unstable` to indicate the type of API change being made.

```markdown
---
"react-router": patch
---
Format:

```markdown
fix: <brief description of what was fixed>
```

Use `patch` for bug fixes. Only include packages in the frontmatter that were actually changed.

### 7. Report Results

Summarize:
Expand Down
8 changes: 0 additions & 8 deletions .changeset/README.md

This file was deleted.

32 changes: 0 additions & 32 deletions .changeset/config.json

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/changes-file.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 📝 Change File Check

on:
pull_request:
branches:
- dev
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
name: 📝 Change File Check
# TODO: Temporarily only run on my PRs for testing purposes
if: github.repository == 'remix-run/react-router' && github.event.pull_request.user.login == 'brophdawg11'
runs-on: ubuntu-latest
permissions:
pull-requests: write

steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v6

- name: 📦 Setup pnpm
uses: pnpm/action-setup@v4

- name: ⎔ Setup node
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: pnpm

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

- name: 📝 Check change file and update PR comment
env:
GITHUB_TOKEN: ${{ github.token }}
run: node scripts/changes/check-pr.ts ${{ github.event.pull_request.number }}
2 changes: 1 addition & 1 deletion .github/workflows/integration-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- main
- dev
paths-ignore:
- ".changeset/**"
- "packages/*/.changes/**"
- "decisions/**"
- "docs/**"
- "examples/**"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-pr-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: PR (Base)
on:
pull_request:
paths-ignore:
- ".changeset/**"
- "packages/*/.changes/**"
- "decisions/**"
- "docs/**"
- "examples/**"
Expand Down
39 changes: 35 additions & 4 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# Commits to `dev` push builds to a `preview/dev` branch:
# pnpm install "remix-run/react-router#preview/dev&path:packages/react-router"
#
# Pull Requests create `preview/pr-{number}` branches:
# pnpm install "remix-run/react-router#preview/pr-12345&path:packages/react-router"
#
# Can also be dispatched manually with base/installable branches to provide
# `experimental` branches from PRs or otherwise.

Expand All @@ -20,6 +23,8 @@ on:
installableBranch:
description: Installable Branch
required: true
pull_request:
types: [opened, synchronize, reopened, closed]

concurrency:
# Include `event_name` here because when a pull_request is merged (closed), the
Expand All @@ -30,24 +35,31 @@ concurrency:

jobs:
preview:
if: github.repository == 'remix-run/react-router'
# Don't run on PRs from forked repos
if: github.repository == 'remix-run/react-router' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
runs-on: ubuntu-latest
steps:
- name: Checkout (push)
if: github.event_name == 'push'
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Checkout (pull_request)
if: github.event_name == 'pull_request'
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Checkout (workflow_dispatch)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
ref: ${{ inputs.baseBranch }}

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version-file: "package.json"
cache: pnpm
Expand All @@ -68,6 +80,17 @@ jobs:
git push --force --set-upstream origin preview/dev
echo "💿 pushed installable branch: https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)"

# Build and force push over the PR preview/pr-{number} branch + comment on the PR
- name: Build/push branch (pull_request)
if: github.event_name == 'pull_request' && github.event.pull_request.state == 'open'
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
pnpm run setup-installable-branch preview/pr-${{ github.event.pull_request.number }}
git push --force --set-upstream origin preview/pr-${{ github.event.pull_request.number }}
echo "pushed installable branch: https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)"
pnpm run pr-preview comment ${{ github.event.pull_request.number }} preview/pr-${{ github.event.pull_request.number }}

# Build and normal push for experimental releases to avoid unintended force
# pushes over remote branches in case of a branch name collision
- name: Build/push branch (workflow_dispatch)
Expand All @@ -76,3 +99,11 @@ jobs:
pnpm run setup-installable-branch ${{ inputs.installableBranch }}
git push --set-upstream origin ${{ inputs.installableBranch }}
echo "💿 pushed installable branch: https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)"

# Cleanup PR preview/pr-{number} branches when the PR is closed
- name: Cleanup preview branch
if: github.event_name == 'pull_request' && github.event.pull_request.state == 'closed'
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
pnpm run pr-preview cleanup ${{ github.event.pull_request.number }} preview/pr-${{ github.event.pull_request.number }}
9 changes: 2 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,13 @@ export default [

Test both states (on/off) for future flags. Don't break existing behavior without a flag.

## Changesets
## Change Files

When making changes that affect users, create a changeset at `.changeset/<unique-meaningful-name>.md`. If iterating on a change that hasn't shipped yet, update the existing changeset file instead of creating a new one.
When making changes that affect users, create a change file at `packages/<package>/.changes/<type>.<unique-meaningful-name>.md`. `<type>` should be either `patch`, `minor`, `major` or `unstable` to indicate the type of API change being made. If iterating on a change that hasn't shipped yet, update the existing change file instead of creating a new one.

Format:

```markdown
---
"react-router": patch
"@react-router/dev": minor
---

Brief description of the change

- Additional details if needed
Expand Down
2 changes: 1 addition & 1 deletion GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ This table gives a high-level overview of the stages, but please see the individ
- Because the alpha release may contain other work committed to `dev` but not yet released in a stable version, it may not be ideal for testing in all cases
- In these cases, PR authors may also add the contents for a `.patch` file in a comment that folks can use via [patch-package](https://www.npmjs.com/package/patch-package) or [pnpm patch](https://pnpm.io/cli/patch)
- Feedback from alpha testers is considered essential for further progress
- The PR should also contain a changeset documenting the new API for the release notes
- The PR should also contain a changes file documenting the new API for the release notes
- SC members will review and approve the PR via GitHub reviews
- Approval at this stage communicates:
- The feature is valuable for React Router
Expand Down
13 changes: 13 additions & 0 deletions docs/community/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,19 @@ All commits that fix bugs or add features need one or more tests.

<docs-error>Do not merge code without tests!</docs-error>

### Change Files

In order to facilitate release notes generation, every PR with a user-facing impact should include one or more change files. You can generate these vis `pnpm run changes:add` (requires node 24+).

This tool will generate change files in the relevant `packages/<package>/.changes/` directories. Change files are markdown files with a short description of the change. They should be named using the format `<type>.<short-description>.md` where type is either `patch`, `minor`, `major`, or `unstable`. For example:

```sh
patch.fix-fetcher-redirects.md
minor.add-some-new-api.md
major.require-node-24.md
unstable.update-unstable-api.md
```

### Docs + Examples

All commits that change or add to the API must be done in a pull request that also updates all relevant examples and docs.
Expand Down
13 changes: 3 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"scripts": {
"build": "pnpm run --filter=\"./packages/**/*\" build",
"watch": "pnpm build && pnpm run --filter=\"./packages/**/*\" --parallel build --watch",
"changes:add": "node ./scripts/changes/add.ts",
"changes:publish": "node ./scripts/changes/publish.ts",
"changes:pr": "node ./scripts/changes/pr.ts",
"changes:preview": "node ./scripts/changes/version.ts --preview",
Expand All @@ -19,6 +20,7 @@
"format:check": "prettier --ignore-path .prettierignore --check .",
"lint": "eslint --cache .",
"playground": "node ./scripts/playground.js",
"pr-preview": "node ./scripts/pr-preview.ts",
"prerelease": "pnpm build",
"setup-installable-branch": "node scripts/setup-installable-branch.ts",
"test": "jest",
Expand All @@ -31,12 +33,7 @@
"playwright:integration": "playwright test --config ./integration/playwright.config.ts",
"vite-ecosystem-ci:build": "pnpm build",
"vite-ecosystem-ci:before-test": "pnpm playwright install",
"vite-ecosystem-ci:test": "pnpm playwright:integration --project=chromium && pnpm clean:integration",
"changeset": "changeset",
"__disabled_release": "changeset publish",
"__disabled_changeset:version": "changeset version && node ./scripts/remove-prerelease-changelogs.mjs",
"__disabled_publish": "node scripts/publish.js",
"__disabled_version": "node ./scripts/version"
"vite-ecosystem-ci:test": "pnpm playwright:integration --project=chromium && pnpm clean:integration"
},
"jest": {
"projects": [
Expand All @@ -58,12 +55,10 @@
"@babel/preset-env": "^7.27.2",
"@babel/preset-react": "^7.27.1",
"@babel/preset-typescript": "^7.27.1",
"@changesets/cli": "^2.26.2",
"@eslint/compat": "^2.0.3",
"@manypkg/get-packages": "^1.1.3",
"@mdx-js/rollup": "^3.1.0",
"@playwright/test": "^1.58.2",
"@remix-run/changelog-github": "^0.0.5",
"@types/jest": "^29.5.4",
"@types/jsdom": "^21.1.1",
"@types/react": "catalog:",
Expand Down Expand Up @@ -106,8 +101,6 @@
},
"pnpm": {
"patchedDependencies": {
"@changesets/get-dependents-graph@1.3.6": "patches/@changesets__get-dependents-graph@1.3.6.patch",
"@changesets/assemble-release-plan": "patches/@changesets__assemble-release-plan.patch",
"@mdx-js/rollup": "patches/@mdx-js__rollup.patch"
},
"overrides": {
Expand Down
60 changes: 0 additions & 60 deletions patches/@changesets__assemble-release-plan.patch

This file was deleted.

Loading
Loading