Skip to content

Commit

Permalink
Mark unreleased changes docs as unreleased and remove metro config st…
Browse files Browse the repository at this point in the history
…ep from quick start
  • Loading branch information
MatiPl01 committed Sep 20, 2024
1 parent 4004a67 commit 7cdb88c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ sidebar_position: 1

# Accurate Call Stacks

import UnreleasedInfo from '../_shared/_unreleased_info.mdx';

<UnreleasedInfo />

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.

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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ sidebar_position: 2

# Logger configuration

import UnreleasedInfo from '../_shared/_unreleased_info.mdx';

<UnreleasedInfo />

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.

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.
Expand Down
28 changes: 1 addition & 27 deletions packages/docs-reanimated/docs/fundamentals/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,33 +91,7 @@ To learn more about the plugin head onto to [Reanimated babel plugin](/docs/fund

</details>

### Step 3: Wrap metro config with reanimated wrapper (recommended)

Wrap your existing Metro configuration in the `metro.config.js` file with the `wrapWithReanimatedMetroConfig` function.

```js
// metro.config.js
const {
wrapWithReanimatedMetroConfig,
} = require('react-native-reanimated/metro-config');

const config = {
// Your existing Metro configuration options
};

module.exports = wrapWithReanimatedMetroConfig(config);
```

<details>
<summary>Why should I do this?</summary>

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.

To learn more about this feature, head onto to [Accurate Call Stacks](/docs/debugging/accurate-call-stacks).

</details>

### Step 4: Clear Metro bundler cache (recommended)
### Step 3: Clear Metro bundler cache (recommended)

<Tabs groupId="package-managers">
<TabItem value="expo" label="EXPO" default>
Expand Down
6 changes: 6 additions & 0 deletions packages/docs-reanimated/src/css/colors.css
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@
--swm-sidebar-label-text-experimental: var(--swm-navy-light-100);
--swm-sidebar-label-background-experimental: var(--swm-yellow-light-40);

--swm-sidebar-label-text-unreleased: var(--swm-navy-light-100);
--swm-sidebar-label-background-unreleased: var(--swm-blue-light-40);

/* Mobile sidebar versions */
--swm-sidebar-elements-version-text: var(--swm-navy-light-100);
--swm-sidebar-elements-version-inactive: var(--swm-navy-dark-40);
Expand Down Expand Up @@ -440,6 +443,9 @@
--swm-sidebar-label-text-experimental: var(--swm-off-white);
--swm-sidebar-label-background-experimental: var(--swm-yellow-dark-120);

--swm-sidebar-label-text-unreleased: var(--swm-off-white);
--swm-sidebar-label-background-unreleased: var(--swm-blue-dark-120);

/* Mobile sidebar versions */
--swm-sidebar-elements-version-text: var(--swm-navy-dark-20);
--swm-sidebar-elements-version-inactive: var(--swm-navy-dark-60);
Expand Down
2 changes: 2 additions & 0 deletions packages/docs-reanimated/src/theme/DocSidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ export default function DocSidebarWrapper(props) {

const newItems = ['animations/withClamp'];
const experimentalItems = ['shared-element-transitions/overview'];
const unreleasedItems = ['debugging/accurate-call-stacks', 'debugging/logger-configuration'];

return (
<DocSidebar
newItems={newItems}
experimentalItems={experimentalItems}
unreleasedItems={unreleasedItems}
heroImages={heroImages}
titleImages={titleImages}
{...props}
Expand Down

0 comments on commit 7cdb88c

Please sign in to comment.