{"componentChunkName":"component---src-templates-platform-tsx","path":"/platforms/react-native/ram-bundles/","result":{"data":{"file":{"id":"fd061170-c8d6-5891-8afd-16c7c7d325e0","relativePath":"react-native/ram-bundles.mdx","sourceInstanceName":"platforms","childMarkdownRemark":null,"childMdx":{"body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"Using RAM Bundles\"\n};\n\nvar makeShortcode = function makeShortcode(name) {\n  return function MDXDefaultShortcode(props) {\n    console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\");\n    return mdx(\"div\", props);\n  };\n};\n\nvar CodeTabs = makeShortcode(\"CodeTabs\");\nvar CodeBlock = makeShortcode(\"CodeBlock\");\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, [\"components\"]);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"The \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://facebook.github.io/react-native/docs/performance#ram-bundles-inline-requires\"\n  }), \"RAM bundle\"), \" format is a new approach to packaging React Native apps that optimizes your app's startup time. With RAM bundles, it is possible to load to memory only those modules that are needed for specific functionality, and only when needed.\"), mdx(\"p\", null, \"All the existing RAM bundle formats are explained in detail in the \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://facebook.github.io/metro/docs/en/bundling\"\n  }), \"Metro Bundler documentation\"), \".\"), mdx(\"h2\", {\n    \"id\": \"enabling-ram-bundles\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#enabling-ram-bundles\",\n    \"aria-label\": \"enabling ram bundles permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Enabling RAM Bundles\"), mdx(\"p\", null, \"To enable RAM bundles for your app, please consult with the \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://facebook.github.io/react-native/docs/performance#enable-the-ram-format\"\n  }), \"official React Native documentation\"), \".\"), mdx(\"p\", null, \"If you use the official \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"react-native-sentry\"), \" integration of version \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"0.43.1\"), \" or newer, no additional actions are required. \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"sentry-cli\"), \", which is used internally by the integration, will detect the bundle type automatically, and then upload the extracted modules to Sentry.\"), mdx(\"h2\", {\n    \"id\": \"uploading-bundles-manually\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#uploading-bundles-manually\",\n    \"aria-label\": \"uploading bundles manually permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Uploading Bundles Manually\"), mdx(\"p\", null, \"Starting from version \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"1.43.0\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"sentry-cli\"), \" provides two additional parameters to the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"upload-sourcemaps\"), \" command to simplify bundle uploads: \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"--bundle\"), \" and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"--bundle-sourcemap\"), \". Using those parameters, you can pass the path to the application bundle, along with its source map, and the bundle will be automatically extracted before the upload, if necessary:\"), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"shell\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"shell\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-shell\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-shell\"\n  }), \"sentry-cli releases files RELEASE_ID upload-sourcemaps --bundle main.bundle --bundle-sourcemap main.bundle.map\")))))), mdx(\"p\", null, \"All bundle types (plain, Indexed RAM bundles, and File RAM bundles) are supported.\"), mdx(\"h2\", {\n    \"id\": \"ram-bundles-and-performance\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#ram-bundles-and-performance\",\n    \"aria-label\": \"ram bundles and performance permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"RAM Bundles and Performance\"), mdx(\"p\", null, \"The initial Sentry support for RAM bundles, added in \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"sentry-cli 1.43.0\"), \" and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"react-native-sentry 0.43.1\"), \", is known to have an upload performance issue when handling RAM bundles with a large number of modules. This will be fixed in future client versions.\"), mdx(\"p\", null, \"By default, when running as part of Xcode build step (customarily called \\\"Bundle React Native Code And Images\\\"), \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"sentry-cli\"), \" uploads source maps to Sentry in the background. To make it run in the foreground and track its progress, you can add \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"--force-foreground\"), \" parameter to the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"sentry-cli\"), \" command in your Xcode project configuration file \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"project.pbxproj\"), \", so the command looks similar to:\"), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"shell\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"shell\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-shell\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-shell\"\n  }), \"./node_modules/@sentry/cli/bin/sentry-cli react-native xcode --force-foreground \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"..\"), \"/node_modules/react-native/scripts/react-native-xcode.sh\")))))));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{"items":[{"url":"#enabling-ram-bundles","title":"Enabling RAM Bundles"},{"url":"#uploading-bundles-manually","title":"Uploading Bundles Manually"},{"url":"#ram-bundles-and-performance","title":"RAM Bundles and Performance"}]},"internal":{"type":"Mdx"}}}},"pageContext":{"excerpt":"The  RAM bundle  format is a new approach to packaging React Native apps that optimizes your app's startup time. With RAM bundles, it is possible to load to memory only those modules that are needed for specific functionality, and only when needed. All the existing RAM bundle formats are explained in detail in the  Metro Bundler documentation . Enabling RAM Bundles To enable RAM bundles for your app, please consult with the  official React Native documentation . If you use the official  react-native-sentry  integration of version  0.43.1  or newer, no additional actions are required.  sentry-cli , which is used internally by the integration, will detect the bundle type automatically, and then upload the extracted modules to Sentry. Uploading Bundles Manually Starting from version  1.43.0 ,  sentry-cli  provides two additional parameters to the  upload-sourcemaps  command to simplify bundle uploads:  --bundle  and  --bundle-sourcemap . Using those parameters, you can pass the path to the application bundle, along with its source map, and the bundle will be automatically extracted before the upload, if necessary: All bundle types (plain, Indexed RAM bundles, and File RAM bundles) are supported. RAM Bundles and Performance The initial Sentry support for RAM bundles, added in  sentry-cli 1.43.0  and  react-native-sentry 0.43.1 , is known to have an upload performance issue when handling RAM bundles with a large number of modules. This will be fixed in future client versions. By default, when running as part of Xcode build step (customarily called \"Bundle React Native Code And Images\"),  sentry-cli  uploads source maps to Sentry in the background. To make it run in the foreground and track its progress, you can add  --force-foreground  parameter to the  sentry-cli  command in your Xcode project configuration file  project.pbxproj , so the command looks similar to:","title":"Using RAM Bundles","platform":{"name":"react-native","title":"React Native"},"id":"fd061170-c8d6-5891-8afd-16c7c7d325e0"}},"staticQueryHashes":["1218203755","1222113826","1222113826","1766336459","2158593473","2404336828","2472290386","2764967025","3818502851","4015007367","4192517163","4264099332","518019976"]}