Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Docusaurus v3.2 #4072

Merged
merged 9 commits into from
Apr 5, 2024
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
2 changes: 1 addition & 1 deletion docs/profile-hermes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You can visualize JavaScript's performance in a React Native app using [Hermes](
In this section, you will learn how to profile your React Native app running on Hermes and how to visualize the profile using [the Performance tab on Chrome DevTools](https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/reference)

:::caution
Be sure to [enable Hermes in your app](Hermes) before you get started!
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The broken link checker is now case sensitive because some hosting platforms are case sensitive too and can't serve hermes.html from /HeRMeS

Be sure to [enable Hermes in your app](hermes) before you get started!
:::

Follow the instructions below to get started profiling:
Expand Down
2 changes: 2 additions & 0 deletions docs/shadow-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ export default App;
</TabItem>
</Tabs>

---

Comment on lines +211 to +212
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is due to the weird structure the RN website use for many bases, using a # Reference heading in the middle of an existing doc that already has a h1 heading.

This is not semantically correct, and if it's only to apply a larger font it would be better to apply a different solution.

I've made a little tweak to the heuristic Docusaurus uses to decide (or not) to add the front matter title at the top of the page (facebook/docusaurus#9999), so that I don't have to refactor the other docs as well, but this specific page wasn't covered because it's not consistent with the others and # Reference was not prefixed by ---.

Note other docs are inconsistent:

  • Some do not have a ## Example heading
  • Some use a h3 ### Example heading instead of h2
  • Some do not have a --- before the # Reference heading

I only fixed this case because it prevented the insertion of the # Shadow Prop heading at the very top of the doc (ie the doc had no title anymore), and will let you figure out further refactors to make RNW more consistent.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that we should avoid using an additional h1, in other words # [title] headers, in pages content. Can make a follow up PR which will cleanup te semantic a bit. Hope that those usage are not blocker for the upgrade.

# Reference

## Props
Expand Down
12 changes: 6 additions & 6 deletions website/blog/2023-01-27-71rc1-android-outage-postmortem.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ The contributors who helped tackle the incident recently attended a post-mortem

<!--truncate-->

# What happened
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old blog post using h1 everywhere instead of h2

## What happened

On November 4th 2022, we published the version `0.71.0-rc0` of React Native, the first release candidate for 0.71, on several public repositories.

