Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a94e237

Browse files
committed
Merge branch 'main' into release-next
2 parents 7b22365 + abfa786 commit a94e237

File tree

2 files changed

+75
-56
lines changed

2 files changed

+75
-56
lines changed

DEVELOPMENT.md

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,64 +6,71 @@ New releases should be created from release branches originating from the `dev`
66

77
- Make sure you've pulled all the changes from GitHub for both `dev` and `main` branches.
88
- Check out the `dev` branch.
9-
- Create a new release branch with the `release-` prefix (eg, `git checkout -b release-next`).
10-
- **IMPORTANT:** The `release-` prefix is important, as this is what triggers our GitHub CI workflow that will ultimately publish the release.
11-
- Branches named `release-experimental` will not trigger our release workflow, as experimental releases handled differently (outlined below).
9+
- Create a new `release-next` branch (eg, `git checkout -b release-next`).
10+
- Technically, any `release-*next*` branch name will work as this is what triggers our GitHub CI workflow that will ultimately publish the release - but we just always use `release-next`
1211
- Merge `main` into the release branch.
1312

1413
Changesets will do most of the heavy lifting for our releases. When changes are made to the codebase, an accompanying changeset file should be included to document the change. Those files will dictate how Changesets will version our packages and what shows up in the changelogs.
1514

1615
### Starting a new pre-release
1716

18-
- Ensure you are on the new `release-*` branch.
17+
- Ensure you are on the new `release-next` branch.
1918
- Enter Changesets pre-release mode using the `pre` tag: `pnpm changeset pre enter pre`.
20-
- Commit the change and push the `release-*` branch to GitHub.
19+
- Commit the change and push the `release-next` branch to GitHub.
2120
- Wait for the release workflow to finish. The Changesets action in the workflow will open a PR that will increment all versions and generate the changelogs.
22-
- Review the updated `CHANGELOG` files and make any adjustments necessary, then merge the PR into the `release-*` branch.
21+
- Check out the PR branch created by changesets locally
22+
- Review the updated `CHANGELOG.md` files in the PR locally and make any adjustments necessary, then merge the PR into the `release-next` branch.
2323
- `find packages -name 'CHANGELOG.md' -mindepth 2 -maxdepth 2 -exec code {} \;`
24-
- Once the PR is merged, the release workflow will publish the updated packages to npm.
24+
- Once the changesets files are in good shape, merge the PR to `release-next`
25+
- Once the PR is merged, the release workflow will publish the updated `X.Y.Z-pre.*` packages to npm.
2526
- At this point, you can begin crafting the release notes for the eventual stable release in the root `CHANGELOG.md` file in the repo
2627
- Copy the template for a new release and update the version numbers and links accordingly
2728
- Copy the relevant changelog entries from all packages into the release notes and adjust accordingly
28-
- Commit these changes directly to the `release-*` branch - they will not trigger a new prerelease since they do not include a changeset
29+
- Commit these changes directly to the `release-next` branch - they will not trigger a new prerelease since they do not include a changeset
2930

3031
### Iterating a pre-release
3132

3233
You may need to make changes to a pre-release prior to publishing a final stable release. To do so:
3334

34-
- Make whatever changes you need.
35+
- Branch off of `release-next` and make whatever changes you need
3536
- Create a new changeset: `pnpm changeset`.
3637
- **IMPORTANT:** This is required even if you ultimately don't want to include these changes in the logs. Remember, changelogs can be edited prior to publishing, but the Changeset version script needs to see new changesets in order to create a new version.
37-
- Commit the changesets and push the `release-*` branch to GitHub.
38+
- Push your branch to GitHub and PR it to `release-next`.
39+
- Once reviewed/approved, merge the PR to the `release-next` branch.
3840
- Wait for the release workflow to finish and the Changesets action to open its PR that will increment all versions.
39-
- Review the PR, make any adjustments necessary, and merge it into the `release-*` branch.
40-
- Once the PR is merged, the release workflow will publish the updated packages to npm.
41+
- Review the PR, make any adjustments necessary, and merge it into the `release-next` branch.
42+
- Once the PR is merged, the release workflow will publish the updated `X.Y.Z-pre.*` packages to npm.
4143
- Make sure you copy over the new changeset contents into stable release notes in the root `CHANGELOG.md` file in the repo
4244

4345
### Publishing the stable release
4446

