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

chore: prepare docs for Docusaurus v3 upgrade - 2nd iteration #3830

Merged
merged 14 commits into from
Sep 1, 2023
2 changes: 1 addition & 1 deletion docs/native-components-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ RCT_EXPORT_VIEW_PROPERTY(onRegionChange, RCTBubblingEventBlock)

RCT_CUSTOM_VIEW_PROPERTY(region, MKCoordinateRegion, MKMapView)
{
[view setRegion:json ? [RCTConvert MKCoordinateRegion:json] : defaultView.region animated:YES];
[view setRegion:json ? [RCTConvert MKCoordinateRegion:json] : defaultView.region animated:YES];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

replace tab with space + reduce indentation for consistency

Avoid this extra spacing when upgrading:

CleanShot 2023-08-25 at 13 07 16@2x

Before: https://reactnative.dev/docs/native-components-ios#events
After: https://deploy-preview-3830--react-native.netlify.app/docs/native-components-ios#events

}

- (UIView *)view
Expand Down
2 changes: 1 addition & 1 deletion docs/profile-hermes.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ To open the profile in Chrome DevTools:
2. Select the **Performance** tab.
3. Right click and choose **Load profile...**

<img src="/docs/assets/openChromeProfile.png" alt="Loading a performance profile on Chrome DevTools" />
<img src="/docs/assets/openChromeProfile.png" alt="Loading a performance profile on Chrome DevTools" />
Copy link
Contributor Author

Choose a reason for hiding this comment

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


## How does the Hermes Profile Transformer work?

Expand Down
6 changes: 3 additions & 3 deletions docs/pushnotificationios.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,9 @@ See what push permissions are currently enabled.

`callback` will be invoked with a `permissions` object:

- `alert` :boolean
- `badge` :boolean
- `sound` :boolean
- `alert: boolean`
- `badge: boolean`
- `sound: boolean`
Comment on lines -405 to +407
Copy link
Contributor Author

Choose a reason for hiding this comment

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

:xyz, ::xyz and :::xyz are "Markdown Directives" and we turn them on by default in Docusaurus v3 to bring admonition support.

This means you should avoid that in your code (unless escaped) otherwise those annotations will magically disappear when upgrading.

CleanShot 2023-08-25 at 12 47 37@2x

I think it's reasonable to make the boolean part of the inline code block

Before: https://reactnative.dev/docs/pushnotificationios#checkpermissions
After: https://deploy-preview-3830--react-native.netlify.app/docs/pushnotificationios#checkpermissions


---

Expand Down
2 changes: 1 addition & 1 deletion docs/scrollview.md
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ Displays the scroll indicators momentarily.
scrollTo(
options?: {x?: number, y?: number, animated?: boolean} | number,
deprecatedX?: number,
deprecatedAnimated?: boolean,
deprecatedAnimated?: boolean,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks like a typo

);
```

Expand Down
2 changes: 1 addition & 1 deletion docs/touchablenativefeedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static SelectableBackground(
): ThemeAttributeBackgroundPropType;
```

Creates an object that represents android theme's default background for selectable elements (?android:attr/selectableItemBackground). `rippleRadius` parameter controls the radius of the ripple effect.
Creates an object that represents android theme's default background for selectable elements (`?android:attr/selectableItemBackground`). `rippleRadius` parameter controls the radius of the ripple effect.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another "Markdown Directive", we want to avoid them, escape them or wrap them in code blocks.

Otherwise the upgrade will lead to:

CleanShot 2023-08-25 at 12 52 23@2x


---

Expand Down
2 changes: 1 addition & 1 deletion website/architecture/render-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ React Native renderer leverages structural sharing to minimize the overhead of i

In the above example, React creates the new tree using these operations:

1. CloneNode(**Node 3**, {backgroundColor: 'yellow'}) → **Node 3'**
1. CloneNode(**Node 3**, `{backgroundColor: 'yellow'}`) → **Node 3'**
Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks reasonable to wrap in code block

