Skip to content

Commit ed29ce3

Browse files
tjzeltshmieldev
authored andcommitted
chore(Worklets): update docs for Bundle Mode (#9145)
## Summary Updating the docs since `BUNDLE_MODE_ENABLED` is no longer a static feature flag with #9064, also cleaning up a bit in the repo. ## Test plan CI
1 parent 2af8657 commit ed29ce3

6 files changed

Lines changed: 4 additions & 17 deletions

File tree

apps/fabric-example/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"staticFeatureFlags": {
4646
"RUNTIME_TEST_FLAG": true,
4747
"IOS_DYNAMIC_FRAMERATE_ENABLED": true,
48-
"BUNDLE_MODE_ENABLED": false,
4948
"FETCH_PREVIEW_ENABLED": false
5049
}
5150
}

apps/macos-example/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"staticFeatureFlags": {
5656
"RUNTIME_TEST_FLAG": true,
5757
"IOS_DYNAMIC_FRAMERATE_ENABLED": true,
58-
"BUNDLE_MODE_ENABLED": false,
5958
"FETCH_PREVIEW_ENABLED": false
6059
}
6160
}

apps/tvos-example/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
"staticFeatureFlags": {
5959
"RUNTIME_TEST_FLAG": true,
6060
"IOS_DYNAMIC_FRAMERATE_ENABLED": true,
61-
"BUNDLE_MODE_ENABLED": false,
6261
"FETCH_PREVIEW_ENABLED": false
6362
}
6463
}

docs/docs-worklets/docs/bundleMode/setup.mdx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Install `react-native-worklets` package with the `bundle-mode-preview` tag:
3232

3333
To use `react-native-worklets`'s Bundle Mode feature, you need to make the following changes in your repository:
3434

35-
1. **Modify your Babel configuration**. [Worklets Babel Plugin](/docs/worklets-babel-plugin/about) needs to know that it has to prepare your code for the Bundle Mode. In your `babel.config.js` file, add the following:
35+
1. **Modify your Babel configuration**. [Worklets Babel Plugin](/docs/worklets-babel-plugin/about) needs to know that it has to prepare your code for the Bundle Mode. This is also the source of truth for your app to know if the Bundle Mode is enabled. In your `babel.config.js` file, add the following:
3636

3737
```javascript {2-5,13}
3838
/** @type {import('react-native-worklets/plugin').PluginOptions} */
@@ -97,10 +97,6 @@ To use `react-native-worklets`'s Bundle Mode feature, you need to make the follo
9797
</TabItem>
9898
</Tabs>
9999

100-
## Configure your app
101-
102-
For Worklets to know that it should run in Bundle Mode, you need to toggle on `WORKLETS_BUNDLE_MODE_ENABLED` static feature flag in your app's `package.json`. You can find instructions on how to enable it [here](/docs/guides/feature-flags).
103-
104100
## Enable seamless Metro bundling
105101

106102
_This step is optional but highly recommended._

docs/docs-worklets/docs/guides/feature-flags.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Feature flags allow developers to opt-in for experimental changes or opt-out fro
1010

1111
| Feature flag name | Type | Added in | Removed in | Default value |
1212
| ------------------------------------------------------------------ | :-----------------------------: | :------: | :--------: | :-----------: |
13-
| [`BUNDLE_MODE_ENABLED`](#bundle_mode_enabled-) | [static](#static-feature-flags) | 0.8.0 | &ndash; | `false` |
1413
| [`FETCH_PREVIEW_ENABLED`](#fetch_preview_enabled-) | [static](#static-feature-flags) | 0.8.0 | &ndash; | `false` |
1514
| [`IOS_DYNAMIC_FRAMERATE_ENABLED`](#ios_dynamic_framerate_enabled-) | [static](#static-feature-flags) | 0.6.0 | &ndash; | `true` |
1615

@@ -22,14 +21,10 @@ Feature flags available in `react-native-reanimated` are listed [on this page](h
2221

2322
## Description of available feature flags
2423

25-
### `BUNDLE_MODE_ENABLED` <AvailableFrom version="0.8.0" />
26-
27-
This feature flag enables [the Bundle Mode](/docs/bundleMode/). Make sure to follow the rest of the [setup instructions](/docs/bundleMode/setup/) after enabling this flag.
28-
2924
### `FETCH_PREVIEW_ENABLED` <AvailableFrom version="0.8.0" />
3025

3126
This feature flag enables the [preview of fetch API on Worklet Runtimes](/docs/bundleMode/usage#running-network-requests-in-worklets) in the [Bundle Mode](/docs/bundleMode/). Make sure to follow the rest of the [setup instructions](/docs/bundleMode/setup/) after enabling this flag.
32-
**This flag requires `BUNDLE_MODE_ENABLED` flag to be enabled as well.**
27+
**This flag only takes effect in Bundle Mode.**
3328

3429
### `IOS_DYNAMIC_FRAMERATE_ENABLED` <AvailableFrom version="0.6.0" />
3530

scripts/patches/bundle-mode.patch

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,13 @@ index afe4c07b49..eece71ae7f 100644
2929
module.exports = wrapWithReanimatedMetroConfig(
3030
mergeConfig(defaultConfig, config)
3131
diff --git a/apps/fabric-example/package.json b/apps/fabric-example/package.json
32-
index 3413d160ce..e449361b2f 100644
32+
index e95d944cc1..e449361b2f 100644
3333
--- a/apps/fabric-example/package.json
3434
+++ b/apps/fabric-example/package.json
35-
@@ -45,8 +45,7 @@
35+
@@ -45,7 +45,7 @@
3636
"staticFeatureFlags": {
3737
"RUNTIME_TEST_FLAG": true,
3838
"IOS_DYNAMIC_FRAMERATE_ENABLED": true,
39-
- "BUNDLE_MODE_ENABLED": false,
4039
- "FETCH_PREVIEW_ENABLED": false
4140
+ "FETCH_PREVIEW_ENABLED": true
4241
}

0 commit comments

Comments
 (0)