45-
- Exit Changesets pre-release mode: `pnpm changeset pre exit`.
46-
- Commit the edited pre-release file along with any unpublished changesets, and push the `release-*` branch to GitHub.
47+
- Exit Changesets pre-release mode in the `release-next` branch: `pnpm changeset pre exit`.
48+
- Commit the edited pre-release file along with any unpublished changesets, and push the `release-next` branch to GitHub.
4749
- Wait for the release workflow to finish. The Changesets action in the workflow will open a PR that will increment all versions and generate the changelogs for the stable release.
48-
- Review the updated `CHANGELOG` files and make any adjustments necessary.
50+
- Review the updated `CHANGELOG` files in the PR and make any adjustments necessary.
4951
- `find packages -name 'CHANGELOG.md' -mindepth 2 -maxdepth 2 -exec code {} \;`
5052
- Our automated release process should have removed prerelease entries
5153
- Finalize the release notes
5254
- This should already be in pretty good shape in the root `CHANGELOG.md` file in the repo
5355
- Do a quick double check that all iterated prerelease changesets got copied over
54-
- Merge the PR into the `release-*` branch.
56+
- Merge the PR into the `release-next` branch.
5557
- Once the PR is merged, the release workflow will publish the updated packages to npm.
5658
- Once the release is published:
57-
- Pull the latest `release-*` branch containing the PR you just merged
58-
- Merge the `release-*` branch into `main` **using a non-fast-forward merge** and push it up to GitHub
59-
- `git checkout main; git merge --no-ff release-next`
60-
- Merge the `release-*` branch into `dev` **using a non-fast-forward merge** and push it up to GitHub
61-
- `git checkout dev; git merge --no-ff release-next`
59+
- Pull the latest `release-next` branch containing the PR you just merged
60+
- Merge the `release-next` branch into `main` **using a non-fast-forward merge** and push it up to GitHub
61+
- `git checkout main`
62+
- `git merge --no-ff release-next`
63+
- `git push origin main`
64+
- Merge the `release-next` branch into `dev` **using a non-fast-forward merge** and push it up to GitHub
65+
- `git checkout dev`
66+
- `git merge --no-ff release-next`
67+
- `git push origin dev`
6268
- Convert the `[email protected]` tag to a Release on GitHub with the name `v6.x.y` and add a deep-link to the release heading in `CHANGELOG.md`
69+
- Delete the `release-next` branch locally and on GitHub
6370

6471
### Hotfix releases
6572

66-
Hotfix releases follow the same process as standard releases above, but the `release-*` branch should be branched off latest `main` instead of `dev`. Once the stable hotfix is published, the `release-*` branch should be merged back into both `main` and `dev` just like a normal release.
73+
Hotfix releases follow the same process as standard releases above, but the `release-next` branch should be branched off latest `main` instead of `dev`. Once the stable hotfix is published, the `release-next` branch should be merged back into both `main` and `dev` just like a normal release.
6774

6875
### Experimental releases
6976

docs/routers/create-browser-router.md

Lines changed: 46 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -478,24 +478,16 @@ let router = createBrowserRouter(
478478
path: "/",
479479
Component: Home,
480480
},
481-
{
482-
id: "dashboard",
483-
path: "/dashboard",
484-
},
485-
{
486-
id: "account",
487-
path: "/account",
488-
},
489481
],
490482
{
491483
async unstable_patchRoutesOnMiss({ path, patch }) {
492484
if (path.startsWith("/dashboard")) {
493485
let children = await import("./dashboard");
494-
patch("dashboard", children);
486+
patch(null, children);
495487
}
496488
if (path.startsWith("/account")) {
497489
let children = await import("./account");
498-
patch("account", children);
490+
patch(null, children);
499491
}
500492
},
501493
}
@@ -507,32 +499,52 @@ let router = createBrowserRouter(
507499
If you don't wish to perform your own pseudo-matching, you can leverage the partial `matches` array and the `handle` field on a route to keep the children definitions co-located:
508500

509501
```jsx
510-
let router = createBrowserRouter([
511-
{
512-
path: "/",
513-
Component: Home,
514-
},
515-
{
516-
path: "/dashboard",
517-
handle: {
518-
lazyChildren: () => import('./dashboard');
519-
}
520-
},
502+
let router = createBrowserRouter(
503+
[
504+
{
505+
path: "/",
506+
Component: Home,
507+
},
508+
{
509+
path: "/dashboard",
510+
children: [
511+
{
512+
// If we want to include /dashboard in the critical routes, we need to
513+
// also include it's index route since patchRoutesOnMiss will not be
514+
// called on a navigation to `/dashboard` because it will have successfully
515+
// matched the `/dashboard` parent route
516+
index: true,
517+
// ...
518+
},
519+
],
520+
handle: {
521+
lazyChildren: () => import("./dashboard"),
522+
},
523+
},
524+
{
525+
path: "/account",
526+
children: [
527+
{
528+
index: true,
529+
// ...
530+
},
531+
],
532+
handle: {
533+
lazyChildren: () => import("./account"),
534+
},
535+
},
536+
],
521537
{
522-
path: "/account",
523-
handle: {
524-
lazyChildren: () => import('./account');
525-
}
526-
},
527-
], {
528-
async unstable_patchRoutesOnMiss({ matches, patch }) {
529-
let leafRoute = matches[matches.length - 1]?.route;
530-
if (leafRoute?.handle?.lazyChildren) {
531-
let children = await leafRoute.handle.lazyChildren();
532-
patch(leafRoute.id, children);
533-
}
538+
async unstable_patchRoutesOnMiss({ matches, patch }) {
539+
let leafRoute = matches[matches.length - 1]?.route;
540+
if (leafRoute?.handle?.lazyChildren) {
541+
let children =
542+
await leafRoute.handle.lazyChildren();
543+
patch(leafRoute.id, children);
544+
}
545+
},
534546
}
535-
});
547+
);
536548
```
537549
538550
## `opts.window`

0 commit comments

Comments
 (0)