{ will mess up with MDX 2 and require to be escaped

2. CloneNode(**Node 2**) → **Node 2'**
3. AppendChild(**Node 2'**, **Node 3'**)
4. AppendChild(**Node 2'**, **Node 4**)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ With this update, when you allow RTL layout for your app:

```objc
// in AppDelegate.m
[[RCTI18nUtil sharedInstance] allowRTL:YES];
[[RCTI18nUtil sharedInstance] allowRTL:YES];
```

Android:

```java
// in MainActivity.java
I18nUtil sharedI18nUtilInstance = I18nUtil.getInstance();
sharedI18nUtilInstance.allowRTL(context, true);
I18nUtil sharedI18nUtilInstance = I18nUtil.getInstance();
sharedI18nUtilInstance.allowRTL(context, true);
Comment on lines -56 to +65
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replace tabs with spaces for consistency + avoid extra spacing appearing when upgrading:

CleanShot 2023-08-25 at 13 02 33@2x

```

3. For Android, you need add `android:supportsRtl="true"` to the [`<application>`](https://developer.android.com/guide/topics/manifest/application-element.html) element in `AndroidManifest.xml` file.
Expand Down
50 changes: 25 additions & 25 deletions website/blog/2016-12-05-easier-upgrades.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,40 +65,40 @@ index e98ebb0..2fb6a11 100644
--- a/ios/MyAwesomeApp/Info.plist
+++ b/ios/MyAwesomeApp/Info.plist
@@ -45,7 +45,7 @@
<dict>
<key>localhost</key>
<dict>
- <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
+ <key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
<dict>
<key>localhost</key>
<dict>
- <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
+ <key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
[...]
```

All we need now is to apply this patch to your source files. While the old `react-native upgrade` process would have prompted you for any small difference, Git is able to merge most of the changes automatically using its 3-way merge algorithm and eventually leave us with familiar conflict delimiters:

```
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
<<<<<<< ours
CODE_SIGN_IDENTITY = "iPhone Developer";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/HockeySDK.embeddedframework",
"$(PROJECT_DIR)/HockeySDK-iOS/HockeySDK.embeddedframework",
);
CODE_SIGN_IDENTITY = "iPhone Developer";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/HockeySDK.embeddedframework",
"$(PROJECT_DIR)/HockeySDK-iOS/HockeySDK.embeddedframework",
);
=======
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 1;
>>>>>>> theirs
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../node_modules/react-native/React/**",
"$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../node_modules/react-native/React/**",
"$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**",
);
```
Comment on lines -68 to 102
Copy link
Contributor Author

Choose a reason for hiding this comment

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


These conflicts are generally easy to reason about. The delimiter **ours** stands for "your team" whereas **theirs** could be seen as "the React Native team".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Android 12 introduces new [overscroll effect](https://developer.android.com/abou

#### Permission Updates

Android 12 allows users of your app to only provide access to the approximate location if you request it with **`ACCESS_FINE_LOCATION`** permission**.** Learn more about it [here](https://developer.android.com/about/versions/12/approximate-location).
Android 12 allows users of your app to only provide access to the approximate location if you request it with **`ACCESS_FINE_LOCATION`** permission. Learn more about it [here](https://developer.android.com/about/versions/12/approximate-location).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks like a typo


Check out Google’s [detailed behavior changes](https://developer.android.com/about/versions/12/behavior-changes-all) for all apps running on Android 12.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ RCT_EXPORT_VIEW_PROPERTY(onRegionChange, RCTBubblingEventBlock)

RCT_CUSTOM_VIEW_PROPERTY(region, MKCoordinateRegion, MKMapView)
{
[view setRegion:json ? [RCTConvert MKCoordinateRegion:json] : defaultView.region animated:YES];
[view setRegion:json ? [RCTConvert MKCoordinateRegion:json] : defaultView.region animated:YES];
}

- (UIView *)view
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 @@ -93,7 +93,7 @@ To open the profile in Chrome DevTools:
2. Select the **Performance** tab.
3. Right click and choose **Load profile...**

<img src="/docs/assets/openChromeProfile.png" alt="Loading a performance profile on Chrome DevTools" />
<img src="/docs/assets/openChromeProfile.png" alt="Loading a performance profile on Chrome DevTools" />

## How does the Hermes Profile Transformer work?

Expand Down
6 changes: 3 additions & 3 deletions website/versioned_docs/version-0.70/pushnotificationios.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,9 @@ See what push permissions are currently enabled.

`callback` will be invoked with a `permissions` object:

- `alert` :boolean
- `badge` :boolean
- `sound` :boolean
- `alert: boolean`
- `badge: boolean`
- `sound: boolean`

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ TV next focus up (see documentation for the View component).
static SelectableBackground(rippleRadius: ?number)
```

Creates an object that represents android theme's default background for selectable elements (?android:attr/selectableItemBackground). `rippleRadius` parameter controls the radius of the ripple effect.
Creates an object that represents android theme's default background for selectable elements (`?android:attr/selectableItemBackground`). `rippleRadius` parameter controls the radius of the ripple effect.

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ RCT_EXPORT_VIEW_PROPERTY(onRegionChange, RCTBubblingEventBlock)

RCT_CUSTOM_VIEW_PROPERTY(region, MKCoordinateRegion, MKMapView)
{
[view setRegion:json ? [RCTConvert MKCoordinateRegion:json] : defaultView.region animated:YES];
[view setRegion:json ? [RCTConvert MKCoordinateRegion:json] : defaultView.region animated:YES];
}

- (UIView *)view
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 @@ -71,7 +71,7 @@ To open the profile in Chrome DevTools:
2. Select the **Performance** tab.
3. Right click and choose **Load profile...**

<img src="/docs/assets/openChromeProfile.png" alt="Loading a performance profile on Chrome DevTools" />
<img src="/docs/assets/openChromeProfile.png" alt="Loading a performance profile on Chrome DevTools" />

## How does the Hermes Profile Transformer work?

Expand Down
6 changes: 3 additions & 3 deletions website/versioned_docs/version-0.71/pushnotificationios.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,9 @@ See what push permissions are currently enabled.

`callback` will be invoked with a `permissions` object:

- `alert` :boolean
- `badge` :boolean
- `sound` :boolean
- `alert: boolean`
- `badge: boolean`
- `sound: boolean`

---

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-0.71/scrollview.md
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ Displays the scroll indicators momentarily.
scrollTo(
options?: {x?: number, y?: number, animated?: boolean} | number,
deprecatedX?: number,
deprecatedAnimated?: boolean,
deprecatedAnimated?: boolean,
);
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static SelectableBackground(
): ThemeAttributeBackgroundPropType;
```

Creates an object that represents android theme's default background for selectable elements (?android:attr/selectableItemBackground). `rippleRadius` parameter controls the radius of the ripple effect.
Creates an object that represents android theme's default background for selectable elements (`?android:attr/selectableItemBackground`). `rippleRadius` parameter controls the radius of the ripple effect.

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ RCT_EXPORT_VIEW_PROPERTY(onRegionChange, RCTBubblingEventBlock)

RCT_CUSTOM_VIEW_PROPERTY(region, MKCoordinateRegion, MKMapView)
{
[view setRegion:json ? [RCTConvert MKCoordinateRegion:json] : defaultView.region animated:YES];
[view setRegion:json ? [RCTConvert MKCoordinateRegion:json] : defaultView.region animated:YES];
}

- (UIView *)view
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 @@ -71,7 +71,7 @@ To open the profile in Chrome DevTools:
2. Select the **Performance** tab.
3. Right click and choose **Load profile...**

<img src="/docs/assets/openChromeProfile.png" alt="Loading a performance profile on Chrome DevTools" />
<img src="/docs/assets/openChromeProfile.png" alt="Loading a performance profile on Chrome DevTools" />

## How does the Hermes Profile Transformer work?

Expand Down
6 changes: 3 additions & 3 deletions website/versioned_docs/version-0.72/pushnotificationios.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,9 @@ See what push permissions are currently enabled.

`callback` will be invoked with a `permissions` object:

- `alert` :boolean
- `badge` :boolean
- `sound` :boolean
- `alert: boolean`
- `badge: boolean`
- `sound: boolean`

---

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-0.72/scrollview.md
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ Displays the scroll indicators momentarily.
scrollTo(
options?: {x?: number, y?: number, animated?: boolean} | number,
deprecatedX?: number,
deprecatedAnimated?: boolean,
deprecatedAnimated?: boolean,
);
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static SelectableBackground(
): ThemeAttributeBackgroundPropType;
```

Creates an object that represents android theme's default background for selectable elements (?android:attr/selectableItemBackground). `rippleRadius` parameter controls the radius of the ripple effect.
Creates an object that represents android theme's default background for selectable elements (`?android:attr/selectableItemBackground`). `rippleRadius` parameter controls the radius of the ripple effect.

---

Expand Down