Skip to content

Commit

Permalink
Merge branch 'main' into release-next
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Feb 21, 2023
2 parents 3b38f54 + f0b886b commit ac2e096
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 33 deletions.
48 changes: 28 additions & 20 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,50 @@

New releases should be created from release branches originating from the `dev` branch. When you are ready to begin the release process:

- Make sure you've pulled all of the changes from GitHub for both `dev` and `main` branches
- Check out the `dev` branch
- Create a new release branch with the `release-` prefix (eg, `git checkout -b release-v6.5.1`)
- Make sure you've pulled all of the changes from GitHub for both `dev` and `main` branches.
- Check out the `dev` branch.
- Create a new release branch with the `release-` prefix (eg, `git checkout -b release-next`).
- **IMPORTANT:** The `release-` prefix is important, as this is what triggers our GitHub CI workflow that will ultimately publish the release.
- Merge `main` into the release branch
- Branches named `release-experimental` will not trigger our release workflow, as experimental releases handled differently (outlined below).
- Merge `main` into the release branch.

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.

### Starting a new pre-release

- Ensure you are on the new `release-*` branch
- Enter Changesets pre-release mode using the `pre` tag: `yarn changeset pre enter pre`
- Commit the changesets and push the the `release-*` branch to GitHub; wait for the release workflow to finish and the Changesets action to open its PR that will increment all versions
- Review the updated `CHANGELOG` files and make any adjustments necessary, then merge the PR
- Once the PR is merged, the release workflow will publish the updated packages to npm
- Ensure you are on the new `release-*` branch.
- Enter Changesets pre-release mode using the `pre` tag: `yarn changeset pre enter pre`.
- Commit the change and push the the `release-*` branch to GitHub.
- 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.
- Review the updated `CHANGELOG` files and make any adjustments necessary, then merge the PR into the `release-*` branch.
- `find packages -name 'CHANGELOG.md' -mindepth 2 -maxdepth 2 -exec code {} \;`
- Once the PR is merged, the release workflow will publish the updated packages to npm.

### Iterating a pre-release

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

- Make whatever changes you need
- Create a new changeset: `yarn changeset`
- Make whatever changes you need.
- Create a new changeset: `yarn changeset`.
- **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.
- Commit the changesets and push the the `release-*` branch to GitHub; wait for the release workflow to finish and the Changesets action to open its PR that will increment all versions
- Review the updated `CHANGELOG` files and make any adjustments necessary, then merge the PR
- Once the PR is merged, the release workflow will publish the updated packages to npm
- Commit the changesets and push the the `release-*` branch to GitHub.
- Wait for the release workflow to finish and the Changesets action to open its PR that will increment all versions.
- Review the PR, make any adjustments necessary, and merge it into the `release-*` branch.
- Once the PR is merged, the release workflow will publish the updated packages to npm.

### Publishing the stable release

- Exit Changesets pre-release mode: `yarn changeset pre exit`
- Commit the unpublished changesets and push the the `release-*` branch to GitHub; wait for the release workflow to finish and the Changesets action to open its PR that will increment all versions to stable
- Review the updated `CHANGELOG` files and make any adjustments necessary, then merge the PR
- Once the PR is merged, the release workflow will publish the updated packages to npm
- Exit Changesets pre-release mode: `yarn changeset pre exit`.
- Commit the deleted pre-release file along with any unpublished changesets, and push the the `release-*` branch to GitHub.
- 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.
- Review the updated `CHANGELOG` files and make any adjustments necessary.
- We should remove the changelogs for all pre-releases ahead of publishing the stable version.
- [TODO: We should automate this]
- Merge the PR into the `release-*` branch.
- Once the PR is merged, the release workflow will publish the updated packages to npm.
- Once the release is published:
- merge the `release-*` branch into `main` and push it up to github
- merge the `release-*` branch into `dev` and push it up to github
- merge the `release-*` branch into `main` and push it up to GitHub
- merge the `release-*` branch into `dev` and push it up to GitHub
- Convert the `[email protected]` tag to a Release on Github with the name `v6.x.y`
- Copy the relevant changelog entries from all packages into the Release Notes and adjust accordingly, matching the format used by prior releases

