-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Conversation
✅ Deploy Preview for react-native ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
--- | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@@ -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! |
There was a problem hiding this comment.
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
@@ -11,15 +11,15 @@ The contributors who helped tackle the incident recently attended a post-mortem | |||
|
|||
<!--truncate--> | |||
|
|||
# What happened |
There was a problem hiding this comment.
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
'diff', | ||
'bash', | ||
'json', |
There was a problem hiding this comment.
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)
@@ -625,7 +625,7 @@ a[class*="tagRegular"] { | |||
} | |||
} | |||
|
|||
.navbar__items div[class^="searchBox"] { |
There was a problem hiding this comment.
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
@Simek v3.2 is released on npm and I updated the deps. This PR can be reviewed now ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That a nice set of new features and fixes, thanks for working on this Sebastien! 🙏
Tested the upgraded app on the preview, and locally. Was not able to spot any obvious regressions, everything seems to work and look correctly, LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM from the diff point of view 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM from the diff point of view 👍
Thanks for the review Let me know if I can do anything else |
Is there anything blocking this PR from being merged? |
I don't know, aren't you the one who's supposed to merge it? 😄 |
Pressing the button! 😄 |
TLDR
Upgrading to Docusaurus v3.2 gives the immediate following benefits:
Is it safe to upgrade?
It should, it's a minor version that does not include any breaking changes.
And I ran visual regression tests comparing prod vs deploy preview to ensure nothing visual is impacted by the upgrade.
slorber/rnw-visual-tests#2
The latest diff only contains 22 minor visual changes that are either expected, or improvements: https://app.argos-ci.com/slorber/rnw-visual-tests/builds/71/84659261
Detailed improvements
Faster build times
The React Native website builds significantly faster:
Perf benchmarks
Before
Cold builds
Incremental builds
After
Cold builds
Incremental builds
Faster dev server hot reloads
Docusaurus hot reloads on Markdown file edits were not very granular previously. Now they should be faster, and if you edit a blog post, only the blog post plugin will reload instead of the whole site. More fine-grained reload optimizations will come later.
Broken anchors detection
Docusaurus 3.1 can detect broken anchor links. Sometimes a link targets a page that exists, but the
#anchor
does not match a valid anchor in that page.In turns out, like many other sites, the React Native Website has many broken anchors to fix. Those currently do not block the build, and only emit a warning, but it's configurable.
List of broken anchors detected on RNW
Other minor improvements
I run visual regression tests on the website to see the visual impact of the upgrade, and some other little details it caught were:
Improved syntax highlighting for JSDoc
https://app.argos-ci.com/slorber/rnw-visual-tests/builds/70/84619585
Improved syntax highlighting for Bash
https://app.argos-ci.com/slorber/rnw-visual-tests/builds/70/84619699
Deduplicated blog archive year
https://app.argos-ci.com/slorber/rnw-visual-tests/builds/70/84619499
Centered column in table
https://app.argos-ci.com/slorber/rnw-visual-tests/builds/70/84619720
Postmortel blog post heading fixes
https://app.argos-ci.com/slorber/rnw-visual-tests/builds/70/84619742
Diff reported because I fixed Markdown to use h2 for internal headings instead of h1, which is semantically better