A major change made in this release candidate helped to improve build times by publishing artifacts to Maven Central, instead of building them from source. More details on how this was done are available in [RFC#508](https://github.com/react-native-community/discussions-and-proposals/pull/508) and [related discussions](https://github.com/reactwg/react-native-new-architecture/discussions/105).

Unfortunately, because of the way we scaffolded new projects from the template, this caused build failures for any Android user on older versions because they would start downloading new artifacts for `0.71.0-rc0` instead of the version they were using in their project (like `0.68.0`).

# Why this happened
## Why this happened

The React Native template provides a `build.gradle` file to build Android apps. This file contains a dependency on the React Native Android library as follows:
`implementation("com.facebook.react:react-native:+")`.
Expand All @@ -32,7 +32,7 @@ This caused builds with React Native versions before `0.71.0-rc.0` to query all

Further technical details on this event area are also available [on this GitHub issue](https://github.com/facebook/react-native/issues/35210).

# How we mitigated & resolved
## How we mitigated & resolved

As soon as we identified the issue on November 4th, the community found and shared a manual workaround to fix the issue which would pin React Native to a specific, correcting the mistake.

Expand All @@ -42,7 +42,7 @@ At the same time, we [reached out to Sonatype](https://issues.sonatype.org/brows

The issue was fully resolved on November 8th when the artifacts were fully removed from Maven Central.

# Timeline of events
## Timeline of events

_This section contains a brief timeline of the events. All times are GMT/UTC +0_

Expand All @@ -58,7 +58,7 @@ _This section contains a brief timeline of the events. All times are GMT/UTC +0_
- Nov 8th - 08:04 PM: Artifacts on Maven Central are [fully removed](https://issues.sonatype.org/browse/OSSRH-86006?focusedCommentId=1216303&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-1216303).
- Nov 10th - 11:51 AM: Issue about the [incident is closed](https://github.com/facebook/react-native/issues/35210#issuecomment-1310170361).

# Lessons Learned
## Lessons Learned

While in many ways the conditions to trigger this incident has existed since React Native 0.12.0, we want to ensure that the foundations on which we develop and release React Native moving forward are stronger. Here are some of the lessons learned and the actionables on how we’ll adapt our processes and infrastructure to respond faster and stronger in the future.

Expand Down Expand Up @@ -94,7 +94,7 @@ Specifically, we are now encouraging and supporting 3rd party library testing as

On top of this, we started a closer collaboration with Callstack, the maintainers of [create-react-native-library](https://github.com/callstack/react-native-builder-bob/tree/main/packages/create-react-native-library), to improve the library template and make sure it follows all the necessary best practices to integrate with React Native projects. The newer version of `create-react-native-library` is now fully compatible with 0.71 projects while still offering backward compatibility.

# Conclusions
## Conclusions

We want to apologize for the disruption this caused to the workflows of developers all around the world. As highlighted above, we have already started taking action to strengthen our foundation - and more work is due.

Expand Down
4 changes: 2 additions & 2 deletions website/contributing/how-to-contribute-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Now you are set up to run several commands:
- `yarn test-typescript` runs the [TypeScript](https://www.typescriptlang.org/) typechecks.
- `yarn test-ios` runs the iOS test suite (macOS required).
- `yarn build` builds all configured packages — in general, this command only needs to be run by CI ahead of publishing.
- Packages which require a build are configured in [scripts/build/config.js](https://github.com/facebook/react-native/blob/main/scripts/build/config.js).
- Packages which require a build are configured in [scripts/build/config.js](https://github.com/facebook/react-native/blob/main/scripts/build/config.js).

## Testing your Changes

Expand Down Expand Up @@ -78,7 +78,7 @@ Code-level contributions to React Native generally come in the form of [a pull r

If all goes well, your pull request will be merged. If it is not merged, maintainers will do their best to explain their reasoning.

If this is your first time sending a pull request, we have created a [step-by-step guide to help you get started](/contributing/how-to-open-a-pull-request). For more detailed information on how pull requests are handled, see the [Managing Pull Requests page](Managing-Pull-Requests).
If this is your first time sending a pull request, we have created a [step-by-step guide to help you get started](/contributing/how-to-open-a-pull-request). For more detailed information on how pull requests are handled, see the [Managing Pull Requests page](managing-pull-requests).

### Contributor License Agreement

Expand Down
3 changes: 3 additions & 0 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ module.exports = {
defaultLanguage: 'jsx',
theme: require('./core/PrismTheme'),
additionalLanguages: [
'diff',
'bash',
'json',
Comment on lines +222 to +224
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

required by v3.0+ (non beta)

'java',
'kotlin',
'objectivec',
Expand Down
10 changes: 5 additions & 5 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
]
},
"dependencies": {
"@docusaurus/core": "3.0.0-beta.0",
"@docusaurus/plugin-google-gtag": "3.0.0-beta.0",
"@docusaurus/plugin-pwa": "3.0.0-beta.0",
"@docusaurus/preset-classic": "3.0.0-beta.0",
"@docusaurus/core": "3.2.0",
"@docusaurus/plugin-google-gtag": "3.2.0",
"@docusaurus/plugin-pwa": "3.2.0",
"@docusaurus/preset-classic": "3.2.0",
"docusaurus-plugin-sass": "^0.2.5",
"esbuild-loader": "^2.21.0",
"react": "^18.2.0",
Expand All @@ -60,7 +60,7 @@
"sass": "^1.68.0"
},
"devDependencies": {
"@docusaurus/types": "3.0.0-beta.0",
"@docusaurus/types": "3.2.0",
"@react-native-website/lint-examples": "0.0.0",
"@react-native-website/update-redirects": "0.0.0",
"alex": "^10.0.0",
Expand Down
2 changes: 1 addition & 1 deletion website/src/css/customTheme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ a[class*="tagRegular"] {
}
}

.navbar__items div[class^="searchBox"] {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

little CSS class rename on our side

.navbar__items div[class^="navbarSearchContainer"] {
padding-left: 14px;
}

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-0.70/profile-hermes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You can visualize JavaScript's performance in a React Native app using [Hermes](
In this section, you will learn how to profile your React Native app running on Hermes and how to visualize the profile using [the Performance tab on Chrome DevTools](https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/reference)

:::caution
Be sure to [enable Hermes in your app](Hermes) before you get started!
Be sure to [enable Hermes in your app](hermes) before you get started!
:::

Follow the instructions below to get started profiling:
Expand Down
2 changes: 2 additions & 0 deletions website/versioned_docs/version-0.70/shadow-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ const styles = StyleSheet.create({
export default App;
```

---

# Reference

## Props
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-0.71/profile-hermes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You can visualize JavaScript's performance in a React Native app using [Hermes](
In this section, you will learn how to profile your React Native app running on Hermes and how to visualize the profile using [the Performance tab on Chrome DevTools](https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/reference)

:::caution
Be sure to [enable Hermes in your app](Hermes) before you get started!
Be sure to [enable Hermes in your app](hermes) before you get started!
:::

Follow the instructions below to get started profiling:
Expand Down
2 changes: 2 additions & 0 deletions website/versioned_docs/version-0.71/shadow-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ export default App;
</TabItem>
</Tabs>

---

# Reference

## Props
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-0.72/profile-hermes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You can visualize JavaScript's performance in a React Native app using [Hermes](
In this section, you will learn how to profile your React Native app running on Hermes and how to visualize the profile using [the Performance tab on Chrome DevTools](https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/reference)

:::caution
Be sure to [enable Hermes in your app](Hermes) before you get started!
Be sure to [enable Hermes in your app](hermes) before you get started!
:::

Follow the instructions below to get started profiling:
Expand Down
2 changes: 2 additions & 0 deletions website/versioned_docs/version-0.72/shadow-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ export default App;
</TabItem>
</Tabs>

---

# Reference

## Props
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-0.73/profile-hermes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You can visualize JavaScript's performance in a React Native app using [Hermes](
In this section, you will learn how to profile your React Native app running on Hermes and how to visualize the profile using [the Performance tab on Chrome DevTools](https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/reference)

:::caution
Be sure to [enable Hermes in your app](Hermes) before you get started!
Be sure to [enable Hermes in your app](hermes) before you get started!
:::

Follow the instructions below to get started profiling:
Expand Down
2 changes: 2 additions & 0 deletions website/versioned_docs/version-0.73/shadow-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ export default App;
</TabItem>
</Tabs>

---

# Reference

## Props
Expand Down
Loading