Expand Down
7 changes: 7 additions & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- 0xEddie
- abdallah-nour
- abhi-kr-2100
- AchThomas
Expand Down Expand Up @@ -70,6 +71,7 @@
- hyesungoh
- ianflynnwork
- IbraRouisDev
- igniscyan
- infoxicator
- IsaiStormBlesed
- Isammoc
Expand All @@ -91,6 +93,7 @@
- jrakotoharisoa
- kachun333
- kantuni
- kark
- KAROTT7
- kddnewton
- kentcdodds
Expand Down Expand Up @@ -133,6 +136,7 @@
- omar-moquete
- p13i
- parched
- parveen232
- paulsmithkc
- pavsoldatov
- pcattori
Expand Down Expand Up @@ -166,9 +170,11 @@
- tlinhart
- tom-sherman
- triangularcube
- trungpv1601
- turansky
- tyankatsu0105
- underager
- ValiantCat
- vijaypushkin
- vikingviolinist
- vishwast03
Expand All @@ -177,5 +183,6 @@
- williamsdyyz
- xavier-lc
- xcsnowcity
- yionr
- yuleicul
- zheng-chuang
1 change: 1 addition & 0 deletions docs/fetch/redirect.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const loader = async () => {
if (!user) {
return redirect("/login");
}
return null;
};
```

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/deferred.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Let's take a dive into how to accomplish this.

Start by adding `<Await />` for your slow data requests where you'd rather render a fallback UI. Let's do that for our example above:

```jsx lines=[3,9,13,24-40]
```jsx lines=[3,9,13-15,24-40]
import {
Await,
defer,
Expand Down
3 changes: 1 addition & 2 deletions docs/route/route.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ You can make a route segment optional by adding a `?` to the end of the segment.
path="/:lang?/categories"
// the matching param might be available to the loader
loader={({ params }) => {
console.log(params["*"]); // "one/two"
console.log(params["lang"]); // "en"
}}
// and the action
action={({ params }) => {}}
Expand Down Expand Up @@ -327,7 +327,6 @@ Please see the [errorElement][errorelement] documentation for more details.

Any application-specific data. Please see the [useMatches][usematches] documentation for details and examples.

[outlet]: ./outlet
[remix]: https://remix.run
[indexroute]: ../start/concepts#index-routes
[outlet]: ../components/outlet
Expand Down
19 changes: 10 additions & 9 deletions docs/start/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ Now that we've got a component, let's hook it up to a new route.

👉 **Import the contact component and create a new route**

```js filename=main.jsx lines=[2,10-13]
```js filename=src/main.jsx lines=[2,10-13]
/* existing imports */
import Contact from "./routes/contact";

Expand Down Expand Up @@ -699,11 +699,12 @@ import { Form, useLoaderData } from "react-router-dom";
import { getContact } from "../contacts";

export async function loader({ params }) {
return getContact(params.contactId);
const contact = await getContact(params.contactId);
return { contact };
}

export default function Contact() {
const contact = useLoaderData();
const { contact } = useLoaderData();
// existing code
}
```
Expand Down Expand Up @@ -947,7 +948,7 @@ export async function action({ request, params }) {

Since we have a handful of form fields, we used [`Object.fromEntries`][fromentries] to collect them all into an object, which is exactly what our `updateContact` function wants.

```jsx
```jsx lines=[2,3]
const updates = Object.fromEntries(formData);
updates.first; // "Some"
updates.last; // "Name"
Expand Down Expand Up @@ -976,7 +977,7 @@ Now that we know how to redirect, let's update the action that creates new conta

👉 **Redirect to the new record's edit page**

```jsx filename=src/routes/root.jsx lines=[6,11-12]
```jsx filename=src/routes/root.jsx lines=[6,12]
import {
Outlet,
Link,
Expand Down Expand Up @@ -1099,7 +1100,7 @@ In our case, we add a `"loading"` class to the main part of the app if we're not

<img class="tutorial" loading="lazy" src="/_docs/tutorial/16.webp" />

Note that our data model (`src/contact.js`) has a clientside cache, so navigating to the same contact is fast the second time. This behavior is _not_ React Router, it will re-load data for changing routes no matter if you've been there before or not. It does, however, avoid calling the loaders for _unchanging_ routes (like the list) during a navigation.
Note that our data model (`src/contacts.js`) has a clientside cache, so navigating to the same contact is fast the second time. This behavior is _not_ React Router, it will re-load data for changing routes no matter if you've been there before or not. It does, however, avoid calling the loaders for _unchanging_ routes (like the list) during a navigation.

## Deleting Records

Expand Down Expand Up @@ -1731,7 +1732,7 @@ Might want to take a look at that form while we're here. As always, our form has

👉 **Create the action**

```jsx filename=src/routes/contact.jsx lines=[2,4-10]
```jsx filename=src/routes/contact.jsx lines=[2,4-9]
// existing code
import { getContact, updateContact } from "../contacts";

Expand Down Expand Up @@ -1840,7 +1841,7 @@ Whenever you have an expected error case in a loader or action–like the data n

👉 **Throw a 404 response in the loader**

```jsx filename=src/routes/contact.jsx lines=[3-8]
```jsx filename=src/routes/contact.jsx lines=[2-9]
export async function loader({ params }) {
const contact = await getContact(params.contactId);
if (!contact) {
Expand All @@ -1849,7 +1850,7 @@ export async function loader({ params }) {
statusText: "Not Found",
});
}
return contact;
return { contact };
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/utils/defer.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ new: true
This utility allows you to defer values returned from loaders by passing promises instead of resolved values.

```jsx
function loader() {
async function loader() {
let product = await getProduct();
let reviews = getProductReviews();
return defer({ product, reviews });
Expand Down

0 comments on commit ac2e096

Please sign in to comment.