Skip to content

Commit 7b3a8b1

Browse files
authored
docs: Restore logger docs changes after release (#6608)
## Summary This PR just restores changes I reverted in the #6529 PR. Since now logger changes are released after `3.16.0` is rolled out, we can restore the getting start part and remove unreleased labels/info boxes.
1 parent b4db562 commit 7b3a8b1

File tree

4 files changed

+28
-13
lines changed

4 files changed

+28
-13
lines changed

packages/docs-reanimated/docs/debugging/accurate-call-stacks.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ sidebar_position: 1
66

77
# Accurate Call Stacks
88

9-
import UnreleasedInfo from '../_shared/_unreleased_info.mdx';
10-
11-
<UnreleasedInfo />
12-
139
When debugging Reanimated code, you may encounter error or warning call stacks that don't clearly indicate the root cause of the problem. These stacks can be misleading, as they often highlight code from Reanimated's internals rather than the misuse of the Reanimated API that is the source of the problem.
1410

1511
To address this, Reanimated provides a Metro configuration wrapper called `wrapWithReanimatedMetroConfig`. This wrapper automatically adjusts your Metro config to improve the accuracy of call stacks in warnings and errors generated by the Reanimated library.

packages/docs-reanimated/docs/debugging/logger-configuration.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ sidebar_position: 2
66

77
# Logger configuration
88

9-
import UnreleasedInfo from '../_shared/_unreleased_info.mdx';
10-
11-
<UnreleasedInfo />
12-
139
Reanimated shows warnings that indicate misuses of the library API, such as modifying the [shared value](/docs/fundamentals/glossary#shared-value) during component re-render. These logs can be configured to be more or less verbose.
1410

1511
The **default** logger configuration doesn't require any user setup and displays **all warnings and errors**. If you want to change this behavior, use the `configureReanimatedLogger` function.

packages/docs-reanimated/docs/fundamentals/getting-started.mdx

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,33 @@ To learn more about the plugin head onto to [Reanimated babel plugin](/docs/fund
9191

9292
</details>
9393

94-
### Step 3: Clear Metro bundler cache (recommended)
94+
### Step 3: Wrap metro config with reanimated wrapper (recommended)
95+
96+
Wrap your existing Metro configuration in the `metro.config.js` file with the `wrapWithReanimatedMetroConfig` function.
97+
98+
```js
99+
// metro.config.js
100+
const {
101+
wrapWithReanimatedMetroConfig,
102+
} = require('react-native-reanimated/metro-config');
103+
104+
const config = {
105+
// Your existing Metro configuration options
106+
};
107+
108+
module.exports = wrapWithReanimatedMetroConfig(config);
109+
```
110+
111+
<details>
112+
<summary>Why should I do this?</summary>
113+
114+
Wrapping your Metro configuration with the Reanimated Metro config wrapper will result in displaying improved reanimated errors and warnings with more accurate call stacks. Thanks to this, identifying misuses of the Reanimated API will be much easier than before.
115+
116+
To learn more about this feature, head onto to [Accurate Call Stacks](/docs/debugging/accurate-call-stacks).
117+
118+
</details>
119+
120+
### Step 4: Clear Metro bundler cache (recommended)
95121

96122
<Tabs groupId="package-managers">
97123
<TabItem value="expo" label="EXPO" default>

packages/docs-reanimated/src/theme/DocSidebar/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ export default function DocSidebarWrapper(props) {
1515

1616
const newItems = ['animations/withClamp'];
1717
const experimentalItems = ['shared-element-transitions/overview'];
18-
const unreleasedItems = [
19-
'debugging/accurate-call-stacks',
20-
'debugging/logger-configuration',
21-
];
18+
const unreleasedItems = [];
2219

2320
return (
2421
<DocSidebar

0 commit comments

Comments
 (0)