You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: re-phrase a note about Hermes engine integration (#72)
* docs: re-phrase a note about Hermes engine integration
* docs: explain the difference between lazy format and its interoperability with lazy support in the app
Copy file name to clipboardExpand all lines: docs/docs/fundamentals/enabling-lazy-bundle.md
+18-13
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,24 @@
2
2
sidebar_position: 2
3
3
---
4
4
5
-
# Enabling Ram Bundle
5
+
# Enabling Lazy Bundle
6
+
7
+
To enable on-demand loading of JavaScript code, you need to activate the lazy bundle feature. In `react-native`, there are two primary types of lazy bundles:
8
+
9
+
-`RAM` (available only for the **JSC** engine, deprecated in `[email protected]`);
10
+
-`mmap` (available only for the **Hermes** engine).
11
+
12
+
Since `mmap` is enabled by default in **Hermes**, this guide focuses on enabling the `RAM` bundle format.
13
+
14
+
:::info Important Note for All JS Engines
15
+
Enabling the lazy bundle format does not automatically mean your app is fully leveraging the benefits of lazy loading. Simply activating the format does not guarantee optimal performance or resource utilization.
16
+
17
+
To truly harness the power of lazy loading (such as caching, pre-loading, and other advanced features) you should use this library. For more details, refer to the [basic usage](./basic-usage.md) and [async loading](../guides/async-loading.md) guides.
18
+
:::
19
+
20
+
:::caution Hermes engine apps
21
+
This page is focusing only on enabling lazy bundle format for **JSC** engine. If you are using **Hermes** then no extra steps are required (since lazy format is enabled by default) and you can go to the next [basic usage](./basic-usage.md) guide and skip this page.
22
+
:::
6
23
7
24
## RAM... What is it? About RAM Bundle format
8
25
@@ -32,14 +49,6 @@ The official way to bundle your React Native apps at the moment is using Metro B
32
49
33
50
-**File RAM Bundle**: With this approach, every module is stored in a separate file with the name `js-modules/${id}.js`, where `${id}` is the module’s ID. This format is used by default on Android devices but has the same purpose: to have fast access to individual modules in your bundle.
34
51
35
-
:::caution RAM Bundle deprecation
36
-
Starting from `react-native` 0.75 RAM Bundle format has been [deprecated](https://reactnative.dev/blog/2024/08/12/release-0.75#community-cli-removal-of-ram-bundle-and-profile-hermes-commands). The **recommended** approach is to use `Hermes` engine, where lazy loading is enabled by default and no extra-actions are required to enable it.
37
-
:::
38
-
39
-
:::danger Hermes enabled
40
-
If you are trying to enable this feature with Hermes engine, you may faced with application crash. It's a known [issue](https://github.com/facebook/react-native/issues/25730). If you are using Hermes then you **don't need** to use RAM format, because Hermes is using lazy loadable [format](https://github.com/facebook/react-native/issues/25730#issuecomment-514115115) by default. **RAM format is actual only for JSC engine.**
41
-
:::
42
-
43
52
## Enabling RAM Bundle feature in your application (JSC only)
44
53
45
54
For enabling this format in your application you need to do pretty simple steps for each platform.
@@ -48,10 +57,6 @@ For enabling this format in your application you need to do pretty simple steps
48
57
Although enabling RAM Bundle format is recommended for both platforms, you can only enable it for one if necessary.
49
58
:::
50
59
51
-
:::info Actual only for JSC
52
-
All steps below are actual only for **JSC** engine. If you are using Hermes engine on all platforms then you can go to the [next](./basic-usage.md) section.
53
-
:::
54
-
55
60
### Android
56
61
57
62
Open `android/app/build.gradle` and edit your file in the following way.
Copy file name to clipboardExpand all lines: docs/versioned_docs/version-3.x/fundamentals/enabling-lazy-bundle.md
+18-13
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,24 @@
2
2
sidebar_position: 2
3
3
---
4
4
5
-
# Enabling Ram Bundle
5
+
# Enabling Lazy Bundle
6
+
7
+
To enable on-demand loading of JavaScript code, you need to activate the lazy bundle feature. In `react-native`, there are two primary types of lazy bundles:
8
+
9
+
-`RAM` (available only for the **JSC** engine, deprecated in `[email protected]`);
10
+
-`mmap` (available only for the **Hermes** engine).
11
+
12
+
Since `mmap` is enabled by default in **Hermes**, this guide focuses on enabling the `RAM` bundle format.
13
+
14
+
:::info Important Note for All JS Engines
15
+
Enabling the lazy bundle format does not automatically mean your app is fully leveraging the benefits of lazy loading. Simply activating the format does not guarantee optimal performance or resource utilization.
16
+
17
+
To truly harness the power of lazy loading (such as caching, pre-loading, and other advanced features) you should use this library. For more details, refer to the [basic usage](./basic-usage.md) and [async loading](../guides/async-loading.md) guides.
18
+
:::
19
+
20
+
:::caution Hermes engine apps
21
+
This page is focusing only on enabling lazy bundle format for **JSC** engine. If you are using **Hermes** then no extra steps are required (since lazy format is enabled by default) and you can go to the next [basic usage](./basic-usage.md) guide and skip this page.
22
+
:::
6
23
7
24
## RAM... What is it? About RAM Bundle format
8
25
@@ -32,14 +49,6 @@ The official way to bundle your React Native apps at the moment is using Metro B
32
49
33
50
-**File RAM Bundle**: With this approach, every module is stored in a separate file with the name `js-modules/${id}.js`, where `${id}` is the module’s ID. This format is used by default on Android devices but has the same purpose: to have fast access to individual modules in your bundle.
34
51
35
-
:::caution RAM Bundle deprecation
36
-
Starting from `react-native` 0.75 RAM Bundle format has been [deprecated](https://reactnative.dev/blog/2024/08/12/release-0.75#community-cli-removal-of-ram-bundle-and-profile-hermes-commands). The **recommended** approach is to use `Hermes` engine, where lazy loading is enabled by default and no extra-actions are required to enable it.
37
-
:::
38
-
39
-
:::danger Hermes enabled
40
-
If you are trying to enable this feature with Hermes engine, you may faced with application crash. It's a known [issue](https://github.com/facebook/react-native/issues/25730). If you are using Hermes then you **don't need** to use RAM format, because Hermes is using lazy loadable [format](https://github.com/facebook/react-native/issues/25730#issuecomment-514115115) by default. **RAM format is actual only for JSC engine.**
41
-
:::
42
-
43
52
## Enabling RAM Bundle feature in your application (JSC only)
44
53
45
54
For enabling this format in your application you need to do pretty simple steps for each platform.
@@ -48,10 +57,6 @@ For enabling this format in your application you need to do pretty simple steps
48
57
Although enabling RAM Bundle format is recommended for both platforms, you can only enable it for one if necessary.
49
58
:::
50
59
51
-
:::info Actual only for JSC
52
-
All steps below are actual only for **JSC** engine. If you are using Hermes engine on all platforms then you can go to the [next](./basic-usage.md) section.
53
-
:::
54
-
55
60
### Android
56
61
57
62
Open `android/app/build.gradle` and edit your file in the following way.
0 commit comments