<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>React Native Blog</title>
        <link>https://reactnative.dev/blog</link>
        <description>React Native Blog</description>
        <lastBuildDate>Wed, 06 Dec 2023 00:00:00 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <copyright>Copyright © 2024 Meta Platforms, Inc.</copyright>
        <item>
            <title><![CDATA[React Native 0.73 - Debugging Improvements, Stable Symlink Support, and more]]></title>
            <link>https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks</link>
            <guid>https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks</guid>
            <pubDate>Wed, 06 Dec 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[Today we're releasing React Native 0.73! This release adds improvements to debugging with Hermes, stable symlink support, Android 14 support, and new experimental features. We are also deprecating legacy debugging features, and are releasing the next pillar of the New Architecture: Bridgeless Mode!]]></description>
            <content:encoded><![CDATA[<p>Today we're releasing React Native 0.73! This release adds improvements to debugging with Hermes, stable symlink support, Android 14 support, and new experimental features. We are also deprecating legacy debugging features, and are releasing the next pillar of the New Architecture: Bridgeless Mode!</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="highlights">Highlights<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#highlights" class="hash-link" aria-label="Direct link to Highlights" title="Direct link to Highlights">​</a></h3>
<ul>
<li><a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#debugging-improvements">Debugging Improvements</a></li>
<li><a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#stable-symlink-support-in-metro">Stable Symlink Support in Metro</a></li>
<li><a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#kotlin-template-on-android">Kotlin Template on Android</a></li>
<li><a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#android-14-support">Android 14 Support</a></li>
<li><a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#new-architecture-updates">New Architecture Updates</a></li>
<li><a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#deprecated-debugging-features">Deprecated Debugging Features</a></li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="breaking-changes">Breaking Changes<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#breaking-changes" class="hash-link" aria-label="Direct link to Breaking Changes" title="Direct link to Breaking Changes">​</a></h3>
<ul>
<li><a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#babel-package-renames">Babel Package Renames</a></li>
<li><a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#other-breaking-changes">Other Breaking Changes</a></li>
<li><a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#react-native-cli-changes">React Native CLI Changes</a></li>
<li><a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#deprecated-typesreact-native">Deprecated @types/react-native</a></li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="highlights-1">Highlights<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#highlights-1" class="hash-link" aria-label="Direct link to Highlights" title="Direct link to Highlights">​</a></h2>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="debugging-improvements">Debugging Improvements<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#debugging-improvements" class="hash-link" aria-label="Direct link to Debugging Improvements" title="Direct link to Debugging Improvements">​</a></h3>
<p>The React Native and Hermes teams are committed to improving the debugging experience in React Native. In 0.73, we're happy to share some initial progress out of this ongoing investment.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="console-log-history-in-hermes">Console Log History in Hermes<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#console-log-history-in-hermes" class="hash-link" aria-label="Direct link to Console Log History in Hermes" title="Direct link to Console Log History in Hermes">​</a></h4>
<p><code>console.log()</code> is an ever popular way for developers to quickly debug their JavaScript code. In previous releases, console logs in React Native apps would not be recorded until a debugger was connected. This made it hard to observe logs that occur early during app load.</p>
<p>In React Native 0.73 we've addressed this issue. Hermes now captures all <code>console.log()</code> calls in the background, which will be sent to the Console tab when a debugger is first connected — matching the debugging experience in web browsers. This new behaviour works across Flipper, Chrome DevTools connected to Hermes, and the experimental New Debugger.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="updated-debugging-docs">Updated Debugging Docs<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#updated-debugging-docs" class="hash-link" aria-label="Direct link to Updated Debugging Docs" title="Direct link to Updated Debugging Docs">​</a></h4>
<p>We've refreshed the <a href="https://reactnative.dev/docs/debugging">Debugging</a> section of our docs, which now includes up-to-date information on how to connect all supported debuggers, more info on React DevTools, and refreshed visuals.</p>
<p><img loading="lazy" alt="Overview of the Debugging docs as of 0.73" src="https://reactnative.dev/assets/images/0.73-debugging-docs-884b7c2352b4ed16fd0465382bf60e96.jpg" width="1600" height="700" class="img_SS3x"></p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="experimental-new-debugger">Experimental New Debugger<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#experimental-new-debugger" class="hash-link" aria-label="Direct link to Experimental New Debugger" title="Direct link to Experimental New Debugger">​</a></h4>
<p>The React Native team is working on a new JavaScript debugger experience, intended to replace Flipper, with a Technical Preview available as of React Native 0.73. The new debugger opens immediately, and features a stripped-back Chrome DevTools UI customized for debugging React Native with Hermes.</p>
<div class="theme-admonition theme-admonition-note admonition_WCGJ alert alert--secondary"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_pbrs"><p>The new debugger is <strong>experimental</strong> and has some <a href="https://github.com/react-native-community/discussions-and-proposals/discussions/733" target="_blank" rel="noopener noreferrer">known issues</a> we are actively working to solve in a future release of React Native. If you are trying it out, please use the <a href="https://github.com/react-native-community/discussions-and-proposals/discussions/733" target="_blank" rel="noopener noreferrer">same discussion thread</a> to report feedback.</p></div></div>
<p><img loading="lazy" alt="The new debugger frontend opened to the &amp;quot;Welcome&amp;quot; pane" src="https://reactnative.dev/assets/images/debugging-debugger-welcome-28bc7e9bed8673f606577509e0a6a86c.jpg" width="1600" height="740" class="img_SS3x"></p>
<p>Learn more about enabling this experience <a href="https://reactnative.dev/docs/next/debugging?js-debugger=new-debugger#opening-the-debugger">in the docs</a>.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="stable-symlink-support-in-metro">Stable Symlink Support in Metro<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#stable-symlink-support-in-metro" class="hash-link" aria-label="Direct link to Stable Symlink Support in Metro" title="Direct link to Stable Symlink Support in Metro">​</a></h3>
<p>Support for resolving symlinks in Metro is now <strong>enabled by default</strong>. Symlink support enables React Native to work with monorepo setups when containing directories are configured with <a href="https://metrobundler.dev/docs/configuration/#watchfolders" target="_blank" rel="noopener noreferrer"><code>watchFolders</code></a>.</p>
<p>Symlinks are deeply represented in Metro's internals, meaning they work with features such as <a href="https://reactnative.dev/docs/fast-refresh">Fast Refresh</a>, and incur little performance overhead during bundling. Symlinks are supported on all desktop platforms, with and without Watchman.</p>
<div class="theme-admonition theme-admonition-info admonition_WCGJ alert alert--info"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_pbrs"><h4 class="anchor anchorWithStickyNavbar_JmGV" id="monorepo-workarounds">Monorepo workarounds<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#monorepo-workarounds" class="hash-link" aria-label="Direct link to Monorepo workarounds" title="Direct link to Monorepo workarounds">​</a></h4><p>We are aware there are still edge cases when using React Native in a monorepo layout. We have planned work to address some of these, which didn't quite make it into 0.73 —&nbsp;but which we aim to ship as soon as possible.</p><p><strong>For React Native template projects (<code>npx react-native init</code>)</strong>, you will need to configure any <a href="https://metrobundler.dev/docs/configuration/#watchfolders" target="_blank" rel="noopener noreferrer"><code>watchFolders</code></a> outside of the project root in order for Metro to discover them (<a href="https://metrobundler.dev/docs/configuration/#unstable_enablesymlinks-experimental" target="_blank" rel="noopener noreferrer">more info</a>). You may also need to update file paths if your <code>react-native</code> dependency is installed to a folder at a different level.</p><p><strong>For Expo apps</strong>, support for Yarn (Classic) workspaces is configured out of the box. See also the <a href="https://docs.expo.dev/guides/monorepos/" target="_blank" rel="noopener noreferrer">Work with monorepos</a> guide in the Expo docs.</p></div></div>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="kotlin-template-on-android">Kotlin Template on Android<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#kotlin-template-on-android" class="hash-link" aria-label="Direct link to Kotlin Template on Android" title="Direct link to Kotlin Template on Android">​</a></h3>
<p>We're excited to announce that, starting from 0.73, Kotlin is now the <strong>recommended language</strong> for Android apps built with React Native. This follows the direction that the Android ecosystem has been moving in for several years and allows you to write your app using a modern language.</p>
<p>We've updated React Native's template on Android to use Kotlin instead of Java. The new <code>MainActivity.kt</code> and <code>MainApplication.kt</code> files are 36% smaller in size.</p>
<p>The <a href="https://react-native-community.github.io/upgrade-helper/" target="_blank" rel="noopener noreferrer">Upgrade Helper</a> has also been updated to make it easier to migrate your <code>.java</code> files to <code>.kt</code> files.
If you've previously modified the Java files in your project and you need support migrating them to Kotlin, you can use the <code>Code &gt; Convert Java file to Kotlin File</code> utility of Android Studio (also accessible with the shortcut <kbd>Cmd ⌘</kbd> + <kbd>Shift ⇧</kbd> + <kbd>Option ⌥</kbd> + <kbd>K</kbd>).</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="android-14-support">Android 14 Support<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#android-14-support" class="hash-link" aria-label="Direct link to Android 14 Support" title="Direct link to Android 14 Support">​</a></h3>
<p>We've updated React Native to fully support Android 14. Starting from 0.73, React Native developers can now target the latest Android SDK version, <a href="https://developer.android.com/guide/topics/manifest/uses-sdk-element?hl=en#ApiLevels" target="_blank" rel="noopener noreferrer">API Level 34</a> (<em>Upside Down Cake</em>).</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="java-17-and-android-gradle-plugin-upgrade">Java 17 and Android Gradle Plugin upgrade<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#java-17-and-android-gradle-plugin-upgrade" class="hash-link" aria-label="Direct link to Java 17 and Android Gradle Plugin upgrade" title="Direct link to Java 17 and Android Gradle Plugin upgrade">​</a></h4>
<p>In order to support Android 14, we've updated the version of Android Gradle Plugin (AGP) used to build Android apps from <code>7.4.x</code> to <code>8.1.x</code>.</p>
<p>This major version bump of AGP comes with a series of breaking changes that are available in the release notes from Google (<a href="https://developer.android.com/build/releases/past-releases/agp-8-0-0-release-notes" target="_blank" rel="noopener noreferrer">8.0.0</a> and <a href="https://developer.android.com/build/releases/past-releases/agp-8-1-0-release-notes" target="_blank" rel="noopener noreferrer">8.1.0</a>).</p>
<p>Most importantly, <strong>Java 17</strong> is now a requirement to build Android apps. You can update your Java version to 17 by running:</p>
<div class="language-sh codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-sh codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token plain">brew tap homebrew/cask-versions</span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">brew install --cask zulu17</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<p>and by updating your <code>JAVA_HOME</code> as documented in the <a href="https://reactnative.dev/docs/environment-setup" target="_blank" rel="noopener noreferrer">Getting Started guide</a>.</p>
<p>If you're a library developer, your libraries should work with React Native 0.73 without changes. Earlier this year, <a href="https://github.com/react-native-community/discussions-and-proposals/issues/671" target="_blank" rel="noopener noreferrer">we published a note</a> with a clarification on what the AGP bump means for you as a library author.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="grant-partial-access-to-photos-and-videos">Grant partial access to photos and videos<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#grant-partial-access-to-photos-and-videos" class="hash-link" aria-label="Direct link to Grant partial access to photos and videos" title="Direct link to Grant partial access to photos and videos">​</a></h4>
<p><a href="https://developer.android.com/about/versions/14/changes/partial-photo-video-access" target="_blank" rel="noopener noreferrer">Selected Photos Access</a> allows Android 14 users to grant apps access to specific items in their media library, rather than access to all media. In 0.73, React Native apps now support this capability, by using the <code>READ_MEDIA_VISUAL_USER_SELECTED</code> permission in the <a href="https://reactnative.dev/docs/permissionsandroid"><code>PermissionsAndroid</code></a> API.</p>
<p><img loading="lazy" alt="Selected Photos Access in Android 14" src="https://reactnative.dev/assets/images/0.73-android-media-picker-299ce04377976b6d937149c7d0c82d35.jpg" width="1600" height="900" class="img_SS3x"></p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="min-sdk-bump">Min SDK bump<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#min-sdk-bump" class="hash-link" aria-label="Direct link to Min SDK bump" title="Direct link to Min SDK bump">​</a></h4>
<p>React Native 0.73 will be the final version which supports Android 5.0 (API Level 21). The next version of React Native will have a minimum SDK version of 23 (Android 6.0). Read more about the upcoming changes to min SDK bump <a href="https://github.com/react-native-community/discussions-and-proposals/discussions/740" target="_blank" rel="noopener noreferrer">here</a>.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="new-architecture-updates">New Architecture Updates<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#new-architecture-updates" class="hash-link" aria-label="Direct link to New Architecture Updates" title="Direct link to New Architecture Updates">​</a></h3>
<p>We continue the rollout of React Native's New Architecture, to make it available to everyone in the Open Source community.</p>
<p>Since React Native 0.68, both the New Renderer (Fabric) and the New Native Module System (TurboModules) were available to users to experiment and evaluate. We want to thank the community for the feedback we've received so far.</p>
<p>Today we're releasing another piece of the New Architecture: <a href="https://github.com/reactwg/react-native-new-architecture/discussions/154" target="_blank" rel="noopener noreferrer"><strong>Bridgeless Mode</strong></a>. Up until now, when you enable the New Architecture in your app, the Bridge would still be available to support backward compatibility with older components and modules. However, our vision is to fully sunset the bridge. Starting from React Native 0.73, you can enable Bridgeless Mode which will disable the creation of the bridge entirely.</p>
<p>Together with Bridgeless Mode, we're shipping a Native Module Interop Layer, that will allow you to reuse your old modules when in Bridgeless Mode. The <a href="https://github.com/reactwg/react-native-new-architecture/discussions/135" target="_blank" rel="noopener noreferrer">Renderer Interop Layer</a> introduced in React Native 0.72 has also been adapted to work with Bridgeless Mode.</p>
<p>As with the rest of the New Architecture, Bridgeless Mode is initially experimental. We invite interested users to enable it and report any problems and incompatibilities you face in the <a href="https://github.com/reactwg/react-native-new-architecture/discussions" target="_blank" rel="noopener noreferrer">New Architecture working group</a>.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="deprecated-debugging-features">Deprecated Debugging Features<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#deprecated-debugging-features" class="hash-link" aria-label="Direct link to Deprecated Debugging Features" title="Direct link to Deprecated Debugging Features">​</a></h3>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="flipper--react-native-integration">Flipper ↔ React Native integration<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#flipper--react-native-integration" class="hash-link" aria-label="Direct link to Flipper ↔ React Native integration" title="Direct link to Flipper ↔ React Native integration">​</a></h4>
<p>We are gradually moving away from Flipper as the default tool for debugging React Native apps. In 0.73, this begins by deprecating the native Flipper integration included with React Native (bootstrap code which wires up Flipper's core plugins). We will be removing this integration and dependency in the next release —&nbsp;meaning parts of Flipper such as the Network plugin will cease to work.</p>
<p><strong>Unchanged</strong>: Flipper as a standalone product for native app debugging will continue to exist. Even after its removal from new React Native projects in the future, developers will be able to <a href="https://fbflipper.com/docs/getting-started/android-native/" target="_blank" rel="noopener noreferrer">manually add Flipper to their app</a> if they wish.</p>
<p>For more information on why we are moving away from Flipper, <a href="https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0641-decoupling-flipper-from-react-native-core.md" target="_blank" rel="noopener noreferrer">view the RFC</a>.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="remote-javascript-debugging">Remote JavaScript Debugging<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#remote-javascript-debugging" class="hash-link" aria-label="Direct link to Remote JavaScript Debugging" title="Direct link to Remote JavaScript Debugging">​</a></h4>
<p>Remote JavaScript Debugging is a legacy debugging mode that connects an external web browser (Chrome) to your app and runs your JavaScript code inside a web page, i.e. <code>http://localhost:8081/debugger-ui</code>. This model could lead to inconsistent app behaviour while debugging, and is incompatible with native modules under the New Architecture.</p>
<p>In 0.73, <a href="https://github.com/react-native-community/discussions-and-proposals/discussions/734" target="_blank" rel="noopener noreferrer">Remote JavaScript Debugging is deprecated</a> and has been removed from the Dev Menu. Enabling the remote debugger must now be done manually via the <code>NativeDevSettings</code> API. Doing this is covered in the <a href="https://reactnative.dev/docs/next/other-debugging-methods#remote-js-debugging">Other Debugging Methods docs</a>.</p>
<div class="theme-admonition theme-admonition-info admonition_WCGJ alert alert--info"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_pbrs"><p>Remote JavaScript Debugging was previously the default debugging experience for apps using JavaScriptCore (JSC). We recommend <a href="https://reactnative.dev/docs/next/other-debugging-methods#safari-developer-tools-direct-jsc-debugging">Safari Developer Tools (direct JSC debugging)</a> instead, for iOS apps.</p><p>We recommend using <a href="https://reactnative.dev/docs/hermes">Hermes</a> for a consistent debugging experience on all platforms.</p></div></div>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="breaking-changes-1">Breaking Changes<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#breaking-changes-1" class="hash-link" aria-label="Direct link to Breaking Changes" title="Direct link to Breaking Changes">​</a></h2>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="babel-package-renames">Babel Package Renames<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#babel-package-renames" class="hash-link" aria-label="Direct link to Babel Package Renames" title="Direct link to Babel Package Renames">​</a></h3>
<p>We've relocated two Babel-related packages out of Metro and into React Native's repository and versioning scheme, enabling us to simplify maintenance and upgrades. The new versions of these packages support New Architecture features in 0.73, meaning these dependencies must be updated.</p>
<p>Please follow the <a href="https://react-native-community.github.io/upgrade-helper/" target="_blank" rel="noopener noreferrer">Upgrade Helper</a> when upgrading, to ensure you have updated these dependencies. Some packages have been renamed:</p>
<table><thead><tr><th>Old Package Name</th><th>New Package Name</th></tr></thead><tbody><tr><td><code>metro-react-native-babel-preset</code></td><td><code>@react-native/babel-preset</code></td></tr><tr><td><code>metro-react-native-babel-transformer</code></td><td><code>@react-native/metro-babel-transformer</code></td></tr></tbody></table>
<div class="theme-admonition theme-admonition-info admonition_WCGJ alert alert--info"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_pbrs"><p><code>@react-native/babel-preset</code> now includes <code>@react-native/babel-plugin-codegen</code>, this no longer needs to be specified separately in your Babel config file.</p></div></div>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="other-breaking-changes">Other Breaking Changes<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#other-breaking-changes" class="hash-link" aria-label="Direct link to Other Breaking Changes" title="Direct link to Other Breaking Changes">​</a></h3>
<p>These are some of the key breaking changes in 0.73. Please consult the <a href="https://github.com/facebook/react-native/blob/main/CHANGELOG.md" target="_blank" rel="noopener noreferrer">full changelog</a> for the complete list of breaking changes.</p>
<ul>
<li>Raise minimum Node.js requirement to 18.x (<a href="https://github.com/facebook/react-native/pull/37709" target="_blank" rel="noopener noreferrer">#37709</a>) (see also <a href="https://nodejs.org/en/blog/announcements/nodejs16-eol" target="_blank" rel="noopener noreferrer">Node.js 16 EOL</a>).</li>
<li>The template now uses TypeScript 5.0 (<a href="https://github.com/facebook/react-native/pull/36862" target="_blank" rel="noopener noreferrer">#36862</a>).<!-- -->
<ul>
<li>React Native types continue working on TypeScript 4.8.</li>
</ul>
</li>
<li><strong>Android</strong>: Java 17 is now a requirement to build Android apps (<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#java-17-and-android-gradle-plugin-upgrade">see above</a>).</li>
<li><strong>Android</strong>: Major bump of Fresco to 3.0 (<a href="https://github.com/facebook/react-native/pull/38275" target="_blank" rel="noopener noreferrer">#38275</a>).</li>
<li><strong>iOS</strong>: Raise minimum iOS version to 13.4 (<a href="https://github.com/facebook/react-native/pull/36795" target="_blank" rel="noopener noreferrer">#36795</a>).</li>
<li><strong>iOS</strong>: Metro will no longer be automatically started when running builds via Xcode (<a href="https://github.com/facebook/react-native/pull/38242" target="_blank" rel="noopener noreferrer">#38242</a>).</li>
</ul>
<p>For library authors:</p>
<ul>
<li><strong>Android</strong>: Bump to AGP 8.1.1 (<a href="https://github.com/react-native-community/discussions-and-proposals/issues/671" target="_blank" rel="noopener noreferrer">discussion</a>)</li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="react-native-cli-changes">React Native CLI Changes<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#react-native-cli-changes" class="hash-link" aria-label="Direct link to React Native CLI Changes" title="Direct link to React Native CLI Changes">​</a></h3>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="highlighted-breaking-changes">Highlighted breaking changes<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#highlighted-breaking-changes" class="hash-link" aria-label="Direct link to Highlighted breaking changes" title="Direct link to Highlighted breaking changes">​</a></h4>
<ul>
<li>Change default task prefix in <code>build-android</code> command. From now on, when you run <code>build-android</code>, the <code>bundle</code> task will be run instead of <code>assemble</code> (<a href="https://github.com/react-native-community/cli/pull/1913" target="_blank" rel="noopener noreferrer">#1913</a>).</li>
<li>Remove fallback flow for Metro config defaults (<a href="https://github.com/react-native-community/cli/pull/1972" target="_blank" rel="noopener noreferrer">#1972</a>).<!-- -->
<ul>
<li>The <a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#new-metroconfigjs-setup">updated <code>metro.config.js</code> format</a> from 0.72 is now required in 0.73, as we have removed the fallback copy of these defaults from CLI.</li>
</ul>
</li>
<li>Remove <code>--configuration</code> option from <code>run-ios</code> (replaced with <code>--mode</code>) (<a href="https://github.com/react-native-community/cli/pull/2028" target="_blank" rel="noopener noreferrer">#2028</a>).</li>
<li>Remove <code>--variant</code> option from <code>build-android</code> command (replaced with <code>--mode</code>) (<a href="https://github.com/react-native-community/cli/pull/2026" target="_blank" rel="noopener noreferrer">#2026</a>).</li>
</ul>
<p><a href="https://github.com/react-native-community/cli/releases/tag/v12.0.0" target="_blank" rel="noopener noreferrer">See full changelog for v12.0.0</a>.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="deprecated-typesreact-native">Deprecated <code>@types/react-native</code><a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#deprecated-typesreact-native" class="hash-link" aria-label="Direct link to deprecated-typesreact-native" title="Direct link to deprecated-typesreact-native">​</a></h3>
<p>As mentioned in <a href="https://reactnative.dev/blog/2023/01/03/typescript-first#declarations-shipped-with-react-native">First-class Support for TypeScript</a>, we have shipped TypeScript types with <code>react-native</code> since 0.71 and we are now deprecating <code>@types/react-native</code> for 0.73.</p>
<p>We will not ship any future patches for existing versions. The guidance is to migrate away from <code>@types/react-native</code>. See instructions on <a href="https://reactnative.dev/blog/2023/01/03/typescript-first#how-to-migrate">how to migrate</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="acknowledgements">Acknowledgements<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#acknowledgements" class="hash-link" aria-label="Direct link to Acknowledgements" title="Direct link to Acknowledgements">​</a></h2>
<p>React Native 0.73 contains over <a href="https://github.com/facebook/react-native/compare/v0.72.7...v0.73.0" target="_blank" rel="noopener noreferrer">2259 commits</a> from 68 contributors. Thanks for all your hard work!</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="upgrade-to-073">Upgrade to 0.73<a href="https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#upgrade-to-073" class="hash-link" aria-label="Direct link to Upgrade to 0.73" title="Direct link to Upgrade to 0.73">​</a></h2>
<p>Please use the <a href="https://react-native-community.github.io/upgrade-helper/" target="_blank" rel="noopener noreferrer">React Native Upgrade Helper</a> to view code changes between React Native versions for existing projects, in addition to the <a href="https://reactnative.dev/docs/upgrading">Upgrading docs</a>. You can also create a new project with <code>npx react-native@latest init MyProject</code>.</p>
<p>If you use Expo, React Native 0.73 will be supported in the Expo SDK 50 release.</p>
<div class="theme-admonition theme-admonition-info admonition_WCGJ alert alert--info"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_pbrs"><p>0.73 is now the latest stable version of React Native and <strong>0.70.x now moves to unsupported</strong>. For more information see <a href="https://github.com/reactwg/react-native-releases#releases-support-policy" target="_blank" rel="noopener noreferrer">React Native’s support policy</a>.</p></div></div>]]></content:encoded>
            <category>announcement</category>
            <category>release</category>
            <category>debugging</category>
        </item>
        <item>
            <title><![CDATA[React Native 0.72 - Symlink Support, Better Errors, and more]]></title>
            <link>https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks</link>
            <guid>https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks</guid>
            <pubDate>Wed, 21 Jun 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[Today we’re releasing 0.72!]]></description>
            <content:encoded><![CDATA[<p>Today we’re releasing 0.72!</p>
<p>This release adds highly requested features for Metro, better error handling, and other developer experience improvements. So much of this work was prioritized from your feedback on the <a href="https://github.com/react-native-community/discussions-and-proposals/discussions/528" target="_blank" rel="noopener noreferrer">2022 community survey</a> -- thank you to all those that participated!</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="highlights">Highlights<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#highlights" class="hash-link" aria-label="Direct link to Highlights" title="Direct link to Highlights">​</a></h3>
<ul>
<li><a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#new-metro-features">New Metro Features</a></li>
<li><a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#developer-experience-improvements">Developer Experience Improvements</a></li>
<li><a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#moving-new-architecture-updates">Moving New Architecture Updates</a></li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="breaking-changes">Breaking Changes<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#breaking-changes" class="hash-link" aria-label="Direct link to Breaking Changes" title="Direct link to Breaking Changes">​</a></h3>
<ul>
<li><a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#deprecated-component-removals">Deprecated Component Removals</a></li>
<li><a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#package-renames">Package Renames</a></li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="highlights-1">Highlights<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#highlights-1" class="hash-link" aria-label="Direct link to Highlights" title="Direct link to Highlights">​</a></h2>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="new-metro-features">New Metro Features<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#new-metro-features" class="hash-link" aria-label="Direct link to New Metro Features" title="Direct link to New Metro Features">​</a></h3>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="symlink-support-beta">Symlink Support (Beta)<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#symlink-support-beta" class="hash-link" aria-label="Direct link to Symlink Support (Beta)" title="Direct link to Symlink Support (Beta)">​</a></h4>
<p>Symlink support continues to be one of the top-requested features in Metro and, in React Native 0.72, we are happy to announce beta support for it.</p>
<p>Symlink support enables React Native to work transparently with monorepo setups and pnpm, removing the need for workarounds. See <a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#enabling-beta-features">Enabling Beta Features</a> to use in your app.</p>
<p>It is currently in beta to collect feedback on developer experience given varying workflows, see more details <a href="https://twitter.com/robjhogan/status/1672293540632641554" target="_blank" rel="noopener noreferrer">here</a>. We plan to default enable symlinks in 0.73.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="package-exports-support-beta">Package Exports Support (Beta)<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#package-exports-support-beta" class="hash-link" aria-label="Direct link to Package Exports Support (Beta)" title="Direct link to Package Exports Support (Beta)">​</a></h4>
<p><a href="https://nodejs.org/api/packages.html#exports" target="_blank" rel="noopener noreferrer">Package Exports</a> is the modern alternative to the package.json <code>"main"</code> field and provides new capabilities for npm packages to define their public API and target React Native.</p>
<p>By enabling Package Exports support in your Metro config, your app will be compatible with the wider JavaScript ecosystem, including via the new <a href="https://nodejs.org/docs/latest-v19.x/api/packages.html#community-conditions-definitions" target="_blank" rel="noopener noreferrer">"react-native" community condition</a>. See <a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#enabling-beta-features">Enabling Beta Features</a> to use in your app.</p>
<div class="theme-admonition theme-admonition-tip admonition_WCGJ alert alert--success"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>tip</div><div class="admonitionContent_pbrs"><p>See <a href="https://reactnative.dev/blog/2023/06/21/package-exports-support">Package Exports Support in React Native</a> to learn more about this feature and our plans for stable rollout.</p></div></div>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="enabling-beta-features">Enabling Beta Features<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#enabling-beta-features" class="hash-link" aria-label="Direct link to Enabling Beta Features" title="Direct link to Enabling Beta Features">​</a></h4>
<p>To enable these features in your project, update your app’s <code>metro.config.js</code> file and set either the <code>resolver.unstable_enableSymlinks</code> or <code>resolver.unstable_enablePackageExports</code> options.</p>
<div class="language-js codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-js codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token keyword" style="color:#c5a5c5">const</span><span class="token plain"> config </span><span class="token operator" style="color:#fc929e">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">  </span><span class="token comment" style="color:#93a1a1">// ...</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">  </span><span class="token literal-property property" style="color:#2aa198">resolver</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token literal-property property" style="color:#2aa198">unstable_enableSymlinks</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token boolean" style="color:#ff8b50">true</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token literal-property property" style="color:#2aa198">unstable_enablePackageExports</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token boolean" style="color:#ff8b50">true</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">  </span><span class="token punctuation" style="color:#657b83">}</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token punctuation" style="color:#657b83">}</span><span class="token punctuation" style="color:#657b83">;</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="new-metroconfigjs-setup">New <code>metro.config.js</code> Setup<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#new-metroconfigjs-setup" class="hash-link" aria-label="Direct link to new-metroconfigjs-setup" title="Direct link to new-metroconfigjs-setup">​</a></h4>
<p>In React Native 0.72, we’ve changed the config loading setup for Metro in React Native CLI. Please update your project’s <code>metro.config.js</code> file to match the <a href="https://github.com/facebook/react-native/blob/76a42c292de838a0dd537935db792eaa81410b9b/packages/react-native/template/metro.config.js" target="_blank" rel="noopener noreferrer">template’s version</a>.</p>
<div class="theme-admonition theme-admonition-info admonition_WCGJ alert alert--info"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_pbrs"><p>Please update your config file to the following <a href="https://github.com/facebook/react-native/blob/76a42c292de838a0dd537935db792eaa81410b9b/packages/react-native/template/metro.config.js" target="_blank" rel="noopener noreferrer">format</a>. You can also follow the <a href="https://react-native-community.github.io/upgrade-helper/?from=0.71.8&amp;to=0.72.0" target="_blank" rel="noopener noreferrer">upgrade-helper</a>.</p><p>These format changes to <code>metro.config.js</code> will become required in 0.73. For 0.72, we will log a warning if not updated.</p></div></div>
<p>This moves control over extending the base React Native Metro config into your project, and we’ve cleaned up the leftover defaults. In addition, this means that standalone Metro CLI commands, such as <code>metro get-dependencies</code>, will now work.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="developer-experience-improvements">Developer Experience Improvements<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#developer-experience-improvements" class="hash-link" aria-label="Direct link to Developer Experience Improvements" title="Direct link to Developer Experience Improvements">​</a></h3>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="no-more-redboxes-with-invalid-style-properties">No more redboxes with invalid style properties<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#no-more-redboxes-with-invalid-style-properties" class="hash-link" aria-label="Direct link to No more redboxes with invalid style properties" title="Direct link to No more redboxes with invalid style properties">​</a></h4>
<p>Prior to this release, providing an invalid style property in StyleSheet would result in a redbox. This is a high signal error that disrupts the developer workflow for a relatively low-risk error.</p>
<p>In 0.72, we’ve relaxed this expectation to fail silently, like providing an invalid CSS property in the browser, and have updated types such that some errors may be caught in build-time vs. run-time.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="better-error-readability-for-hermes">Better error readability for Hermes<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#better-error-readability-for-hermes" class="hash-link" aria-label="Direct link to Better error readability for Hermes" title="Direct link to Better error readability for Hermes">​</a></h4>
<p>Hermes has added a better error message when invoking an undefined callable.</p>
<div class="language-jsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-jsx codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token keyword" style="color:#c5a5c5">var</span><span class="token plain"> x </span><span class="token operator" style="color:#fc929e">=</span><span class="token plain"> </span><span class="token keyword nil" style="color:#c5a5c5">undefined</span><span class="token punctuation" style="color:#657b83">;</span><span class="token plain"> </span><span class="token function" style="color:#79b6f2">x</span><span class="token punctuation" style="color:#657b83">(</span><span class="token punctuation" style="color:#657b83">)</span><span class="token punctuation" style="color:#657b83">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token comment" style="color:#93a1a1">// Before: undefined is not a function</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token comment" style="color:#93a1a1">// After: x is not a function (it is undefined)</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<p>In addition, LogBox stack traces now filter out internal Hermes bytecode frames that are not relevant to app users.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="improved-error-output-of-the-react-native-cli">Improved error output of the React Native CLI<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#improved-error-output-of-the-react-native-cli" class="hash-link" aria-label="Direct link to Improved error output of the React Native CLI" title="Direct link to Improved error output of the React Native CLI">​</a></h4>
<p>0.72 ships with React Native CLI v11 which includes improvements to reduce duplication, clarify wording, reduce verbose stack traces, and add deep links to relevant docs in the following commands <code>init</code>, <code>run-android</code>, and <code>run-ios</code>.</p>
<p>You can find other improvements in the <a href="https://github.com/react-native-community/cli/releases" target="_blank" rel="noopener noreferrer">React Native CLI changelogs</a>.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="faster-compilation-and-json-parsing-in-hermes">Faster Compilation and JSON Parsing in Hermes<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#faster-compilation-and-json-parsing-in-hermes" class="hash-link" aria-label="Direct link to Faster Compilation and JSON Parsing in Hermes" title="Direct link to Faster Compilation and JSON Parsing in Hermes">​</a></h4>
<p>Hermes has improved the compilation time of large object literals. For example, in one reported issue, <a href="https://github.com/facebook/hermes/issues/852" target="_blank" rel="noopener noreferrer">#852</a>, a user had an entire dataset written out as a large object literal. By improving the de-duplication algorithm Hermes uses, compilation sped up by 97% (<a href="https://github.com/facebook/hermes/commit/221ce21a209e2e32a3eaaa2d9e28ca81842fad20" target="_blank" rel="noopener noreferrer">221c</a>). These improvements will benefit build times for apps that bundle many objects.</p>
<p>Multiple optimizations (<a href="https://github.com/facebook/hermes/commit/de9cff2aa41fc1f297b568848143347823d73659" target="_blank" rel="noopener noreferrer">de9c</a>, <a href="https://github.com/facebook/hermes/commit/6e2dd652c8d90c5d59737a81f66a259efffdcd00" target="_blank" rel="noopener noreferrer">6e2d</a>) to JSON parsing have also landed, benefiting apps using libraries like redux-persist that rely heavily on JSON manipulation.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="more-ecmascript-support-in-hermes">More ECMAScript Support in Hermes<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#more-ecmascript-support-in-hermes" class="hash-link" aria-label="Direct link to More ECMAScript Support in Hermes" title="Direct link to More ECMAScript Support in Hermes">​</a></h4>
<p>Support for the following specifications in Hermes has landed in React Native 0.72:</p>
<ul>
<li><code>prototype.at</code> support for <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at" target="_blank" rel="noopener noreferrer">Array</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/at" target="_blank" rel="noopener noreferrer">TypedArray</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/at" target="_blank" rel="noopener noreferrer">String</a>. See <a href="https://github.com/facebook/hermes/issues/823" target="_blank" rel="noopener noreferrer">#823</a> (<a href="https://github.com/facebook/hermes/commit/ebe2915ac386a6b73dec39c2af4ac7063e68cd99" target="_blank" rel="noopener noreferrer">ebe2</a>).</li>
<li>Implement <a href="https://github.com/tc39/proposal-well-formed-stringify" target="_blank" rel="noopener noreferrer">well-formed JSON.stringify</a> (<a href="https://github.com/facebook/hermes/commit/d41decf244aa814b1e58827a9de982f3b71667de" target="_blank" rel="noopener noreferrer">d41d</a>) to prevent ill-formed Unicode strings</li>
<li>Implement <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError" target="_blank" rel="noopener noreferrer">AggregateError</a> (<a href="https://github.com/facebook/hermes/commit/9b25a2530eb515f6c4fbd397ae290b6c97c049b2" target="_blank" rel="noopener noreferrer">9b25</a>) that represents several errors wrapped in a single error. Useful for multiple errors like from <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/any" target="_blank" rel="noopener noreferrer"><code>Promise.any()</code></a> when all promises passed to it reject.</li>
</ul>
<p>For users on JSC, these features are already available.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="moving-new-architecture-updates">Moving New Architecture Updates<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#moving-new-architecture-updates" class="hash-link" aria-label="Direct link to Moving New Architecture Updates" title="Direct link to Moving New Architecture Updates">​</a></h3>
<p>The New Architecture is currently experimental. To keep updates focused to their target audience, we are moving New Architecture updates in 0.72, and future releases, to the dedicated <a href="https://github.com/reactwg/react-native-new-architecture/discussions" target="_blank" rel="noopener noreferrer">working group</a>. This change will also allow for more frequent updates, such as work that ships in our nightlies.</p>
<p>You can read the 0.72 updates for the New Architecture <a href="https://github.com/reactwg/react-native-new-architecture/discussions/136" target="_blank" rel="noopener noreferrer">here</a>. Subscribe to the working group GitHub notifications to stay informed on our progress on the New Architecture.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="breaking-changes-1">Breaking Changes<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#breaking-changes-1" class="hash-link" aria-label="Direct link to Breaking Changes" title="Direct link to Breaking Changes">​</a></h2>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="deprecated-component-removals">Deprecated Component Removals<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#deprecated-component-removals" class="hash-link" aria-label="Direct link to Deprecated Component Removals" title="Direct link to Deprecated Component Removals">​</a></h3>
<p>The following packages have been removed from React Native in 0.72. Please migrate to the recommended community package:</p>
<ul>
<li><a href="https://reactnative.dev/docs/next/slider">Slider</a> is superseded by <a href="https://github.com/callstack/react-native-slider/tree/main/package" target="_blank" rel="noopener noreferrer">@react-native-community/slider</a></li>
<li><a href="https://reactnative.dev/docs/next/datepickerios">DatePickerIOS</a> is superseded by <a href="https://github.com/react-native-datetimepicker/datetimepicker" target="_blank" rel="noopener noreferrer">@react-native-community/datetimepicker</a></li>
<li><a href="https://reactnative.dev/docs/next/progressviewios">ProgressViewIOS</a> is superseded by <a href="https://github.com/react-native-progress-view/progress-view" target="_blank" rel="noopener noreferrer">@react-native-community/progress-view</a></li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="package-renames">Package Renames<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#package-renames" class="hash-link" aria-label="Direct link to Package Renames" title="Direct link to Package Renames">​</a></h3>
<p>All packages published from the <a href="https://github.com/facebook/react-native" target="_blank" rel="noopener noreferrer"><code>react-native</code></a> core repository now live under <code>react-native/packages</code>, and are published under the <a href="https://www.npmjs.com/search?q=%40react-native" target="_blank" rel="noopener noreferrer">@react-native npm scope</a> to ensure clear ownership.</p>
<p>There are no changes to the <a href="https://www.npmjs.com/package/react-native" target="_blank" rel="noopener noreferrer">react-native</a> package.</p>
<table><thead><tr><th>Old Package Name</th><th>New Package Name</th></tr></thead><tbody><tr><td><code>@react-native-community/eslint-config</code></td><td><code>@react-native/eslint-config</code></td></tr><tr><td><code>@react-native-community/eslint-plugin</code></td><td><code>@react-native/eslint-plugin</code></td></tr><tr><td><code>@react-native/polyfills</code></td><td><code>@react-native/js-polyfills</code></td></tr><tr><td><code>@react-native/normalize-color</code></td><td><code>@react-native/normalize-colors</code></td></tr><tr><td><code>@react-native/assets</code></td><td><code>@react-native/assets-registry</code></td></tr><tr><td><code>react-native-codegen</code></td><td><code>@react-native/codegen</code></td></tr><tr><td><code>react-native-gradle-plugin</code></td><td><code>@react-native/gradle-plugin</code></td></tr></tbody></table>
<p>This change will not affect you if you have no direct dependency on a renamed package. Otherwise, when upgrading to React Native 0.72, update any renamed dependency to its ~0.72 version.</p>
<p>You can read the motivation that led to these changes <a href="https://github.com/react-native-community/discussions-and-proposals/pull/480" target="_blank" rel="noopener noreferrer">in the dedicated RFC</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="acknowledgements">Acknowledgements<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#acknowledgements" class="hash-link" aria-label="Direct link to Acknowledgements" title="Direct link to Acknowledgements">​</a></h2>
<p>A lot of this release came from the direct feedback from the community. From reports on <a href="https://twitter.com/baconbrix/status/1623039650775371792" target="_blank" rel="noopener noreferrer">noisy redboxes</a>, <a href="https://github.com/facebook/metro/issues/965" target="_blank" rel="noopener noreferrer">bugs with Package Exports</a>, <a href="https://github.com/reactwg/react-native-new-architecture/discussions/85" target="_blank" rel="noopener noreferrer">benchmarks for the New Architecture</a> — all of it is valuable to hear and we appreciate the time it takes to share feedback.</p>
<p>0.72 contains over <a href="https://github.com/facebook/react-native/compare/v0.71.8...v0.72.0" target="_blank" rel="noopener noreferrer">1100 commits</a> from 66 contributors. Thank you for all your hard work!</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="upgrade-to-072">Upgrade to 0.72<a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#upgrade-to-072" class="hash-link" aria-label="Direct link to Upgrade to 0.72" title="Direct link to Upgrade to 0.72">​</a></h2>
<p>Check out the list of needed changes in the <a href="https://react-native-community.github.io/upgrade-helper/" target="_blank" rel="noopener noreferrer">upgrade-helper</a>, or read the <a href="https://reactnative.dev/docs/upgrading">upgrade documentation</a> for how to update your existing project, or create a new project with <code>npx react-native@latest init MyProject</code>.</p>
<p>If you use Expo, React Native version 0.72 will be supported in the Expo SDK 49 release.</p>
<div class="theme-admonition theme-admonition-info admonition_WCGJ alert alert--info"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_pbrs"><p>0.72 is now the latest stable version of React Native and 0.69.x version moves now to unsupported. For more information see <a href="https://github.com/reactwg/react-native-releases#releases-support-policy" target="_blank" rel="noopener noreferrer">React Native’s support policy</a>.</p></div></div>]]></content:encoded>
            <category>announcement</category>
            <category>release</category>
        </item>
        <item>
            <title><![CDATA[Package Exports Support in React Native]]></title>
            <link>https://reactnative.dev/blog/2023/06/21/package-exports-support</link>
            <guid>https://reactnative.dev/blog/2023/06/21/package-exports-support</guid>
            <pubDate>Wed, 21 Jun 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[With the release of React Native 0.72, Metro — our JavaScript build tool — now includes beta support for the package.json "exports" field. When enabled, it adds the following functionality:]]></description>
            <content:encoded><![CDATA[<p>With the release of <a href="https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks">React Native 0.72</a>, Metro — our JavaScript build tool — now includes beta support for the <code>package.json</code> <a href="https://nodejs.org/docs/latest-v18.x/api/packages.html#exports" target="_blank" rel="noopener noreferrer"><code>"exports"</code></a> field. When <a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#enabling-package-exports-beta">enabled</a>, it adds the following functionality:</p>
<ul>
<li><a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#for-app-developers">React Native projects will work with more npm packages out-of-the-box</a></li>
<li><a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#for-package-maintainers-preview">New capabilities for packages to define their API and target React Native</a></li>
<li><a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#breaking-changes">Some breaking changes to package resolution (in edge cases)</a></li>
</ul>
<p>In this post we'll cover how Package Exports works, and what these changes mean for you as a React Native app developer or package maintainer.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="what-is-package-exports">What is Package Exports?<a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#what-is-package-exports" class="hash-link" aria-label="Direct link to What is Package Exports?" title="Direct link to What is Package Exports?">​</a></h2>
<p>Introduced in Node.js 12.7.0, Package Exports is the modern approach for npm packages to specify <strong>entry points</strong> — the mapping of package subpaths which can be externally imported and which file(s) they should resolve to.</p>
<p>Supporting <code>"exports"</code> improves how React Native projects will work with the wider JavaScript ecosystem (<a href="https://github.com/search?q=path%3A%2A%2A%2Fpackage.json+%22%5C%22access%5C%22%3A+%5C%22public%5C%22%22+%22%5C%22exports%5C%22%22+NOT+path%3A%2A%2A%2Fnode_modules+NOT+is%3Afork+NOT+is%3Aarchived&amp;type=code" target="_blank" rel="noopener noreferrer">used in ~16.6k packages today</a>), and gives package authors a standardised feature set for multiplatform packages to target React Native.</p>
<p><a href="https://nodejs.org/docs/latest-v19.x/api/packages.html#exports" target="_blank" rel="noopener noreferrer"><code>"exports"</code></a> can be used alongside, or instead of, <a href="https://nodejs.org/docs/latest-v19.x/api/packages.html#main" target="_blank" rel="noopener noreferrer"><code>"main"</code></a> in a <code>package.json</code> file.</p>
<div class="language-json codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-json codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">  </span><span class="token property" style="color:#2aa198">"name"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">"@storybook/addon-actions"</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">  </span><span class="token property" style="color:#2aa198">"main"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">"./dist/index.js"</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">  ...</span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">  </span><span class="token property" style="color:#2aa198">"exports"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token property" style="color:#2aa198">"."</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">      </span><span class="token property" style="color:#2aa198">"node"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">"./dist/index.js"</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">      </span><span class="token property" style="color:#2aa198">"import"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">"./dist/index.mjs"</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">      </span><span class="token property" style="color:#2aa198">"default"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">"./dist/index.js"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token punctuation" style="color:#657b83">}</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token property" style="color:#2aa198">"./preview"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">      </span><span class="token property" style="color:#2aa198">"import"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">"./dist/preview.mjs"</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">      </span><span class="token property" style="color:#2aa198">"default"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">"./dist/preview.js"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token punctuation" style="color:#657b83">}</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    ...</span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token property" style="color:#2aa198">"./package.json"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">"./package.json"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">  </span><span class="token punctuation" style="color:#657b83">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token punctuation" style="color:#657b83">}</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<p>Here's some app code consuming the above package by importing different subpaths of <code>@storybook/addon-actions</code>.</p>
<div class="language-js codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-js codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token keyword module" style="color:#c5a5c5">import</span><span class="token plain"> </span><span class="token imports punctuation" style="color:#657b83">{</span><span class="token imports">action</span><span class="token imports punctuation" style="color:#657b83">}</span><span class="token plain"> </span><span class="token keyword module" style="color:#c5a5c5">from</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">'@storybook/addon-actions'</span><span class="token punctuation" style="color:#657b83">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// -&gt; '@storybook/addon-actions/dist/index.js'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token keyword module" style="color:#c5a5c5">import</span><span class="token plain"> </span><span class="token imports punctuation" style="color:#657b83">{</span><span class="token imports">action</span><span class="token imports punctuation" style="color:#657b83">}</span><span class="token plain"> </span><span class="token keyword module" style="color:#c5a5c5">from</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">'@storybook/addon-actions/preview'</span><span class="token punctuation" style="color:#657b83">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// -&gt; '@storybook/addon-actions/dist/preview.js'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token keyword module" style="color:#c5a5c5">import</span><span class="token plain"> </span><span class="token imports">helpers</span><span class="token plain"> </span><span class="token keyword module" style="color:#c5a5c5">from</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">'@storybook/addon-actions/src/preset/addArgsHelpers'</span><span class="token punctuation" style="color:#657b83">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// Inaccessible - not listed in "exports"!</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<p>The headlining features of Package Exports are:</p>
<ul>
<li><strong>Package encapsulation</strong>: Only subpaths defined in <code>"exports"</code> can be imported from outside the package —&nbsp;giving packages control over their public API.</li>
<li><strong>Subpath aliases</strong>: Packages can define custom subpaths which map to a different file location (including via <a href="https://nodejs.org/docs/latest-v19.x/api/packages.html#subpath-patterns" target="_blank" rel="noopener noreferrer">subpath patterns</a>) — allowing relocation of files while preserving the public API.</li>
<li><strong>Conditional exports</strong>: A subpath may resolve to a different underlying file depending on environment. For example, to target <code>"node"</code>, <code>"browser"</code>, or <code>"react-native"</code> runtimes —&nbsp;replacing the <a href="https://github.com/defunctzombie/package-browser-field-spec" target="_blank" rel="noopener noreferrer"><code>"browser"</code> field spec</a>.</li>
</ul>
<div class="theme-admonition theme-admonition-note admonition_WCGJ alert alert--secondary"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_pbrs"><p>The full capabilities for <code>"exports"</code> are detailed in the <a href="https://nodejs.org/docs/latest-v19.x/api/packages.html#package-entry-points" target="_blank" rel="noopener noreferrer">Node.js Package Entry Points spec</a>.</p><p>Since these features overlap with existing React Native concepts (such as <a href="https://reactnative.dev/docs/platform-specific-code">platform-specific extensions</a>), and since <code>"exports"</code> had been live in the npm ecosystem for some time, we reached out to the React Native community to make sure our implementation would meet developers' needs (<a href="https://github.com/react-native-community/discussions-and-proposals/pull/534" target="_blank" rel="noopener noreferrer">PR</a>, <a href="https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0534-metro-package-exports-support.md" target="_blank" rel="noopener noreferrer">final RFC</a>).</p></div></div>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="for-app-developers">For app developers<a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#for-app-developers" class="hash-link" aria-label="Direct link to For app developers" title="Direct link to For app developers">​</a></h2>
<p>Package Exports can be enabled today, in beta.</p>
<ul>
<li>Imports against packages that depend on Package Exports features (such as <a href="https://www.npmjs.com/package/firebase" target="_blank" rel="noopener noreferrer"><strong>Firebase</strong></a> and <a href="https://www.npmjs.com/search?q=%40storybook" target="_blank" rel="noopener noreferrer"><strong>Storybook</strong></a>) should now work as designed.</li>
<li>React Native for Web projects using Metro will now be able to use the <code>"browser"</code> conditional export, removing the need for workarounds.</li>
</ul>
<p>Enabling Package Exports brings a few <a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#breaking-changes">edge-case breaking changes</a> that may affect specific projects, and which you can <a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#validating-changes-in-your-project">test today</a>.</p>
<p><strong>In a future React Native release, Package Exports will be enabled by default</strong>. In a chicken-and-egg situation, React Native apps were previously a holdout for some packages to migrate to <code>"exports"</code> — or used our <code>"react-native"</code> root field escape hatch. Supporting these features in Metro will allow the ecosystem to move forward.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="enabling-package-exports-beta">Enabling Package Exports (beta)<a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#enabling-package-exports-beta" class="hash-link" aria-label="Direct link to Enabling Package Exports (beta)" title="Direct link to Enabling Package Exports (beta)">​</a></h3>
<p>Package Exports can be enabled in your app's <a href="https://github.com/facebook/react-native/blob/0.72-stable/packages/react-native/template/metro.config.js" target="_blank" rel="noopener noreferrer"><strong>metro.config.js</strong></a> file via the <a href="https://metrobundler.dev/docs/configuration/#unstable_enablepackageexports-experimental" target="_blank" rel="noopener noreferrer"><code>resolver.unstable_enablePackageExports</code></a> option.</p>
<div class="language-js codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-js codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token keyword" style="color:#c5a5c5">const</span><span class="token plain"> config </span><span class="token operator" style="color:#fc929e">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">  </span><span class="token comment" style="color:#93a1a1">// ...</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">  </span><span class="token literal-property property" style="color:#2aa198">resolver</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token literal-property property" style="color:#2aa198">unstable_enablePackageExports</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token boolean" style="color:#ff8b50">true</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">  </span><span class="token punctuation" style="color:#657b83">}</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token punctuation" style="color:#657b83">}</span><span class="token punctuation" style="color:#657b83">;</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<p>Metro exposes two further resolver options which configure how conditional exports behave:</p>
<ul>
<li><a href="https://metrobundler.dev/docs/configuration/#unstable_conditionnames-experimental" target="_blank" rel="noopener noreferrer"><code>unstable_conditionNames</code></a> —&nbsp;The set of <a href="https://nodejs.org/docs/latest-v19.x/api/packages.html#community-conditions-definitions" target="_blank" rel="noopener noreferrer">condition names</a> to assert when resolving conditional exports. By default, we match <code>['require', 'import', 'react-native']</code>.</li>
<li><a href="https://metrobundler.dev/docs/configuration/#unstable_conditionsbyplatform-experimental" target="_blank" rel="noopener noreferrer"><code>unstable_conditionsByPlatform</code></a> —&nbsp;The additional condition names to assert when resolving for a given platform target. By default, this matches <code>'browser'</code> when the platform is <code>'web'</code>.</li>
</ul>
<div class="theme-admonition theme-admonition-tip admonition_WCGJ alert alert--success"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>tip</div><div class="admonitionContent_pbrs"><p><strong>Remember to use the React Native <a href="https://github.com/facebook/react-native/blob/main/template/jest.config.js#L2" target="_blank" rel="noopener noreferrer">Jest preset</a>!</strong> Jest includes support for Package Exports by default. In tests, you can override which <code>customExportConditions</code> are resolved using the <a href="https://jestjs.io/docs/configuration#testenvironmentoptions-object" target="_blank" rel="noopener noreferrer"><code>testEnvironmentOptions</code></a> option.</p><p><strong>If you are using TypeScript</strong>, resolution behaviour can be matched by setting <a href="https://www.typescriptlang.org/tsconfig#moduleResolution" target="_blank" rel="noopener noreferrer"><code>moduleResolution: 'bundler'</code></a> and <a href="https://www.typescriptlang.org/tsconfig#resolvePackageJsonExports" target="_blank" rel="noopener noreferrer"><code>resolvePackageJsonImports: false</code></a> within your project's <code>tsconfig.json</code>.</p></div></div>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="validating-changes-in-your-project">Validating changes in your project<a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#validating-changes-in-your-project" class="hash-link" aria-label="Direct link to Validating changes in your project" title="Direct link to Validating changes in your project">​</a></h4>
<p>For existing projects, we recommend that early adopters follow these steps to see if resolution changes occur after enabling <code>unstable_enablePackageExports</code>. This is a one-time process. It's likely that there will be no changes at all, but we'd like developers to opt in with certainty.</p>
<details class="details_IpIu alert alert--info details_jERq" data-collapsed="true"><summary>💡 Validating changes in your project</summary><div><div class="collapsibleContent_Fd2D"><div class="theme-admonition theme-admonition-note admonition_WCGJ alert alert--secondary"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_pbrs"><p>If you are not using Yarn, substitute <code>yarn</code> for <code>npx</code> (or the relevant tool used in your project).</p></div></div><ol>
<li>
<p>Get all resolved dependencies (before changes):</p>
<div class="language-sh codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-sh codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token plain"># Replace index.js with your entry file if needed, such as App.js</span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">yarn metro get-dependencies index.js --platform android --output before.txt</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<ul>
<li><strong>Expo CLI</strong>: Run <code>npx expo customize metro.config.js</code> if your project doesn't have a <code>metro.config.js</code> file yet.</li>
<li>For full coverage, substitute <code>--platform android</code> for the other platforms in use by your app (e.g. <code>ios</code>, <code>web</code>).</li>
</ul>
</li>
<li>
<p>Enable <code>resolver.unstable_enablePackageExports</code> in <code>metro.config.js</code>.</p>
</li>
<li>
<p>Get all resolved dependencies (after changes):</p>
<div class="language-sh codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-sh codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token plain">yarn metro get-dependencies index.js --platform android --output after.txt</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
</li>
<li>
<p>Compare!</p>
<div class="language-sh codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-sh codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token plain">diff before.txt after.txt</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
</li>
</ol></div></div></details>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="breaking-changes">Breaking changes<a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#breaking-changes" class="hash-link" aria-label="Direct link to Breaking changes" title="Direct link to Breaking changes">​</a></h3>
<p>We decided on an implementation of Package Exports in Metro that is spec-compliant (necessitating some breaking changes), but backwards compatible otherwise (helping apps with existing imports to migrate gradually).</p>
<p>The key breaking change is that when <code>"exports"</code> is provided by a package, it will be consulted first (before any other <code>package.json</code> fields) —&nbsp;and a matched subpath target will be used directly.</p>
<ul>
<li>Metro will not expand <a href="https://metrobundler.dev/docs/configuration/#sourceexts" target="_blank" rel="noopener noreferrer"><code>sourceExts</code></a> against the import specifier.</li>
<li>Metro will not resolve <a href="https://reactnative.dev/docs/platform-specific-code">platform-specific extensions</a> against the target file.</li>
</ul>
<p>For more details, please see all <a href="https://metrobundler.dev/docs/package-exports#summary-of-breaking-changes" target="_blank" rel="noopener noreferrer"><strong>breaking changes</strong></a> in the Metro docs.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="package-encapsulation-is-lenient">Package encapsulation is lenient<a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#package-encapsulation-is-lenient" class="hash-link" aria-label="Direct link to Package encapsulation is lenient" title="Direct link to Package encapsulation is lenient">​</a></h3>
<p>When Metro encounters a subpath that isn't listed in <code>"exports"</code>, <strong>it will fall back to legacy resolution</strong>. This is a compatibility feature intended to reduce user friction for previously allowable imports in existing React Native projects.</p>
<p>Instead of throwing an error, Metro will log a warning.</p>
<div class="language-sh codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-sh codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token plain">warn: You have imported the module "foo/private/fn.js" which is not listed in</span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">the "exports" of "foo". Consider updating your call site or asking the package</span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">maintainer(s) to expose this API.</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<div class="theme-admonition theme-admonition-note admonition_WCGJ alert alert--secondary"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_pbrs"><p>We plan to implement a strict mode for package encapsulation in future, to align with Node's default behaviour. Therefore, <strong>we recommend that all developers address these warnings</strong> if raised by users.</p></div></div>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="for-package-maintainers-preview">For package maintainers (preview)<a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#for-package-maintainers-preview" class="hash-link" aria-label="Direct link to For package maintainers (preview)" title="Direct link to For package maintainers (preview)">​</a></h2>
<div class="theme-admonition theme-admonition-info admonition_WCGJ alert alert--info"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_pbrs"><p>Per our <a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#the-future-stable-exports-enabled-by-default">rollout plan</a>, Package Exports will be enabled for most projects in the next React Native release (0.73) later this year.</p><p><strong>We have no plans to remove support for the <code>"main"</code> field and other current package resolution features any time soon.</strong></p></div></div>
<p>Package Exports provides the ability to restrict access to your package's internals, and more predictable capabilities for libraries to target React Native and React Native for Web.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="if-you-are-using-exports-today">If you are using <code>"exports"</code> today<a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#if-you-are-using-exports-today" class="hash-link" aria-label="Direct link to if-you-are-using-exports-today" title="Direct link to if-you-are-using-exports-today">​</a></h3>
<p>If your package uses <code>"exports"</code> alongside the current <code>"react-native"</code> root field, please bear in mind the <a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#breaking-changes">breaking changes</a> for users above. For users enabling this feature in Metro, <code>"exports"</code> will now be considered first during module resolution.</p>
<p>In practice, we anticipate the main change for users will be the enforcement (via warnings) of any inaccessible subpaths in their apps, from respecting <code>"exports"</code> package encapsulation.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="migrating-to-exports">Migrating to <code>"exports"</code><a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#migrating-to-exports" class="hash-link" aria-label="Direct link to migrating-to-exports" title="Direct link to migrating-to-exports">​</a></h3>
<p><strong>Adding an <code>"exports"</code> field to your package is entirely optional</strong>. Existing package resolution features will behave identically for packages which don't use <code>"exports"</code> —&nbsp;and we have no plans to remove this behaviour.</p>
<p>We believe that the new features of <code>"exports"</code> provide a compelling feature set for React Native package maintainers.</p>
<ul>
<li><strong>Tighten your package API</strong>: This is a great time to review the module API of your package, which can now be formally defined via exported subpath aliases. This prevents users from accessing internal APIs, reducing surface area for bugs.</li>
<li><strong>Conditional exports</strong>: If your package targets React Native for Web (i.e. <code>"react-native"</code> and <code>"browser"</code>), we now give packages control of the resolution order of these conditions (see next heading).</li>
</ul>
<p>If you decide to introduce <code>"exports"</code>, <strong>we recommend making this as a breaking change</strong>. We've prepared a <a href="https://metrobundler.dev/docs/package-exports#migration-guide-for-package-maintainers" target="_blank" rel="noopener noreferrer"><strong>migration guide</strong></a> in the Metro docs which includes how to replace features such as platform-specific extensions.</p>
<div class="theme-admonition theme-admonition-note admonition_WCGJ alert alert--secondary"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_pbrs"><p><strong>Please do not rely on the lenient behaviours of Metro's implementation.</strong> While Metro is backwards-compatible, packages should follow how <code>"exports"</code> is documented in the spec and strictly implemented by other tools.</p></div></div>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="the-new-react-native-condition">The new <code>"react-native"</code> condition<a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#the-new-react-native-condition" class="hash-link" aria-label="Direct link to the-new-react-native-condition" title="Direct link to the-new-react-native-condition">​</a></h3>
<p>We've introduced <code>"react-native"</code> as a community condition (for use with conditional exports). This represents React Native, the framework, sitting alongside other recognised runtimes such as <code>"node"</code> and <code>"deno"</code> (<a href="https://github.com/nodejs/node/pull/45367" target="_blank" rel="noopener noreferrer">RFC</a>).</p>
<blockquote>
<p><a href="https://nodejs.org/docs/latest-v19.x/api/packages.html#community-conditions-definitions" target="_blank" rel="noopener noreferrer">Community Conditions Definitions —&nbsp;<strong><code>"react-native"</code></strong></a></p>
<p><em>Will be matched by the React Native framework (all platforms). To target React Native for Web, "browser" should be specified before this condition.</em></p>
</blockquote>
<p>This replaces the previous <code>"react-native"</code> root field. The priority order for how this was previously resolved was determined by projects, <a href="https://github.com/expo/router/issues/37#issuecomment-1275925758" target="_blank" rel="noopener noreferrer">which created ambiguity when using React Native for Web</a>. Under <code>"exports"</code>, <em>packages concretely define the resolution order for conditional entry points</em> —&nbsp;removing this ambiguity.</p>
<div class="language-json codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-json codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token plain">  </span><span class="token property" style="color:#2aa198">"exports"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token property" style="color:#2aa198">"browser"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">"./dist/index-browser.js"</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token property" style="color:#2aa198">"react-native"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">"./dist/index-react-native.js"</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token property" style="color:#2aa198">"default"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">"./dist/index.js"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">  </span><span class="token punctuation" style="color:#657b83">}</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<div class="theme-admonition theme-admonition-note admonition_WCGJ alert alert--secondary"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_pbrs"><p>We chose not to introduce <code>"android"</code> and <code>"ios"</code> conditions, due to the prevalence of other existing platform selection methods, and the complexity of how this behaviour might work across frameworks. Please use the <a href="https://reactnative.dev/docs/platform#select"><code>Platform.select()</code></a> API instead.</p></div></div>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="the-future-stable-exports-enabled-by-default">The future: Stable <code>"exports"</code>, enabled by default<a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#the-future-stable-exports-enabled-by-default" class="hash-link" aria-label="Direct link to the-future-stable-exports-enabled-by-default" title="Direct link to the-future-stable-exports-enabled-by-default">​</a></h2>
<p>In the next React Native release, we are aiming to remove the <code>unstable_</code> prefix for this feature (having addressed planned performance work and any bugs) and will enable Package Exports resolution by default.</p>
<p>With <code>"exports"</code> enabled for everyone, we can begin taking the React Native community forward — for example, React Native's core packages could be updated to better separate public and internal modules.</p>
<p><img loading="lazy" alt="Rollout plan for Package Exports support" src="https://reactnative.dev/assets/images/package-exports-rollout-b62424d06a1453e3a8002adb33b296f0.png" width="2364" height="722" class="img_SS3x"></p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="thanks">Thanks<a href="https://reactnative.dev/blog/2023/06/21/package-exports-support#thanks" class="hash-link" aria-label="Direct link to Thanks" title="Direct link to Thanks">​</a></h2>
<p>Thanks to members of the React Native community that gave feedback on the RFC: <a href="https://github.com/SimenB" target="_blank" rel="noopener noreferrer">@SimenB</a>, <a href="https://github.com/tido64" target="_blank" rel="noopener noreferrer">@tido64</a>, <a href="https://github.com/byCedric" target="_blank" rel="noopener noreferrer">@byCedric</a>, <a href="https://github.com/thymikee" target="_blank" rel="noopener noreferrer">@thymikee</a>.</p>
<p>Huge thanks to <a href="https://github.com/motiz88" target="_blank" rel="noopener noreferrer">@motiz88</a> and <a href="https://github.com/robhogan" target="_blank" rel="noopener noreferrer">@robhogan</a> at Meta for supporting the development of this feature.</p>]]></content:encoded>
            <category>announcement</category>
            <category>metro</category>
        </item>
        <item>
            <title><![CDATA[React Native 0.71-RC0 Android outage postmortem]]></title>
            <link>https://reactnative.dev/blog/2023/01/27/71rc1-android-outage-postmortem</link>
            <guid>https://reactnative.dev/blog/2023/01/27/71rc1-android-outage-postmortem</guid>
            <pubDate>Fri, 27 Jan 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[Now that 0.71 is available, we want to share some key information about the incident that broke Android builds for all React Native versions while releasing the first 0.71 release candidate for React Native & Expo Android builds on November 4th, 2022.]]></description>
            <content:encoded><![CDATA[<p>Now that 0.71 is <a href="https://reactnative.dev/blog/2023/01/12/version-071">available</a>, we want to share some key information about the incident that broke Android builds for all React Native versions while releasing the first 0.71 release candidate for React Native &amp; Expo Android builds on November 4th, 2022.</p>
<p>The contributors who helped tackle the incident recently attended a post-mortem meeting to discuss in detail what happened, what we all learned from it, and what actions we are going to take to avoid similar outages in the future.</p>
<h1>What happened</h1>
<p>On November 4th 2022, we published the version <code>0.71.0-rc0</code> of React Native, the first release candidate for 0.71, on several public repositories.</p>
<p>A major change made in this release candidate helped to improve build times by publishing artifacts to Maven Central, instead of building them from source. More details on how this was done are available in <a href="https://github.com/react-native-community/discussions-and-proposals/pull/508" target="_blank" rel="noopener noreferrer">RFC#508</a> and <a href="https://github.com/reactwg/react-native-new-architecture/discussions/105" target="_blank" rel="noopener noreferrer">related discussions</a>.</p>
<p>Unfortunately, because of the way we scaffolded new projects from the template, this caused build failures for any Android user on older versions because they would start downloading new artifacts for <code>0.71.0-rc0</code> instead of the version they were using in their project (like <code>0.68.0</code>).</p>
<h1>Why this happened</h1>
<p>The React Native template provides a <code>build.gradle</code> file to build Android apps. This file contains a dependency on the React Native Android library as follows:
<code>implementation("com.facebook.react:react-native:+")</code>.</p>
<p>Importantly, the <code>+</code> part of this dependency (a <a href="https://docs.gradle.org/current/userguide/dynamic_versions.html" target="_blank" rel="noopener noreferrer">Gradle Dynamic version</a>) tells Gradle to pick the highest available version of React Native. Using Gradle Dynamic versions is considered an antipattern as it exposes users to less-reproducible builds.</p>
<p>We were aware of the issues dynamic versions could cause, so in <code>0.71</code> we cleaned up the new app template and removed all the <code>+</code> dependencies. However, users on older versions of React Native were still using a <code>+</code> version.</p>
<p>This caused builds with React Native versions before <code>0.71.0-rc.0</code> to query all the repositories for the highest available versions of the React Native. Because the newly pushed 0.71.0-rc.0 on Maven Central became the highest version available, builds with React Native versions before 0.71.0-rc.0 started using artifacts from 0.71.0-rc.0. The React Native version mismatch between the local build (e.g <code>0.68.0</code>) and artifacts from Maven Central (<code>0.71.0-rc.0</code>) caused these builds to fail.</p>
<p>Further technical details on this event area are also available <a href="https://github.com/facebook/react-native/issues/35210" target="_blank" rel="noopener noreferrer">on this GitHub issue</a>.</p>
<h1>How we mitigated &amp; resolved</h1>
<p>As soon as we identified the issue on November 4th, the community found and shared a manual workaround to fix the issue which would pin React Native to a specific, correcting the mistake.</p>
<p>Then, over the weekend of November 5th and 6th, the release crew shipped patch releases for all previous React Native versions down to 0.63 which automatically applied the patch, so that users could update to a fixed version of React Native.</p>
<p>At the same time, we <a href="https://issues.sonatype.org/browse/OSSRH-86006" target="_blank" rel="noopener noreferrer">reached out to Sonatype</a> to ask for the removal of the offending artifacts.</p>
<p>The issue was fully resolved on November 8th when the artifacts were fully removed from Maven Central.</p>
<h1>Timeline of events</h1>
<p><em>This section contains a brief timeline of the events. All times are GMT/UTC +0</em></p>
<ul>
<li>Nov 4th - 5:06 PM: <a href="https://github.com/facebook/react-native/releases/tag/v0.71.0-rc.0" target="_blank" rel="noopener noreferrer">0.71-RC0 is released</a>.</li>
<li>Nov 4th - 6:20 PM: <a href="https://github.com/facebook/react-native/issues/35204" target="_blank" rel="noopener noreferrer">First report of build issue is opened</a>.</li>
<li>Nov 4th - 7:45 PM: <a href="https://github.com/facebook/react-native/issues/35204#issuecomment-1304090948" target="_blank" rel="noopener noreferrer">Issue is identified by community</a>.</li>
<li>Nov 4th - 9:39 PM: <a href="https://github.com/facebook/react-native/issues/35204#issuecomment-1304281740" target="_blank" rel="noopener noreferrer">Workarounds are communicated, Expo </a>deploys fix to all their users.</li>
<li>Nov 5th - 03:04 AM: <a href="https://github.com/facebook/react-native/issues/35210" target="_blank" rel="noopener noreferrer">New issue is open to communicate status and workarounds</a>.</li>
<li>Nov 6th - 04:11 PM: <a href="https://issues.sonatype.org/browse/OSSRH-86006?focusedCommentId=1216303&amp;page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-1216303" target="_blank" rel="noopener noreferrer">Ticket to SonaType</a> asking for removal of the artifacts is open.</li>
<li>Nov 6th - 04:40 PM: <a href="https://twitter.com/reactnative/status/1589296764678705155" target="_blank" rel="noopener noreferrer">First tweet</a> from @reactnative with ack + link to issue.</li>
<li>Nov 6th - 07:05 PM: Decision to patch React Native versions back to 0.63.</li>
<li>Nov 7th - 12:47 AM: Last patched release is released: <a href="https://github.com/facebook/react-native/releases/tag/v0.63.5" target="_blank" rel="noopener noreferrer">0.63.5</a>.</li>
<li>Nov 8th - 08:04 PM: Artifacts on Maven Central are <a href="https://issues.sonatype.org/browse/OSSRH-86006?focusedCommentId=1216303&amp;page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-1216303" target="_blank" rel="noopener noreferrer">fully removed</a>.</li>
<li>Nov 10th - 11:51 AM: Issue about the <a href="https://github.com/facebook/react-native/issues/35210#issuecomment-1310170361" target="_blank" rel="noopener noreferrer">incident is closed</a>.</li>
</ul>
<h1>Lessons Learned</h1>
<p>While in many ways the conditions to trigger this incident has existed since React Native 0.12.0, we want to ensure that the foundations on which we develop and release React Native moving forward are stronger. Here are some of the lessons learned and the actionables on how we’ll adapt our processes and infrastructure to respond faster and stronger in the future.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="incident-response-strategy">Incident response strategy<a href="https://reactnative.dev/blog/2023/01/27/71rc1-android-outage-postmortem#incident-response-strategy" class="hash-link" aria-label="Direct link to Incident response strategy" title="Direct link to Incident response strategy">​</a></h3>
<p>This incident highlighted gaps in our incident response strategy for open-source issues related to React Native.</p>
<p>The community quickly found a workaround in less than 2 hours. Due to our lack of visibility on the scope of the impact of this issue, as well as the complexity required to fix it for old versions, we relied on impacted people discovering the workaround on the GitHub issue.</p>
<p>It took us 48 hours to recognize the larger scope of this issue and that we couldn’t rely on everyone finding the GitHub issue. We needed to prioritize more complex active mitigations to automatically fix people’s projects.</p>
<p>We will be revisiting our processes for when to rely on developer-applied-workarounds vs fixes that we can deploy automatically. We will also take a look at our options for getting a better live pulse on the health of our ecosystem.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="release-support-policy">Release Support Policy<a href="https://reactnative.dev/blog/2023/01/27/71rc1-android-outage-postmortem#release-support-policy" class="hash-link" aria-label="Direct link to Release Support Policy" title="Direct link to Release Support Policy">​</a></h3>
<p>As visualized in the <a href="https://rn-versions.github.io/" target="_blank" rel="noopener noreferrer">rn-versions tool</a>, to cover more than 90% of the developer base of React Native at the time of the incident, we had to release patches all the way down to version 0.63.</p>
<p>We believe this is caused by the React Native upgrade experience which has historically been full of frictions. We are currently looking into ways to improve the upgrade experience to make it smoother and faster to mitigate this fragmentation of the ecosystem.</p>
<p>Releasing a newer version of React Native should never have an impact on users on older versions, and we want to apologize for the disruption we caused to your workflow.</p>
<p>Similarly, we want to also stress the importance of being up to date with the latest version of your dependencies and React Native to benefit from the improvements and the safeguards we introduced. This incident happened during a time in which an official <a href="https://github.com/reactwg/react-native-releases#releases-support-policy" target="_blank" rel="noopener noreferrer">release support policy</a> was getting defined and wasn’t broadcasted or enforced yet.</p>
<p>In the future, we will communicate our support policy over our communication channels and we will consider <a href="https://docs.npmjs.com/deprecating-and-undeprecating-packages-or-package-versions" target="_blank" rel="noopener noreferrer">deprecating older versions of React Native on npm</a>.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="improved-testing-and-best-practices-for-3rd-party-libraries">Improved testing and best practices for 3rd party libraries<a href="https://reactnative.dev/blog/2023/01/27/71rc1-android-outage-postmortem#improved-testing-and-best-practices-for-3rd-party-libraries" class="hash-link" aria-label="Direct link to Improved testing and best practices for 3rd party libraries" title="Direct link to Improved testing and best practices for 3rd party libraries">​</a></h3>
<p>This incident highlighted the importance of having better release testing and better guidance to 3rd party libraries.</p>
<p>On the testing side, releasing versions down to <code>0.63.x</code> proved to be challenging due to the lack of automation and testing we now have in place for stable releases. We recognize the importance of our release and testing infrastructure and we’re going to invest further in it in the future.</p>
<p>Specifically, we are now encouraging and supporting 3rd party library testing as part of the <a href="https://github.com/reactwg/react-native-releases/discussions/41" target="_blank" rel="noopener noreferrer">release of react native</a>. We’re also adding some new channels and roles in the <a href="https://github.com/facebook/react-native/blob/main/ECOSYSTEM.md#core-contributors" target="_blank" rel="noopener noreferrer">Core Contributors Discord Server</a>.</p>
<p>On top of this, we started a closer collaboration with Callstack, the maintainers of <a href="https://github.com/callstack/react-native-builder-bob/tree/main/packages/create-react-native-library" target="_blank" rel="noopener noreferrer">create-react-native-library</a>, to improve the library template and make sure it follows all the necessary best practices to integrate with React Native projects. The newer version of <code>create-react-native-library</code> is now fully compatible with 0.71 projects while still offering backward compatibility.</p>
<h1>Conclusions</h1>
<p>We want to apologize for the disruption this caused to the workflows of developers all around the world. As highlighted above, we have already started taking action to strengthen our foundation - and more work is due.</p>
<p>We hope that sharing these insights will help you all better understand this incident, and that you can leverage our learnings to apply better practices in your own tools and projects.</p>
<p>In closing, we want once again to thank Sonatype for helping us remove the artifacts, our community, and the release crew that worked tirelessly to address this as soon as possible.</p>]]></content:encoded>
            <category>engineering</category>
        </item>
        <item>
            <title><![CDATA[React Native 0.71: TypeScript by Default, Flexbox Gap, and more...]]></title>
            <link>https://reactnative.dev/blog/2023/01/12/version-071</link>
            <guid>https://reactnative.dev/blog/2023/01/12/version-071</guid>
            <pubDate>Thu, 12 Jan 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[Today we’re releasing React Native version 0.71! This is a feature-packed release including:]]></description>
            <content:encoded><![CDATA[<p>Today we’re releasing React Native version 0.71! This is a feature-packed release including:</p>
<ul>
<li><a href="https://reactnative.dev/blog/2023/01/12/version-071#typescript-by-default">TypeScript by default</a></li>
<li><a href="https://reactnative.dev/blog/2023/01/12/version-071#simplifying-layouts-with-flexbox-gap">Simplifying layouts with Flexbox Gap</a></li>
<li><a href="https://reactnative.dev/blog/2023/01/12/version-071#web-inspired-props-for-accessibility-styles-and-events">Web-inspired props for accessibility, styles, and events</a></li>
<li><a href="https://reactnative.dev/blog/2023/01/12/version-071#restoring-proptypes">Restoring PropTypes</a></li>
<li><a href="https://reactnative.dev/blog/2023/01/12/version-071#developer-experience-improvements">Developer Experience Improvements</a></li>
<li><a href="https://reactnative.dev/blog/2023/01/12/version-071#new-architecture">New Architecture Updates</a></li>
</ul>
<p>In this post we’ll cover some of the highlights of 0.71.</p>
<div class="theme-admonition theme-admonition-info admonition_WCGJ alert alert--info"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_pbrs"><p>For a full list of changes, check out <a href="https://github.com/facebook/react-native/blob/main/CHANGELOG.md#v071" target="_blank" rel="noopener noreferrer">CHANGELOG.md</a>.</p></div></div>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="typescript-by-default">TypeScript by default<a href="https://reactnative.dev/blog/2023/01/12/version-071#typescript-by-default" class="hash-link" aria-label="Direct link to TypeScript by default" title="Direct link to TypeScript by default">​</a></h2>
<p>In this release, we’re investing in the TypeScript experience of React Native.</p>
<p>Starting with 0.71, when you create a new React Native app via the React Native CLI you'll get a TypeScript app by default. The new project is already set up with a <code>tsconfig.json</code> so out of the box your IDE will help you write typed code right away.</p>
<p>We’re also offering built-in, more accurate TypeScript declarations directly from the <code>react-native</code> package. This means you won’t need <code>@types/react-native</code> any longer, and the types will be updated in lockstep with React Native releases.</p>
<p>Finally, our documentation has been updated to feature TypeScript for all examples.</p>
<div class="theme-admonition theme-admonition-note admonition_WCGJ alert alert--secondary"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_pbrs"><p>After upgrading to React Native 0.71, we recommend removing <code>@types/react-native</code> from your package.json <code>devDependencies</code>.</p></div></div>
<p>For more details on this change, including migration steps and how this affects Flow users, check out our previous post <a href="https://reactnative.dev/blog/2023/01/03/typescript-first" target="_blank" rel="noopener noreferrer">First-class Support for TypeScript</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="simplifying-layouts-with-flexbox-gap">Simplifying layouts with Flexbox gap<a href="https://reactnative.dev/blog/2023/01/12/version-071#simplifying-layouts-with-flexbox-gap" class="hash-link" aria-label="Direct link to Simplifying layouts with Flexbox gap" title="Direct link to Simplifying layouts with Flexbox gap">​</a></h2>
<p>With React Native you can flexibly layout components on different screen sizes using Flexbox. Browsers have supported the Flexbox properties <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/gap" target="_blank" rel="noopener noreferrer">gap</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/row-gap" target="_blank" rel="noopener noreferrer">rowGap</a>, and <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/column-gap" target="_blank" rel="noopener noreferrer">columnGap</a>, which allow you to specify the amount of space between all items in a Flexbox.</p>
<p>These properties have been long requested in React Native, and 0.71 adds initial support for gaps defined using pixel values. In future versions, we will add support for more values, such as percentages.</p>
<p>To see why this is useful, imagine trying to build a responsive layout with variably sized cards, 10px apart from each other, hugging the edges of the parent container. Trying to accomplish this layout with child margins can be tricky.</p>
<p>The following shows a layout where we start by giving each child <code>margin: 10</code> style:</p>
<p><img loading="lazy" alt="Two diagrams. On the left it shows a skeleton of an app with three boxes that have margin around them cause the boxes to have margin around all sides. On the right, the same diagram is shown highlighted to demonstrate the margin on all sides." src="https://reactnative.dev/assets/images/FlexboxGapBefore-1f7eddd7d1d7b84cc7c0e1c5a53c8144.png" width="679" height="201" class="img_SS3x"></p>
<p>Margins are applied uniformly to the edges of all children and don’t collapse under Flexbox, giving us spacing at the exterior of the cards, and double the space on the interior compared to what we wanted. We can get around this by applying non-uniform margins, using negative margins on the parent, halving our intended spacing, etc, but it can be made much easier.</p>
<p>With flex gap, this layout can be achieved by setting <code>gap: 10</code> on the container for a 10 pixel gap between the interior of the cards:</p>
<p><img loading="lazy" alt="Two diagrams. On the left it shows a skeleton of an app with three boxes that have margin only on the inner sides and not the outer sides of the boxes due to the Flexbox gap property. On the right, the same diagram is shown highlighted to demonstrate the margin only on the inner sides." src="https://reactnative.dev/assets/images/FlexboxGapAfter-4dd42d529a3e531d81da25361f8975ed.png" width="679" height="201" class="img_SS3x"></p>
<p>For more information on Flexbox gaps, see <a href="https://css-tricks.com/minding-the-gap/#aa-flexbox-gaps" target="_blank" rel="noopener noreferrer">this blogpost from CSS Tricks</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="web-inspired-props-for-accessibility-styles-and-events">Web-inspired props for accessibility, styles, and events<a href="https://reactnative.dev/blog/2023/01/12/version-071#web-inspired-props-for-accessibility-styles-and-events" class="hash-link" aria-label="Direct link to Web-inspired props for accessibility, styles, and events" title="Direct link to Web-inspired props for accessibility, styles, and events">​</a></h2>
<p>This release includes a number of new props inspired by web standards to align React Native’s APIs across many platforms. These new props are purely additive so there are no expected migrations or change of behavior for equivalent accessibility, behavior, or style props.</p>
<p>For any new prop alias introduced, if there is an existing prop with a different name and both are specified, the new alias prop value will take precedence. For example, this release adds a <code>src</code> prop alias for <code>source</code> on the Image component to align with the <code>src</code> prop on web. If both <code>src</code> and <code>source</code> are provided, the new <code>src</code> prop will be used.</p>
<div class="theme-admonition theme-admonition-note admonition_WCGJ alert alert--secondary"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_pbrs"><p>For more background on aligning React Native to web standards, check out this <a href="https://github.com/necolas/discussions-and-proposals/blob/reduce-fragmentation/proposals/0000-reduce-fragmentation.md" target="_blank" rel="noopener noreferrer">proposal</a> and <a href="https://github.com/react-native-community/discussions-and-proposals/pull/496" target="_blank" rel="noopener noreferrer">related discussion</a>.</p></div></div>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="accessibility">Accessibility<a href="https://reactnative.dev/blog/2023/01/12/version-071#accessibility" class="hash-link" aria-label="Direct link to Accessibility" title="Direct link to Accessibility">​</a></h4>
<p>We introduced ARIA props as alias to existing React Native accessibility props.</p>
<p>These props now exist on all core components of React Native:<code>aria-label</code>, <code>aria-labelledby</code>,<code>aria-modal</code>, <code>id</code>, <code>aria-busy</code>, <code>aria-checked</code>, <code>aria-disabled</code>, <code>aria-expanded</code>, <code>aria-selected</code>, <code>aria-valuemax</code>, <code>aria-valuemin</code>, <code>aria-valuenow</code>, and <code>aria-valuetext</code>.</p>
<p>We also introduced equivalent web behavior for: <code>aria-hidden</code>, <code>aria-live</code>, <code>role</code>, and <code>tabIndex</code>.</p>
<p>See this <a href="https://github.com/facebook/react-native/issues/34424" target="_blank" rel="noopener noreferrer">issue</a> for more details.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="component-specific-behavior">Component-Specific Behavior<a href="https://reactnative.dev/blog/2023/01/12/version-071#component-specific-behavior" class="hash-link" aria-label="Direct link to Component-Specific Behavior" title="Direct link to Component-Specific Behavior">​</a></h4>
<p>There were also props introduced to align prop names with equivalent DOM prop names for core components.</p>
<ul>
<li><strong>Image</strong>: <code>alt</code>, <code>tintColor</code>, <code>crossOrigin</code>, <code>height</code>, <code>referrerPolicy</code>, <code>src</code>, <code>srcSet</code>, and <code>width</code>.</li>
<li><strong>TextInput</strong>: <code>autoComplete</code>, <code>enterKeyHint</code>, <code>inputMode</code>, <code>readOnly</code>, and <code>rows</code>.</li>
</ul>
<p>See this <a href="https://github.com/facebook/react-native/issues/34424" target="_blank" rel="noopener noreferrer">issue</a> for more details.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="styles">Styles<a href="https://reactnative.dev/blog/2023/01/12/version-071#styles" class="hash-link" aria-label="Direct link to Styles" title="Direct link to Styles">​</a></h4>
<p>To align with certain CSS styles, there have been feature extensions for the following styles:</p>
<ul>
<li><a href="https://reactnative.dev/docs/layout-props#aspectratio" target="_blank" rel="noopener noreferrer"><code>aspectRatio</code></a> now supports string values</li>
<li><a href="https://reactnative.dev/docs/text-style-props#fontvariant" target="_blank" rel="noopener noreferrer"><code>fontVariant</code></a> now supports space-separated string values</li>
<li><a href="https://reactnative.dev/docs/text-style-props#fontWeight" target="_blank" rel="noopener noreferrer"><code>fontWeight</code></a> now supports number values</li>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform" target="_blank" rel="noopener noreferrer"><code>transform</code></a> now supports string values</li>
</ul>
<p>The following aliases have been added to shadow existing React Native styles:</p>
<ul>
<li><a href="https://reactnative.dev/docs/image#objectfit" target="_blank" rel="noopener noreferrer"><code>objectFit</code></a></li>
<li><a href="https://reactnative.dev/docs/view-style-props#pointerevents" target="_blank" rel="noopener noreferrer"><code>pointerEvents</code></a></li>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/user-select" target="_blank" rel="noopener noreferrer"><code>userSelect</code></a></li>
<li><a href="https://reactnative.dev/docs/text-style-props#verticalalign-android" target="_blank" rel="noopener noreferrer"><code>verticalAlign</code></a></li>
</ul>
<p>See this <a href="https://github.com/facebook/react-native/issues/34425" target="_blank" rel="noopener noreferrer">issue</a> for more details.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="events">Events<a href="https://reactnative.dev/blog/2023/01/12/version-071#events" class="hash-link" aria-label="Direct link to Events" title="Direct link to Events">​</a></h4>
<p>Finally, we also added an opt-in implementation of <a href="https://w3c.github.io/pointerevents" target="_blank" rel="noopener noreferrer">PointerEvents</a></p>
<p>Once enabled, the following handlers on <code>View</code> will support hover:</p>
<ul>
<li><code>onPointerOver</code>, <code>onPointerOut</code></li>
<li><code>onPointerEnter</code>, <code>onPointerLeave</code></li>
</ul>
<p>These events are also implemented in <code>Pressability</code> for new opt-in support for hover.</p>
<p>To enable these features, set the following flags to true:</p>
<div class="language-js codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-js codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token keyword module" style="color:#c5a5c5">import</span><span class="token plain"> </span><span class="token imports maybe-class-name">ReactNativeFeatureFlags</span><span class="token plain"> </span><span class="token keyword module" style="color:#c5a5c5">from</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">'react-native/Libraries/ReactNative/ReactNativeFeatureFlags'</span><span class="token punctuation" style="color:#657b83">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// enable the JS-side of the w3c PointerEvent implementation</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token maybe-class-name">ReactNativeFeatureFlags</span><span class="token punctuation" style="color:#657b83">.</span><span class="token method-variable function-variable method function property-access" style="color:#79b6f2">shouldEmitW3CPointerEvents</span><span class="token plain"> </span><span class="token operator" style="color:#fc929e">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">(</span><span class="token punctuation" style="color:#657b83">)</span><span class="token plain"> </span><span class="token arrow operator" style="color:#fc929e">=&gt;</span><span class="token plain"> </span><span class="token boolean" style="color:#ff8b50">true</span><span class="token punctuation" style="color:#657b83">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// enable hover events in Pressibility to be backed by the PointerEvent implementation.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// shouldEmitW3CPointerEvents should also be true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token maybe-class-name">ReactNativeFeatureFlags</span><span class="token punctuation" style="color:#657b83">.</span><span class="token method-variable function-variable method function property-access" style="color:#79b6f2">shouldPressibilityUseW3CPointerEventsForHover</span><span class="token plain"> </span><span class="token operator" style="color:#fc929e">=</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">  </span><span class="token punctuation" style="color:#657b83">(</span><span class="token punctuation" style="color:#657b83">)</span><span class="token plain"> </span><span class="token arrow operator" style="color:#fc929e">=&gt;</span><span class="token plain"> </span><span class="token boolean" style="color:#ff8b50">true</span><span class="token punctuation" style="color:#657b83">;</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<div class="theme-admonition theme-admonition-note admonition_WCGJ alert alert--secondary"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_pbrs"><p>You’ll also need to enable React feature flags on your <a href="https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native#android-specific" target="_blank" rel="noopener noreferrer">Android</a> and <a href="https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native#ios-specific" target="_blank" rel="noopener noreferrer">iOS</a> native setup.</p></div></div>
<p>Check out our dedicated <a href="https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native" target="_blank" rel="noopener noreferrer">PointerEvents post</a> to learn more.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="restoring-proptypes">Restoring PropTypes<a href="https://reactnative.dev/blog/2023/01/12/version-071#restoring-proptypes" class="hash-link" aria-label="Direct link to Restoring PropTypes" title="Direct link to Restoring PropTypes">​</a></h2>
<p>React Native’s prop types, such as <code>ViewPropTypes</code> and <code>Text.propTypes</code>, were deprecated in 0.66 and accessing them would output deprecation warnings. When they were removed in 0.68, many developers began experiencing errors when upgrading to the latest version of React Native.</p>
<p>After some investigation, we realized that a couple issues prevented the community from taking action on the deprecation warnings. First, the deprecation warning was not always actionable which caused people to ignore them (<a href="https://github.com/facebook/react-native/pull/34650" target="_blank" rel="noopener noreferrer">issue one</a>, <a href="https://github.com/react-native-community/cli/pull/1699" target="_blank" rel="noopener noreferrer">issue two</a>). Second, the deprecation warnings were being <a href="https://github.com/facebook/react-native/commit/fa2842d" target="_blank" rel="noopener noreferrer">incorrectly filtered</a> by <code>LogBox.ignoreLogs</code>. Both of these have now been fixed, but we want to give people more time to upgrade the deprecated call sites.</p>
<p>So in this release we are adding back React Native’s propTypes so that it is easier for people to upgrade and migrate their code to avoid using them. The <code>deprecated-react-native-prop-types</code> package has also been updated for all of the props in 0.71. In the future, we plan to proceed with the deprecation and remove prop types once again. We expect that when we revisit the removal, the community will experience significantly fewer issues.</p>
<div class="theme-admonition theme-admonition-caution admonition_WCGJ alert alert--warning"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>caution</div><div class="admonitionContent_pbrs"><p>As part of this change, we are also removing the console filtering from <code>LogBox.ignoreLog</code>. This means logs that you have previously filtered with <code>Logbox.ignoreLog</code> will start appearing again in the console when you upgrade.</p><p>This is expected, because it allows logs such as deprecation warnings to be found and fixed.</p></div></div>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="developer-experience-improvements">Developer Experience Improvements<a href="https://reactnative.dev/blog/2023/01/12/version-071#developer-experience-improvements" class="hash-link" aria-label="Direct link to Developer Experience Improvements" title="Direct link to Developer Experience Improvements">​</a></h2>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="react-devtools">React DevTools<a href="https://reactnative.dev/blog/2023/01/12/version-071#react-devtools" class="hash-link" aria-label="Direct link to React DevTools" title="Direct link to React DevTools">​</a></h3>
<p>In this release, we've brought two popular React DevTools features on web to React Native.</p>
<p>"Click to inspect" is the option in the top left corner of React Dev Tools that allows you to click on an item in the app to inspect it in Dev Tools, similar to the Chrome element inspector.</p>
<p>Component highlighting will highlight the element you select in DevTools in the app so you can see which React components line up with which on-screen elements.</p>
<p>Here are both features in action:</p>
<p><img loading="lazy" alt="Video of the behavior described above in action. On the left is a React Native app running in an iPhone simulator. On the right is the React DevTools. In both workflows, clicking on an item in the DevTools highlights the corresponding components in the app." src="https://reactnative.dev/assets/images/ElementInspecting-e5670278b9a3562ca492742318251950.gif" width="946" height="608" class="img_SS3x"></p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="hermes">Hermes<a href="https://reactnative.dev/blog/2023/01/12/version-071#hermes" class="hash-link" aria-label="Direct link to Hermes" title="Direct link to Hermes">​</a></h3>
<p>In React Native 0.70, we made <a href="https://reactnative.dev/blog/2022/07/08/hermes-as-the-default" target="_blank" rel="noopener noreferrer">Hermes the default engine for React Native</a>.</p>
<p>In React Native 0.71, we’re upgrading Hermes with a few notable improvements:</p>
<ul>
<li><strong>Improve source maps</strong>: By loading source maps over the network with Metro we’ve restored the ability to use source maps in recent versions of Chrome Dev Tools outside of Flipper.</li>
<li><strong>Improve <code>JSON.parse</code> performance</strong>: This version includes a performance optimization that improves the performance of <code>JSON.parse</code> up to 30%.</li>
<li><strong>Add support for <code>.at()</code></strong>: Hermes now <a href="https://github.com/facebook/hermes/issues/823" target="_blank" rel="noopener noreferrer">supports</a><code>.at()</code> for <code>String</code>, <code>TypedArray</code>, and <code>Array</code>.</li>
</ul>
<p>For a full list of changes see <a href="https://github.com/reactwg/react-native-releases/discussions/41#discussioncomment-4089256" target="_blank" rel="noopener noreferrer">the Road to 71 issue</a>.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="new-architecture">New Architecture<a href="https://reactnative.dev/blog/2023/01/12/version-071#new-architecture" class="hash-link" aria-label="Direct link to New Architecture" title="Direct link to New Architecture">​</a></h3>
<p>This release brings many improvements to the experimental New Architecture experience based on user feedback and reports we collected so far.</p>
<ul>
<li><strong>Reduced build times</strong>: The new distribution model uses Maven Central, which allows us to greatly reduce the build time on Android, resolves many build problems on Windows, and provides a more seamless experience with the New Architecture. <a href="https://github.com/reactwg/react-native-new-architecture/discussions/105" target="_blank" rel="noopener noreferrer">Read more here</a>.</li>
<li><strong>Write less C++ code</strong>: You can now enable the New Architecture without having to add any C++ code in your app and the CLI app template has been cleaned of all the C++ code and the CMake files. <a href="https://github.com/reactwg/react-native-new-architecture/discussions/101" target="_blank" rel="noopener noreferrer">Read more here</a>.</li>
<li><strong>Better encapsulation of iOS app setup</strong>: On iOS, we followed a similar approach to Android and encapsulated most of the logic to set up the New Architecture in the <code>RCTAppDelegate</code> class, which will simplify upgrades in the future with fewer manual breaking changes.</li>
<li><strong>Better dependency management on iOS</strong>: For library maintainers, we've added a new <code>install_module_dependencies</code> function to call inside your package <code>podspec</code> which will install all the required dependencies for the New Architecture.</li>
<li><strong>Bug fixes and better IDE support</strong>: we fixed several bugs and issues (like <a href="https://github.com/reactwg/react-native-new-architecture/discussions/102" target="_blank" rel="noopener noreferrer">better IDE support for Android</a>) that were reported by our users in the <a href="https://github.com/reactwg/react-native-new-architecture/discussions" target="_blank" rel="noopener noreferrer">New Architecture Working Group</a>.</li>
</ul>
<p>As a reminder, the New Architecture is still an experimental API experience as we iterate on changes to make adoption easier. Please try out the new simplified steps in the <a href="https://reactnative.dev/docs/new-architecture-intro" target="_blank" rel="noopener noreferrer">New Architecture documentation</a> and post any feedback you have to the <a href="https://github.com/reactwg/react-native-new-architecture/discussions" target="_blank" rel="noopener noreferrer">New Architecture Working Group</a>.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="other-notable-fixes">Other Notable Fixes<a href="https://reactnative.dev/blog/2023/01/12/version-071#other-notable-fixes" class="hash-link" aria-label="Direct link to Other Notable Fixes" title="Direct link to Other Notable Fixes">​</a></h3>
<ul>
<li><strong>Better stack frame collapsing</strong>: We've <a href="https://github.com/react-native-community/cli/pull/1699" target="_blank" rel="noopener noreferrer">updated the list of internal frames</a> for React Native so LogBox will show your code more often rather than internal React Native frames, helping you to debug issues faster.</li>
<li><strong>Build time improvements:</strong> We migrated assets to Maven Central for prefabs to improve build times (both iOS and Android) for Hermes in both the current and new architectures.</li>
<li><strong>Android template improvements</strong>: The Android template was heavily cleaned and now fully relies on the React Native Gradle Plugin. You can find the configuration instructions directly inside the template or in the <a href="https://reactnative.dev/docs/react-native-gradle-plugin" target="_blank" rel="noopener noreferrer">new dedicated page on the website</a>.</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="breaking-changes">Breaking changes<a href="https://reactnative.dev/blog/2023/01/12/version-071#breaking-changes" class="hash-link" aria-label="Direct link to Breaking changes" title="Direct link to Breaking changes">​</a></h2>
<ul>
<li><strong>Changes to Console Logging:</strong> <code>LogBox.ignoreLog</code> no longer filters console logs. This means you will start seeing logs in the console that you have silenced in LogBox. See <a href="https://github.com/facebook/react-native/pull/34476#issuecomment-1240667794" target="_blank" rel="noopener noreferrer">this comment</a> for more details.</li>
<li><strong>Removed AsyncStorage and MaskedViewIOS</strong>: These components have been deprecated since version <a href="https://github.com/facebook/react-native/blob/main/CHANGELOG.md#deprecated-8" target="_blank" rel="noopener noreferrer">0.59</a>, so it’s time we remove them entirely. For alternatives, please check <a href="https://reactnative.directory/" target="_blank" rel="noopener noreferrer">React Native Directory</a> for community packages that cover those use cases.</li>
<li><strong>JSCRuntime moved to react-jsc:</strong> react-jsi is now split into react-jsc and react-jsi. If you use JSCRuntime, you will need to add react-jsc as a dependency (<a href="https://github.com/facebook/react-native/commit/6b129d81ed8cab301775d2a04971e255df9290de" target="_blank" rel="noopener noreferrer">facebook/react-native@6b129d8</a>).</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="acknowledgements">Acknowledgements<a href="https://reactnative.dev/blog/2023/01/12/version-071#acknowledgements" class="hash-link" aria-label="Direct link to Acknowledgements" title="Direct link to Acknowledgements">​</a></h2>
<p>This release is possible thanks to the work of 70+ contributors adding over 1000 commits.</p>
<p>We especially want to thank those who contributed to these major React Native projects:</p>
<ul>
<li><strong>Flexbox Gap Support</strong>: <a href="https://github.com/intergalacticspacehighway" target="_blank" rel="noopener noreferrer">@intergalacticspacehighway</a> and <a href="https://github.com/jacobp100" target="_blank" rel="noopener noreferrer">@jacobp100</a>.</li>
<li><strong>Web-inspired props</strong>: <a href="https://github.com/gabrieldonadel" target="_blank" rel="noopener noreferrer">@gabrieldonadel</a> <a href="https://github.com/dakshbhardwaj" target="_blank" rel="noopener noreferrer">@dakshbhardwaj</a> <a href="https://github.com/dhruvtailor7" target="_blank" rel="noopener noreferrer">@dhruvtailor7</a> <a href="https://github.com/ankit-tailor" target="_blank" rel="noopener noreferrer">@ankit-tailor</a> <a href="https://github.com/madhav23bansal" target="_blank" rel="noopener noreferrer">@madhav23bansal</a>.</li>
<li><strong>Codegen Improvements</strong>: <a href="https://github.com/AntoineDoubovetzky" target="_blank" rel="noopener noreferrer">@AntoineDoubovetzky</a>, <a href="https://github.com/MaeIg" target="_blank" rel="noopener noreferrer">@MaeIg</a>, <a href="https://github.com/Marcoo09" target="_blank" rel="noopener noreferrer">@Marcoo09</a>, <a href="https://github.com/Naturalclar" target="_blank" rel="noopener noreferrer">@Naturalclar</a>, <a href="https://github.com/Pranav-yadav" target="_blank" rel="noopener noreferrer">@Pranav-yadav</a>, <a href="https://github.com/ZihanChen-MSFT" target="_blank" rel="noopener noreferrer">@ZihanChen-MSFT</a>, <a href="https://github.com/dakshbhardwaj" target="_blank" rel="noopener noreferrer">@dakshbhardwaj</a>, <a href="https://github.com/dhruvtailor7" target="_blank" rel="noopener noreferrer">@dhruvtailor7</a>, <a href="https://github.com/gabrieldonadel" target="_blank" rel="noopener noreferrer">@gabrieldonadel</a>, <a href="https://github.com/harshsiri110" target="_blank" rel="noopener noreferrer">@harshsiri110</a>, <a href="https://github.com/ken0nek" target="_blank" rel="noopener noreferrer">@ken0nek</a>, <a href="https://github.com/kylemacabasco" target="_blank" rel="noopener noreferrer">@kylemacabasco</a>, <a href="https://github.com/matiassalles99" target="_blank" rel="noopener noreferrer">@matiassalles99</a>, <a href="https://github.com/mdaj06" target="_blank" rel="noopener noreferrer">@mdaj06</a>, <a href="https://github.com/mohitcharkha" target="_blank" rel="noopener noreferrer">@mohitcharkha</a>, <a href="https://github.com/tarunrajput" target="_blank" rel="noopener noreferrer">@tarunrajput</a>, <a href="https://github.com/vinayharwani13" target="_blank" rel="noopener noreferrer">@vinayharwani13</a>, <a href="https://github.com/youedd" target="_blank" rel="noopener noreferrer">@youedd</a>, <a href="https://github.com/byCedric" target="_blank" rel="noopener noreferrer">@byCedric</a>.</li>
</ul>
<p>Finally, thanks to <a href="https://github.com/cortinico" target="_blank" rel="noopener noreferrer">@cortinico</a>, <a href="https://github.com/kelset" target="_blank" rel="noopener noreferrer">@kelset</a>, <a href="https://github.com/dmytrorykun" target="_blank" rel="noopener noreferrer">@dmytrorykun</a>, <a href="https://github.com/cipolleschi" target="_blank" rel="noopener noreferrer">@cipolleschi</a>, and <a href="https://github.com/titozzz" target="_blank" rel="noopener noreferrer">@titozzz</a> for cutting this release!</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="try-out-0710-now">Try out 0.71.0 now!<a href="https://reactnative.dev/blog/2023/01/12/version-071#try-out-0710-now" class="hash-link" aria-label="Direct link to Try out 0.71.0 now!" title="Direct link to Try out 0.71.0 now!">​</a></h2>
<p>For React Native CLI users, see the <a href="https://reactnative.dev/docs/upgrading" target="_blank" rel="noopener noreferrer">upgrade documentation</a> for how to update your existing project, or create a new project with <code>npx react-native init MyProject</code>.</p>
<p>React Native version 0.71 will be supported in Expo SDK version 48.</p>
<div class="theme-admonition theme-admonition-info admonition_WCGJ alert alert--info"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_pbrs"><p>0.71 is now the latest stable version of React Native and 0.68.x versions are now unsupported. For more information see <a href="https://github.com/reactwg/react-native-releases#releases-support-policy" target="_blank" rel="noopener noreferrer">React Native’s support policy</a>.</p></div></div>]]></content:encoded>
            <category>announcement</category>
            <category>release</category>
        </item>
        <item>
            <title><![CDATA[First-class Support for TypeScript]]></title>
            <link>https://reactnative.dev/blog/2023/01/03/typescript-first</link>
            <guid>https://reactnative.dev/blog/2023/01/03/typescript-first</guid>
            <pubDate>Tue, 03 Jan 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[With the release of 0.71, React Native is investing in the TypeScript experience with the following changes:]]></description>
            <content:encoded><![CDATA[<p>With the release of 0.71, React Native is investing in the TypeScript experience with the following changes:</p>
<ul>
<li><a href="https://reactnative.dev/blog/2023/01/03/typescript-first#new-app-template-is-typescript-by-default">New app template is TypeScript by default</a></li>
<li><a href="https://reactnative.dev/blog/2023/01/03/typescript-first#declarations-shipped-with-react-native">TypeScript declarations shipped with React Native</a></li>
<li><a href="https://reactnative.dev/blog/2023/01/03/typescript-first#documentation-is-typescript-first">React Native documentation is TypeScript First</a></li>
</ul>
<p>In this post we’ll cover what these changes mean for you as a TypeScript or Flow user.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="new-app-template-is-typescript-by-default">New App Template is TypeScript By Default<a href="https://reactnative.dev/blog/2023/01/03/typescript-first#new-app-template-is-typescript-by-default" class="hash-link" aria-label="Direct link to New App Template is TypeScript By Default" title="Direct link to New App Template is TypeScript By Default">​</a></h2>
<p>Starting with 0.71, when you create a new React Native app via the React Native CLI you'll get a TypeScript app by default!</p>
<div class="language-shell codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-shell codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token plain">npx react-native init My71App --version </span><span class="token number" style="color:#5a9bcf">0.71</span><span class="token plain">.0</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<p><img loading="lazy" alt="Screenshot of an iPhone simulator running a new app generated by React Native CLI. Alongside the simulator is a screenshot of Visual Studio Code editor opened to &amp;quot;App.tsx&amp;quot; to illustrate it is running a TypeScript file." src="https://reactnative.dev/assets/images/typescript-first-new-app-426f2230271f337ea5c67af38630f7b1.png" width="3036" height="1688" class="img_SS3x"></p>
<p>The starting point of a newly generated app will be <code>App.tsx</code> instead of <code>App.js</code> – fully TypeScript typed. The new project is already set up with a <code>tsconfig.json</code> so out of the box your IDE will help you write typed code right away!</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="declarations-shipped-with-react-native">Declarations Shipped with React Native<a href="https://reactnative.dev/blog/2023/01/03/typescript-first#declarations-shipped-with-react-native" class="hash-link" aria-label="Direct link to Declarations Shipped with React Native" title="Direct link to Declarations Shipped with React Native">​</a></h2>
<p>0.71 is the first release with built-in TypeScript (TS) declarations.</p>
<p>Prior, TypeScript declarations for React Native were provided by <a href="https://www.npmjs.com/package/@types/react-native" target="_blank" rel="noopener noreferrer"><code>@types/react-native</code></a> hosted in the <a href="https://github.com/DefinitelyTyped/DefinitelyTyped" target="_blank" rel="noopener noreferrer">DefinitelyTyped</a> repository. The decision to co-locate TypeScript types with React Native source was for improved correctness and maintenance.</p>
<p><code>@types/react-native</code> only provides types for stable releases. This means if you ever wanted to develop with a pre-release version of React Native in TypeScript, you’d have to use types from an older release which may be inaccurate. Releasing <code>@types/react-native</code> is also error-prone. The releases lag React Native releases, and the process involves manually inspecting for type changes made to React Native’s public API and updating the TS declaration to match.</p>
<p>With TS types co-located with React Native source, there is more visibility and ownership of TS types. Our team is actively working on tools to maintain alignment between Flow and TS.</p>
<p>This change also removes a dependency for React Native users to manage. When upgrading to 0.71 or above, you can remove <code>@types/react-native</code> as a dependency. <a href="https://github.com/facebook/react-native/blob/main/template/tsconfig.json" target="_blank" rel="noopener noreferrer">Refer to the new app template on how to set up TypeScript support.</a></p>
<p>We plan to deprecate <code>@types/react-native</code> for versions 0.73 and onward. Concretely this means:</p>
<ul>
<li><code>@types/react-native</code> tracking React Native versions 0.71 and 0.72 will be released. They will be identical to the types in React Native on the relevant release branches.</li>
<li>For React Native 0.73 and onward, TS types will only be available from React Native.</li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="how-to-migrate">How to Migrate<a href="https://reactnative.dev/blog/2023/01/03/typescript-first#how-to-migrate" class="hash-link" aria-label="Direct link to How to Migrate" title="Direct link to How to Migrate">​</a></h3>
<p>Please migrate to the new co-located types at your earliest convenience. Here are more details on migrating based on your needs.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="app-maintainer">App Maintainer<a href="https://reactnative.dev/blog/2023/01/03/typescript-first#app-maintainer" class="hash-link" aria-label="Direct link to App Maintainer" title="Direct link to App Maintainer">​</a></h4>
<p>Once you upgrade to React Native &gt;= 0.71, you can remove the <code>@types/react-native</code> from your <code>devDependency</code>.</p>
<div class="theme-admonition theme-admonition-note admonition_WCGJ alert alert--secondary"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_pbrs"><p>If you have warnings because a library you use references <code>@types/react-native</code> as a <code>peerDependency</code>, file an issue or open a PR for that library to use <a href="https://docs.npmjs.com/cli/v7/configuring-npm/package-json#peerdependenciesmeta" target="_blank" rel="noopener noreferrer">optional peerDependencies</a> and ignore the warning for now.</p></div></div>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="library-maintainer">Library Maintainer<a href="https://reactnative.dev/blog/2023/01/03/typescript-first#library-maintainer" class="hash-link" aria-label="Direct link to Library Maintainer" title="Direct link to Library Maintainer">​</a></h4>
<p>Libraries that target versions of React Native below 0.71 may use a <code>peerDependency</code> of <code>@types/react-native</code> to typecheck against the apps version of typings. This dependency should be marked as optional in <a href="https://docs.npmjs.com/cli/v7/configuring-npm/package-json#peerdependenciesmeta" target="_blank" rel="noopener noreferrer"><code>peerDependenciesMeta</code></a> so that the typings are not required for users without TypeScript or for 0.71 users where typings are built-in.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="maintainer-of-typescript-declarations-that-depend-on-typesreact-native">Maintainer of TypeScript declarations that depend on <code>@types/react-native</code><a href="https://reactnative.dev/blog/2023/01/03/typescript-first#maintainer-of-typescript-declarations-that-depend-on-typesreact-native" class="hash-link" aria-label="Direct link to maintainer-of-typescript-declarations-that-depend-on-typesreact-native" title="Direct link to maintainer-of-typescript-declarations-that-depend-on-typesreact-native">​</a></h4>
<p>Check out the <a href="https://github.com/facebook/react-native/blob/main/CHANGELOG.md" target="_blank" rel="noopener noreferrer">breaking changes introduced with 0.71</a> to see if you’re ready to migrate.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="what-if-i-use-flow">What if I use Flow?<a href="https://reactnative.dev/blog/2023/01/03/typescript-first#what-if-i-use-flow" class="hash-link" aria-label="Direct link to What if I use Flow?" title="Direct link to What if I use Flow?">​</a></h3>
<p>Flow users can continue to typecheck applications targeting 0.71+ but configuration logic for it is no longer included out-of-the box in the template.</p>
<p>Flow users have previously upgraded React Native’s Flow types by merging in the <code>.flowconfig</code> from the new app template and manually updating <code>flow-bin</code>. The new app template no longer has a <code>.flowconfig</code>, but <a href="https://github.com/facebook/react-native/blob/main/.flowconfig" target="_blank" rel="noopener noreferrer">one is still present in the React Native repository</a> that can be used as a basis for your app.</p>
<p>If you need to start a new React Native app in Flow, you can reference the <a href="https://github.com/facebook/react-native/tree/0.70-stable/template" target="_blank" rel="noopener noreferrer">new app template from 0.70</a>.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="what-if-i-find-a-bug-in-the-typescript-declaration">What if I find a bug in the TypeScript declaration?<a href="https://reactnative.dev/blog/2023/01/03/typescript-first#what-if-i-find-a-bug-in-the-typescript-declaration" class="hash-link" aria-label="Direct link to What if I find a bug in the TypeScript declaration?" title="Direct link to What if I find a bug in the TypeScript declaration?">​</a></h3>
<p>Regardless of whether you’re using built-in TS types or <code>@types/react-native</code>, if you find a bug please submit a PR to both <a href="https://github.com/facebook/react-native" target="_blank" rel="noopener noreferrer">React Native</a> and <a href="https://github.com/DefinitelyTyped/DefinitelyTyped" target="_blank" rel="noopener noreferrer">DefinitelyTyped</a> repositories. If you don’t know how to fix it, please file a GitHub issue in the React Native repository and mention <a href="https://github.com/lunaleaps" target="_blank" rel="noopener noreferrer">@lunaleaps</a> on the issue.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="documentation-is-typescript-first">Documentation is TypeScript First<a href="https://reactnative.dev/blog/2023/01/03/typescript-first#documentation-is-typescript-first" class="hash-link" aria-label="Direct link to Documentation is TypeScript First" title="Direct link to Documentation is TypeScript First">​</a></h2>
<p>To ensure a consistent TypeScript experience, we have made several updates to the React Native documentation to reflect TypeScript as the new default language.</p>
<p>Code examples now allow inline TypeScript and over 170 interactive code examples have been updated to pass linting, formatting, and type-checking in the new template. Most examples are valid as both TypeScript and JavaScript. Where they are incompatible, you can view the example in either language.</p>
<p>If you spot a mistake or you have an improvement, remember that the website is also open source and we would love to see your PRs!</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="thank-you-to-the-react-native-typescript-community">Thank you to the React Native TypeScript community!<a href="https://reactnative.dev/blog/2023/01/03/typescript-first#thank-you-to-the-react-native-typescript-community" class="hash-link" aria-label="Direct link to Thank you to the React Native TypeScript community!" title="Direct link to Thank you to the React Native TypeScript community!">​</a></h2>
<p>In closing, we want to recognize all the work done over the years by the community to ensure that TypeScript is usable by React Native developers.</p>
<p>We want to thank all the <a href="https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-native/index.d.ts#L3" target="_blank" rel="noopener noreferrer">contributors</a> that have been maintaining <code>@types/react-native</code> since <a href="https://github.com/DefinitelyTyped/DefinitelyTyped/commit/efce0c25ec532a4651859f10eda49e97a5716a42" target="_blank" rel="noopener noreferrer">2015</a>! We see the effort and care you all have put into making sure React Native users have the best experience.</p>
<p>Thank you to <a href="https://github.com/acoates" target="_blank" rel="noopener noreferrer">@acoates</a>, <a href="https://github.com/eps1lon" target="_blank" rel="noopener noreferrer">@eps1lon</a>, <a href="https://github.com/kelset" target="_blank" rel="noopener noreferrer">@kelset</a>, <a href="https://github.com/tido64" target="_blank" rel="noopener noreferrer">@tido64</a>, <a href="https://github.com/Titozzz" target="_blank" rel="noopener noreferrer">@Titozzz</a>, and <a href="https://github.com/ZihanChen-MSFT" target="_blank" rel="noopener noreferrer">@ZihanChen-MSFT</a> for your help consulting, questioning, communicating and reviewing changes to move the TypeScript types to React Native.</p>
<p>Similarly, we want to thank the <a href="https://github.com/react-native-community/react-native-template-typescript/graphs/contributors" target="_blank" rel="noopener noreferrer">maintainers of <code>react-native-template-typescript</code></a> for supporting the TypeScript experience for new app development in React Native since day one.</p>
<p>We look forward to collaborating more directly in the React Native repository and continue improving the React Native developer experience!</p>]]></content:encoded>
            <category>typescript</category>
            <category>engineering</category>
        </item>
        <item>
            <title><![CDATA[Pointer Events in React Native]]></title>
            <link>https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native</link>
            <guid>https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native</guid>
            <pubDate>Tue, 13 Dec 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[Today we are sharing an experimental cross-platform pointer API for React Native. We’ll go over motivations, how it works, and its benefits to React Native users. There are instructions on how to enable and we’re excited to hear your feedback!]]></description>
            <content:encoded><![CDATA[<p>Today we are sharing an experimental cross-platform pointer API for React Native. We’ll go over motivations, how it works, and its benefits to React Native users. There are instructions on how to enable and we’re excited to hear your feedback!</p>
<p>It’s been over a year since we shared <a href="https://reactnative.dev/blog/2021/08/26/many-platform-vision" target="_blank" rel="noopener noreferrer">our many platform vision</a> on the wins of building beyond mobile and how it sets a higher bar for all platforms. During this time, we've increased our investments in React Native for VR, Desktop, and Web. With differences in hardware and interactions on these platforms, it raised the question of how React Native should holistically handle input.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="going-beyond-touch">Going Beyond Touch<a href="https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native#going-beyond-touch" class="hash-link" aria-label="Direct link to Going Beyond Touch" title="Direct link to Going Beyond Touch">​</a></h3>
<p>Desktop and VR have historically relied on mouse and keyboard input where mobile is primarily touch. That narrative has evolved with touch-screen laptops and growing needs to support interactions via keyboard and pen on mobile. All of which the React Native touch event system is not equipped to handle.</p>
<p>As a result, users of out-of-tree platforms fork React Native and/or create custom native components and modules to support critical features like hover detection or left-click. This divergence leads to prop redundancy with event handlers serving similar purposes but for different platforms. It adds complexity to the framework and makes code-sharing between platforms tedious. For these reasons, the team was motivated to provide a cross-platform pointer API.</p>
<p>React Native aims to provide robust and expressive APIs to build for many platforms while maintaining characteristic platform experiences. Designing such an API is challenging yet thankfully there is prior art in the pointer space that React Native can leverage.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="looking-to-web">Looking to Web<a href="https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native#looking-to-web" class="hash-link" aria-label="Direct link to Looking to Web" title="Direct link to Looking to Web">​</a></h3>
<p>Web is a platform with similar challenges in scaling to many platforms while also considering future-proof design. The World Wide Web consortium (W3C) is tasked with setting standards and proposals to build a Web that is interoperable amongst different platforms and browsers.</p>
<p>Most relevant for our needs, the W3C has defined behavior for an abstract form of input, called a pointer. The <a href="https://www.w3.org/TR/pointerevents3/" target="_blank" rel="noopener noreferrer">Pointer Events</a> specification builds on mouse events and aims to provide a single set of events and interfaces for cross-device pointer input while still allowing for device-specific handling when necessary.</p>
<p>Following the Pointer Events specification provides React Native users many benefits. Beyond addressing the problems mentioned earlier, it raises the capabilities of platforms that haven’t historically had to consider multi-input type interactions. Think attaching a bluetooth mouse to your Android phone or the Apple pencil supporting hover on the iPad M2.</p>
<p>Being spec-complaint also provides opportunity for knowledge sharing between Web and React Native. Education of Web expectations around Pointer Events can doubly serve React Native developers. However, we also recognize that React Native requirements are different than web and our approach to specifications is best effort with well documented deviations so expectations are clear. There is related work of aligning certain Web standards to <a href="https://github.com/react-native-community/discussions-and-proposals/pull/496" target="_blank" rel="noopener noreferrer">reduce API fragmentation</a> in accessibility and performance APIs.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="porting-web-platform-tests">Porting Web Platform Tests<a href="https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native#porting-web-platform-tests" class="hash-link" aria-label="Direct link to Porting Web Platform Tests" title="Direct link to Porting Web Platform Tests">​</a></h2>
<p>While the Pointer Events specification provides interfaces and behavior descriptions of the API, we found it wasn’t specific enough for us to confidently make changes and point to the specification as verification. However, web browsers use another mechanism to ensure compliance and interoperability — the <a href="https://web-platform-tests.org/" target="_blank" rel="noopener noreferrer">Web Platform Tests</a>!</p>
<p>The Web Platform Tests are written to work against the browser’s imperative DOM APIs — unsupported by React Native as it uses its own view primitives. This means that we aren’t able to code-share the tests with browsers and instead have an analogous testing API for React Native that makes it easier to port those Web Platform Tests.</p>
<p>We implemented a new manual testing framework which we are now using for verifying our implementations through RNTester. These tests are tentatively named the RNTester Platform Tests and are still fairly basic. Our implementation provides an API to construct test cases as components themselves which are rendered and where the results are reported solely through the UI.</p>
<p><img loading="lazy" alt="GIF showing a side by side comparison of the &amp;quot;Pointer Events hoverable pointer attributes test&amp;quot; running in React Native (iOS) on the left, and Web (the original implementation) on the right." src="https://reactnative.dev/assets/images/pointer-events-wpt-demo-f524c11634eb4f9b5a907c5730f27321.gif" width="960" height="540" class="img_SS3x"></p>
<p>These tests will continue to be helpful as we further the completeness of our Pointer Events implementation. These tests will also scale to test Pointer Events implementations on platforms beyond Android and iOS. As the number of tests in our suite increase we will be looking to automate the running of these tests so that we are better equipped to catch regressions in our implementations.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="how-it-works">How it works<a href="https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native#how-it-works" class="hash-link" aria-label="Direct link to How it works" title="Direct link to How it works">​</a></h2>
<p>Much of our Pointer Events implementation builds off existing infrastructure for dispatching touch events. On Android and iOS we leverage the relevant MotionEvent and UITouch events. The general flow of event dispatching is illustrated below.</p>
<p><img loading="lazy" alt="Diagram of code flow for interpreting Android and iOS UI input events into Pointer Events. On Android, input handlers &amp;quot;onTouchEvent&amp;quot; and &amp;quot;onHoverEvent&amp;quot; fire &amp;quot;MotionEvents&amp;quot; that are interpreted into Pointer Events and through JSI are dispatched to the React renderer. iOS takes a similar path with input handlers &amp;quot;touchesBegan&amp;quot;, &amp;quot;touchesMoved&amp;quot;, &amp;quot;touchesEnded&amp;quot;, and &amp;quot;hovering&amp;quot; interpreting &amp;quot;UITouch&amp;quot; and &amp;quot;UIEvent&amp;quot; into Pointer Events." src="https://reactnative.dev/assets/images/pointer-events-code-flow-5f598d1362801753c43a1936f08a509d.png" width="1980" height="985" class="img_SS3x"></p>
<p>Using Android as an example, the general approach to leveraging platform events are:</p>
<ol>
<li>Iterate through all pointers of the <code>MotionEvent</code> and do a depth-first search to determine the target React view of each pointer and its ancestral path.</li>
<li>Map the category of <code>MotionEvent</code> to the relevant pointer events. There is a 1-to-many relationship between <code>MotionEvent</code> and <code>PointerEvent</code>. In the illustration of their relationship, dotted lines indicate fired events if the pointing device does not support hover.</li>
</ol>
<p><img loading="lazy" alt="A diagram illustrating the relationship of types of Android MotionEvents into Pointer Events fired. Some pointer events are conditionally fired if pointing device does not support hover. &amp;quot;ACTION_DOWN&amp;quot; and &amp;quot;ACTION_POINTER_DOWN&amp;quot; fire pointerdown and conditionally fire pointerenter, pointerover. &amp;quot;ACTION_MOVE&amp;quot; and &amp;quot;ACTION_HOVER_MOVE&amp;quot; fire pointerover, pointermove, pointerout, pointerup. &amp;quot;ACTION_UP&amp;quot; and &amp;quot;ACTION_POINTER_UP&amp;quot; fire pointerup and conditionally fire pointerout, pointerleave." src="https://reactnative.dev/assets/images/pointer-events-motionevent-relationship-892a4a19c30a230188599cc520c57804.png" width="1506" height="700" class="img_SS3x"></p>
<ol>
<li>Build the <code>PointerEvent</code> interface with platform details from the <code>MotionEvent</code> and cached state of previous interactions. (Ex. <a href="https://w3c.github.io/pointerevents/#the-button-property" target="_blank" rel="noopener noreferrer">the <code>button</code> property</a>)</li>
<li>Dispatch the pointer events from Android to React Native’s <a href="https://github.com/facebook/react-native/blob/main/ReactCommon/react/renderer/core/EventQueueProcessor.cpp#L20" target="_blank" rel="noopener noreferrer">core event queue</a> and leverage JSI to call the <a href="https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactFabricEventEmitter.js#L83" target="_blank" rel="noopener noreferrer"><code>dispatchEvent</code></a> method in <code>react-native-renderer</code> which iterates through the React tree for the bubble and capture phase of the event.</li>
</ol>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="implementation-progress">Implementation Progress<a href="https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native#implementation-progress" class="hash-link" aria-label="Direct link to Implementation Progress" title="Direct link to Implementation Progress">​</a></h2>
<p>When it comes to our current progress of implementing the Pointer Events specification we’ve focused on a solid baseline implementation of the most common events that handle things like pressing, hovering, and moving.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="events">Events<a href="https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native#events" class="hash-link" aria-label="Direct link to Events" title="Direct link to Events">​</a></h3>
<table><thead><tr><th>Implemented</th><th>Work in Progress</th><th>Yet to be Implemented</th></tr></thead><tbody><tr><td>onPointerOver</td><td>onPointerCancel</td><td>onClick</td></tr><tr><td>onPointerEnter</td><td></td><td>onContextMenu</td></tr><tr><td>onPointerDown</td><td></td><td>onGotPointerCapture</td></tr><tr><td>onPointerMove</td><td></td><td>onLostPointerCapture</td></tr><tr><td>onPointerUp</td><td></td><td>onPointerRawUpdate</td></tr><tr><td>onPointerOut</td><td></td><td></td></tr><tr><td>onPointerLeave</td><td></td><td></td></tr></tbody></table>
<div class="theme-admonition theme-admonition-info admonition_WCGJ alert alert--info"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_pbrs"><p>onPointerCancel has been hooked up to the native platform’s "cancel" event but this does not necessarily correspond to when the web platform expects them to fire.</p></div></div>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="event-properties">Event Properties<a href="https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native#event-properties" class="hash-link" aria-label="Direct link to Event Properties" title="Direct link to Event Properties">​</a></h3>
<p>For each of the events mentioned above we’ve also implemented the majority of the properties expected in the PointerEvent object — though in React Native these are exposed through the <code>event.nativeEvent</code> property. You can find an enumeration of all the implemented properties in the <a href="https://github.com/facebook/react-native/blob/59ee57352738f030b41589a450209e51e44bbb06/Libraries/Types/CoreEventTypes.js#L175" target="_blank" rel="noopener noreferrer">event object’s Flowtype interface definition</a>. One notable exception to being completely implemented is the <code>relatedTarget</code> property as exposing a native view reference in this ad-hoc manner isn’t trivial.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="future-work-and-exploration">Future Work and Exploration<a href="https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native#future-work-and-exploration" class="hash-link" aria-label="Direct link to Future Work and Exploration" title="Direct link to Future Work and Exploration">​</a></h2>
<p>In addition to the events above there are also some other APIs related to Pointer Events. In the future, we plan to be implement these APIs as a part of this effort. These APIs include:</p>
<ul>
<li>Pointer Capture API<!-- -->
<ul>
<li>Includes the imperative API exposed on element references including <code>setPointerCapture()</code>, <code>releasePointerCapture()</code>, and <code>hasPointerCapture()</code>.</li>
</ul>
</li>
<li><code>touch-action</code> style property<!-- -->
<ul>
<li>The web uses this CSS property to declaratively negotiate gestures between the browser and a website’s own event handling code. In React Native this could be used for negotiating the event handling between a View’s pointer event handlers and a parent ScrollView.</li>
</ul>
</li>
<li><code>click</code>, <code>contextmenu</code>, <code>auxclick</code>
<ul>
<li><code>click</code> is an abstract definition of interaction that may be triggered through accessibility paradigms or other characteristic platform interactions.</li>
</ul>
</li>
</ul>
<p>Another benefit of the native Pointer Events implementation is that it will allow us to revisit and improve various forms of gesture handling currently limited only to touch events and handled in JavaScript by the Responder, Pressability, and PanResponder APIs.</p>
<p>Furthermore, we are continuing to explore including an implementation of the <code>EventTarget</code> interface for React Native host components (i.e. <code>add</code>/<code>removeEventListener</code>) which we believe will make possible more user-land abstractions for handling pointer interactions.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="trying-it-out">Trying it Out<a href="https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native#trying-it-out" class="hash-link" aria-label="Direct link to Trying it Out" title="Direct link to Trying it Out">​</a></h2>
<p>Our Pointer Events implementation is still experimental but we’re interested in getting feedback from the community on what we’ve shared. If you are interested in trying this API you’ll need to enable a couple feature flags:</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="enable-feature-flags">Enable Feature Flags<a href="https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native#enable-feature-flags" class="hash-link" aria-label="Direct link to Enable Feature Flags" title="Direct link to Enable Feature Flags">​</a></h3>
<div class="theme-admonition theme-admonition-note admonition_WCGJ alert alert--secondary"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_pbrs"><p>Pointer Events are only implemented for the <a href="https://reactnative.dev/docs/the-new-architecture/use-app-template" target="_blank" rel="noopener noreferrer">New Architecture (Fabric)</a> and are only available for React Native 0.71+ which at the time of writing is a release candidate.</p></div></div>
<p>In your entry JavaScript file (index.js in the default React Native app template) you’ll need to enable the <code>shouldEmitW3CPointerEvents</code> flag for Pointer Events and <code>shouldPressibilityUseW3CPointerEventsForHover</code> to use Pointer Events in <code>Pressability</code>.</p>
<div class="language-js codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-js codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token keyword module" style="color:#c5a5c5">import</span><span class="token plain"> </span><span class="token imports maybe-class-name">ReactNativeFeatureFlags</span><span class="token plain"> </span><span class="token keyword module" style="color:#c5a5c5">from</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">'react-native/Libraries/ReactNative/ReactNativeFeatureFlags'</span><span class="token punctuation" style="color:#657b83">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// enable the JS-side of the w3c PointerEvent implementation</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token maybe-class-name">ReactNativeFeatureFlags</span><span class="token punctuation" style="color:#657b83">.</span><span class="token method-variable function-variable method function property-access" style="color:#79b6f2">shouldEmitW3CPointerEvents</span><span class="token plain"> </span><span class="token operator" style="color:#fc929e">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">(</span><span class="token punctuation" style="color:#657b83">)</span><span class="token plain"> </span><span class="token arrow operator" style="color:#fc929e">=&gt;</span><span class="token plain"> </span><span class="token boolean" style="color:#ff8b50">true</span><span class="token punctuation" style="color:#657b83">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// enable hover events in Pressibility to be backed by the PointerEvent implementation</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token maybe-class-name">ReactNativeFeatureFlags</span><span class="token punctuation" style="color:#657b83">.</span><span class="token method-variable function-variable method function property-access" style="color:#79b6f2">shouldPressibilityUseW3CPointerEventsForHover</span><span class="token plain"> </span><span class="token operator" style="color:#fc929e">=</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">  </span><span class="token punctuation" style="color:#657b83">(</span><span class="token punctuation" style="color:#657b83">)</span><span class="token plain"> </span><span class="token arrow operator" style="color:#fc929e">=&gt;</span><span class="token plain"> </span><span class="token boolean" style="color:#ff8b50">true</span><span class="token punctuation" style="color:#657b83">;</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="ios-specific">iOS-specific<a href="https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native#ios-specific" class="hash-link" aria-label="Direct link to iOS-specific" title="Direct link to iOS-specific">​</a></h3>
<p>In order to ensure that the pointer events are sent from the native iOS renderer you’ll need to flip a native feature flag in your native app’s initialization code (typically <code>AppDelegate.mm</code>).</p>
<div class="language-objc codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-objc codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token macro property directive-hash" style="color:#2aa198">#</span><span class="token macro property directive keyword" style="color:#c5a5c5">import</span><span class="token macro property" style="color:#2aa198"> </span><span class="token macro property expression operator" style="color:#fc929e">&lt;</span><span class="token macro property expression" style="color:#2aa198">React</span><span class="token macro property expression operator" style="color:#fc929e">/</span><span class="token macro property expression" style="color:#2aa198">RCTConstants</span><span class="token macro property expression punctuation" style="color:#657b83">.</span><span class="token macro property expression" style="color:#2aa198">h</span><span class="token macro property expression operator" style="color:#fc929e">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// ...</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token operator" style="color:#fc929e">-</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">(</span><span class="token plain">BOOL</span><span class="token punctuation" style="color:#657b83">)</span><span class="token plain">application</span><span class="token punctuation" style="color:#657b83">:</span><span class="token punctuation" style="color:#657b83">(</span><span class="token plain">UIApplication </span><span class="token operator" style="color:#fc929e">*</span><span class="token punctuation" style="color:#657b83">)</span><span class="token plain">application didFinishLaunchingWithOptions</span><span class="token punctuation" style="color:#657b83">:</span><span class="token punctuation" style="color:#657b83">(</span><span class="token plain">NSDictionary </span><span class="token operator" style="color:#fc929e">*</span><span class="token punctuation" style="color:#657b83">)</span><span class="token plain">launchOptions</span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token function" style="color:#79b6f2">RCTSetDispatchW3CPointerEvents</span><span class="token punctuation" style="color:#657b83">(</span><span class="token plain">YES</span><span class="token punctuation" style="color:#657b83">)</span><span class="token punctuation" style="color:#657b83">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token comment" style="color:#93a1a1">// ...</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token punctuation" style="color:#657b83">}</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<p>Note that to ensure that the Pointer Event implementation can distinguish between mouse and touch pointers on iOS you need to add <a href="https://developer.apple.com/documentation/bundleresources/information_property_list/uiapplicationsupportsindirectinputevents" target="_blank" rel="noopener noreferrer"><code>UIApplicationSupportsIndirectInputEvents</code></a> to your Xcode project’s <code>info.plist</code>.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="android-specific">Android-specific<a href="https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native#android-specific" class="hash-link" aria-label="Direct link to Android-specific" title="Direct link to Android-specific">​</a></h3>
<p>Similarly to iOS Android has a feature flag that you’ll need to enable in your app’s initialization — typically your <code>onCreate</code> for your root React activity or surface.</p>
<div class="language-java codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-java codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token keyword" style="color:#c5a5c5">import</span><span class="token plain"> </span><span class="token import namespace" style="opacity:0.7">com</span><span class="token import namespace punctuation" style="opacity:0.7;color:#657b83">.</span><span class="token import namespace" style="opacity:0.7">facebook</span><span class="token import namespace punctuation" style="opacity:0.7;color:#657b83">.</span><span class="token import namespace" style="opacity:0.7">react</span><span class="token import namespace punctuation" style="opacity:0.7;color:#657b83">.</span><span class="token import namespace" style="opacity:0.7">config</span><span class="token import namespace punctuation" style="opacity:0.7;color:#657b83">.</span><span class="token import class-name" style="color:#fac863">ReactFeatureFlags</span><span class="token punctuation" style="color:#657b83">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">//... somewhere in initialization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token annotation punctuation" style="color:#657b83">@Override</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token keyword" style="color:#c5a5c5">public</span><span class="token plain"> </span><span class="token keyword" style="color:#c5a5c5">void</span><span class="token plain"> </span><span class="token function" style="color:#79b6f2">onCreate</span><span class="token punctuation" style="color:#657b83">(</span><span class="token punctuation" style="color:#657b83">)</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token class-name" style="color:#fac863">ReactFeatureFlags</span><span class="token punctuation" style="color:#657b83">.</span><span class="token plain">dispatchPointerEvents </span><span class="token operator" style="color:#fc929e">=</span><span class="token plain"> </span><span class="token boolean" style="color:#ff8b50">true</span><span class="token punctuation" style="color:#657b83">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token punctuation" style="color:#657b83">}</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="javascript">JavaScript<a href="https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native#javascript" class="hash-link" aria-label="Direct link to JavaScript" title="Direct link to JavaScript">​</a></h3>
<div class="language-js codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-js codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token keyword" style="color:#c5a5c5">function</span><span class="token plain"> </span><span class="token function" style="color:#79b6f2">onPointerOver</span><span class="token punctuation" style="color:#657b83">(</span><span class="token parameter">event</span><span class="token punctuation" style="color:#657b83">)</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">  </span><span class="token console class-name" style="color:#fac863">console</span><span class="token punctuation" style="color:#657b83">.</span><span class="token method function property-access" style="color:#79b6f2">log</span><span class="token punctuation" style="color:#657b83">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token string" style="color:#8dc891">'Over blue box offset: '</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    event</span><span class="token punctuation" style="color:#657b83">.</span><span class="token property-access">nativeEvent</span><span class="token punctuation" style="color:#657b83">.</span><span class="token property-access">offsetX</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    event</span><span class="token punctuation" style="color:#657b83">.</span><span class="token property-access">nativeEvent</span><span class="token punctuation" style="color:#657b83">.</span><span class="token property-access">offsetY</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">  </span><span class="token punctuation" style="color:#657b83">)</span><span class="token punctuation" style="color:#657b83">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token punctuation" style="color:#657b83">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// ... in some component</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token operator" style="color:#fc929e">&lt;</span><span class="token maybe-class-name">View</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">  onPointerOver</span><span class="token operator" style="color:#fc929e">=</span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain">onPointerOver</span><span class="token punctuation" style="color:#657b83">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">  style</span><span class="token operator" style="color:#fc929e">=</span><span class="token punctuation" style="color:#657b83">{</span><span class="token punctuation" style="color:#657b83">{</span><span class="token literal-property property" style="color:#2aa198">height</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token number" style="color:#5a9bcf">100</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"> </span><span class="token literal-property property" style="color:#2aa198">width</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token number" style="color:#5a9bcf">100</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"> </span><span class="token literal-property property" style="color:#2aa198">backgroundColor</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">'blue'</span><span class="token punctuation" style="color:#657b83">}</span><span class="token punctuation" style="color:#657b83">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token operator" style="color:#fc929e">/</span><span class="token operator" style="color:#fc929e">&gt;</span><span class="token punctuation" style="color:#657b83">;</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="feedback-welcome">Feedback Welcome<a href="https://reactnative.dev/blog/2022/12/13/pointer-events-in-react-native#feedback-welcome" class="hash-link" aria-label="Direct link to Feedback Welcome" title="Direct link to Feedback Welcome">​</a></h2>
<p>Today Pointer Events are used by our VR platform and powering the Oculus Store, but we're also looking for early community feedback on both our approach and what we have for an implementation so far. We are excited to share our further progress with you and if you have questions or thoughts around this work, join us on the <a href="https://github.com/react-native-community/discussions-and-proposals/discussions/557" target="_blank" rel="noopener noreferrer">dedicated discussion on Pointer Events</a>.</p>]]></content:encoded>
            <category>announcement</category>
        </item>
        <item>
            <title><![CDATA[React Native Core Contributor Summit 2022]]></title>
            <link>https://reactnative.dev/blog/2022/11/22/react-native-core-contributor-summit-2022</link>
            <guid>https://reactnative.dev/blog/2022/11/22/react-native-core-contributor-summit-2022</guid>
            <pubDate>Tue, 22 Nov 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[After years of pandemic and online-only events, we really felt it was time to bring the Core Contributors of React Native together!]]></description>
            <content:encoded><![CDATA[<p>After years of pandemic and online-only events, we really felt it was time to bring the Core Contributors of React Native together!</p>
<p>That’s why at the beginning of September, we gathered some of the active core contributors of React Native, library maintainers, and the Meta’s React Native and Metro teams to the <strong>Core Contributor Summit 2022</strong>. <a href="https://www.callstack.com/" target="_blank" rel="noopener noreferrer">Callstack</a> hosted the Summit in their HQ in Wrocław, Poland, as a part of the <a href="https://www.react-native.eu/" target="_blank" rel="noopener noreferrer">React Native EU</a> conference happening at the same time.</p>
<p>Together with the React Native core team, we devised a series of <strong>workshops</strong> in which the attendees could participate. The topics were:</p>
<ul>
<li>​​React Native Codegen &amp; TypeScript Support</li>
<li>​​React Native New Architecture Library Migration</li>
<li>​​React Native Monorepo</li>
<li>Metro Web and Ecosystem Alignment</li>
<li>Metro Simplified Release Workflow</li>
</ul>
<p>We were impressed by the amount of knowledge-sharing and collaboration over those two days. In this blog post, we’d like to give you a sneak peek of the results of this gathering.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="react-native-codegen--typescript-support">React Native Codegen &amp; TypeScript Support<a href="https://reactnative.dev/blog/2022/11/22/react-native-core-contributor-summit-2022#react-native-codegen--typescript-support" class="hash-link" aria-label="Direct link to React Native Codegen &amp; TypeScript Support" title="Direct link to React Native Codegen &amp; TypeScript Support">​</a></h3>
<p><a href="https://reactnative.dev/docs/the-new-architecture/pillars-codegen">React Native’s Codegen</a> is a fundamental part of the New Architecture of React Native. Supporting and improving it is among our top priorities for the future of React Native. For instance, earlier this year, we added support for generic code starting from TypeScript specs rather than Flow.</p>
<p>In this session, we took the opportunity to onboard new contributors to Codegen, by explaining its core concept and describing how it works. We then focused on two major areas:</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="1-supporting-new-types-that-are-currently-unsupported-by-codegen-one-of-the-highly-requested-ones-was-the-string-union-types-in-typescript">1. Supporting <strong>new types</strong> that are currently unsupported by Codegen. One of the highly requested ones was the <a href="https://github.com/Titozzz/react-native/tree/codegen-string-union" target="_blank" rel="noopener noreferrer">string union types in TypeScript</a>.<a href="https://reactnative.dev/blog/2022/11/22/react-native-core-contributor-summit-2022#1-supporting-new-types-that-are-currently-unsupported-by-codegen-one-of-the-highly-requested-ones-was-the-string-union-types-in-typescript" class="hash-link" aria-label="Direct link to 1-supporting-new-types-that-are-currently-unsupported-by-codegen-one-of-the-highly-requested-ones-was-the-string-union-types-in-typescript" title="Direct link to 1-supporting-new-types-that-are-currently-unsupported-by-codegen-one-of-the-highly-requested-ones-was-the-string-union-types-in-typescript">​</a></h4>
<p>A team of a few people moved into a meeting room to tackle this task. They encountered and overcame some difficulties along the way, like how to run unit tests for Codegen. They spent quite some time understanding the code execution flow before starting to deal with the code. After some hours of collaborative work, they ended up with the first prototype that was able to recognize string unions. This experience was extremely useful in discussing design patterns and the ideal architecture we may want in the future.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="2-improving-auto-linking-for-ios-which-was-missing-a-use-case">2. Improving <strong><a href="https://github.com/facebook/react-native/pull/34580" target="_blank" rel="noopener noreferrer">auto-linking for iOS</a></strong>, which was missing a use case.<a href="https://reactnative.dev/blog/2022/11/22/react-native-core-contributor-summit-2022#2-improving-auto-linking-for-ios-which-was-missing-a-use-case" class="hash-link" aria-label="Direct link to 2-improving-auto-linking-for-ios-which-was-missing-a-use-case" title="Direct link to 2-improving-auto-linking-for-ios-which-was-missing-a-use-case">​</a></h4>
<p>Specifically, auto-linking could not work well in scenarios where libraries and the app were living together in a monorepo. Android already supported this use case but it was missing for iOS.</p>
<p>Working with the contributors on Codegen helped us realize that it wasn’t trivial to work in its codebase. For example, adding the support for one type required to copy-and-paste the same code in four different places: modules with specs written in Flow, modules with specs written in TypeScript, components with specs written in Flow, and components with specs written in TypeScript.</p>
<p>This realization pushed us to create an <a href="https://github.com/facebook/react-native/issues/34872" target="_blank" rel="noopener noreferrer">umbrella task</a> to reach out for help to the community in order to improve the status of the codebase toward a more maintainable one.</p>
<p>The participation was outstanding: we managed to quickly assign the first <strong>40 tasks in 5 days</strong>. At the end of October, the community completed <strong>47 tasks</strong> and many others are ready and waiting to be merged.</p>
<p>This initiative also contributed to the <a href="https://hacktoberfest.com/" target="_blank" rel="noopener noreferrer">Hacktoberfest</a> for all the people who contributed to these improvements!</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="react-native-new-architecture-library-migration">​​React Native New Architecture Library Migration<a href="https://reactnative.dev/blog/2022/11/22/react-native-core-contributor-summit-2022#react-native-new-architecture-library-migration" class="hash-link" aria-label="Direct link to ​​React Native New Architecture Library Migration" title="Direct link to ​​React Native New Architecture Library Migration">​</a></h3>
<p>The hot topic in the React Native space is the New Architecture. Having <strong>libraries</strong> that support the New Architecture is a crucial point in the <a href="https://reactnative.dev/blog/2022/06/16/resources-migrating-your-react-native-library-to-the-new-architecture">migration for the whole ecosystem</a>. Therefore, we want to support library maintainers in migrating to the New Architectures.</p>
<p>Initially, this session started as a brainstorming, where the core contributors had the opportunity to ask the React Native team all the questions they had related to the New Architecture. This in-person feedback loop was crucial for both the core contributors to bring clarity and for the React Native team to collect feedback. Some of the shared feedback and concerns will end up being implemented in React Native 0.71.</p>
<p>We then moved to practically migrating as many libraries to the new architecture as possible. During this session, we kicked off the migration process for several community packages, such as <code>react-native-document-picker</code>, <code>react-native-store-review</code>, and <code>react-native-orientation</code>.</p>
<p>As a reminder, if you’re also migrating a library and need support in doing so, please reach out to our <a href="https://github.com/reactwg/react-native-new-architecture" target="_blank" rel="noopener noreferrer">New Architecture Working Group</a> on GitHub.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="react-native-monorepo">​​React Native Monorepo<a href="https://reactnative.dev/blog/2022/11/22/react-native-core-contributor-summit-2022#react-native-monorepo" class="hash-link" aria-label="Direct link to ​​React Native Monorepo" title="Direct link to ​​React Native Monorepo">​</a></h3>
<p>Releasing a new version of React Native is not trivial today. React Native is one of the most downloaded packages on NPM, and we want to make sure that our release process is smooth.</p>
<p>That’s why we want to refactor the <code>react-native</code> repository and implement the <strong>Monorepo RFC</strong> (<a href="https://github.com/react-native-community/discussions-and-proposals/pull/480" target="_blank" rel="noopener noreferrer">#480</a>).</p>
<p>In this session, we initially brainstormed and collected opinions from every contributor, as it’s crucial that we evolve our repository to reduce the breaking changes for our downstream dependencies.</p>
<p>We then started working on two fronts. First, we had to expand our Continuous Integration infrastructure to support our monorepo, adding <a href="https://verdaccio.org/" target="_blank" rel="noopener noreferrer">Verdaccio</a> to our testing infrastructure. We then started renaming &amp; adding scopes to several of our packages, resulting in 6 distinct contributions.</p>
<p>You can track the status of this effort under this <a href="https://github.com/facebook/react-native/issues/34692" target="_blank" rel="noopener noreferrer">umbrella issue</a> and we hope to share more on this effort in the near future.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="metro-web-and-ecosystem-alignment">Metro Web and Ecosystem Alignment<a href="https://reactnative.dev/blog/2022/11/22/react-native-core-contributor-summit-2022#metro-web-and-ecosystem-alignment" class="hash-link" aria-label="Direct link to Metro Web and Ecosystem Alignment" title="Direct link to Metro Web and Ecosystem Alignment">​</a></h3>
<p><a href="https://github.com/facebook/metro" target="_blank" rel="noopener noreferrer">Metro</a>, our JavaScript Bundler, is a foundational and integrated part of the React Native development experience and we want to make sure it works with the latest standards in the JS ecosystem.</p>
<p>The focus of this session was to discuss improving Metro's feature set to work better for web use cases and with the npm and bundler ecosystem. Two major areas of discussion:</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="1-adopting-the-exports-package-entry-points-specification">1. Adopting the <code>"exports"</code> (<a href="https://nodejs.org/api/packages.html#package-entry-points" target="_blank" rel="noopener noreferrer">package entry points</a>) specification<a href="https://reactnative.dev/blog/2022/11/22/react-native-core-contributor-summit-2022#1-adopting-the-exports-package-entry-points-specification" class="hash-link" aria-label="Direct link to 1-adopting-the-exports-package-entry-points-specification" title="Direct link to 1-adopting-the-exports-package-entry-points-specification">​</a></h4>
<p>From the <a href="https://nodejs.org/api/packages.html#package-entry-points" target="_blank" rel="noopener noreferrer">Node.js documentation</a>:</p>
<div class="theme-admonition theme-admonition-info admonition_WCGJ alert alert--info"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_pbrs"><p>The <a href="https://nodejs.org/api/packages.html#exports" target="_blank" rel="noopener noreferrer">"exports"</a> provides a modern alternative to <a href="https://nodejs.org/api/packages.html#main" target="_blank" rel="noopener noreferrer">"main"</a> allowing multiple entry points to be defined, conditional entry resolution support between environments, and <strong>preventing any other entry points besides those defined in <a href="https://nodejs.org/api/packages.html#exports" target="_blank" rel="noopener noreferrer">"exports"</a></strong>. This encapsulation allows module authors to define the public interface for their package clearly.</p></div></div>
<p>Adopting the <code>"exports"</code> specification has a lot of potential. In this session, we debated on how to handle <a href="https://reactnative.dev/docs/platform-specific-code#platform-specific-extensions">Platform Specific Code</a> with <code>"exports"</code>. Considering many factors, we came up with a fairly non-breaking rollout plan for <code>"exports"</code>, by adding a <code>"strict"</code> and <code>"non-strict"</code> mode to Metro resolver. We discussed how leveraging <a href="https://github.com/callstack/react-native-builder-bob" target="_blank" rel="noopener noreferrer">builder-bob</a> would help library creators adopt the strict mode without friction.</p>
<p>This discussion resulted in:</p>
<ol>
<li>An <a href="https://github.com/react-native-community/discussions-and-proposals/pull/534" target="_blank" rel="noopener noreferrer">RFC</a> for Metro on how package exports would work with React Native.</li>
<li>An <a href="https://github.com/nodejs/node/pull/45367" target="_blank" rel="noopener noreferrer">RFC</a> for Node.js to include “react-native” as a Community Condition.</li>
</ol>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="2-web-and-bundler-ecosystem">2. Web and bundler ecosystem<a href="https://reactnative.dev/blog/2022/11/22/react-native-core-contributor-summit-2022#2-web-and-bundler-ecosystem" class="hash-link" aria-label="Direct link to 2. Web and bundler ecosystem" title="Direct link to 2. Web and bundler ecosystem">​</a></h4>
<p>The Metro team shared progress from their partnership with Expo and the intent to continue this working model for upcoming bundle splitting and tree-shaking support. We touched again on ES module support and considered potential future features such as Yarn PnP and output optimization on the web. We discussed how Metro’s core shares logic and data structures with Jest and opportunities for more reuse.</p>
<p>Developers surfaced insightful use cases for bundle splitting and interoperability with third-party tooling. This led us to discuss potential extension points in Metro and improving current documentation.</p>
<p>This discussion provided us with good grounding for the next day's session on simplifying the release workflow.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="metro-simplified-release-workflow">Metro Simplified Release Workflow<a href="https://reactnative.dev/blog/2022/11/22/react-native-core-contributor-summit-2022#metro-simplified-release-workflow" class="hash-link" aria-label="Direct link to Metro Simplified Release Workflow" title="Direct link to Metro Simplified Release Workflow">​</a></h3>
<p>As mentioned, releasing React Native is not trivial.</p>
<p>Things get harder as we need to release React Native, the React Native CLI, and Metro. Those tools are connected to each other as React Native and the CLI both depend on Metro. This creates some friction when any of the packages releases a new version.</p>
<p>Currently, we manage this through direct communication and synchronized releases, but there is space for improvement.</p>
<p>In this session, we reconsidered the <strong>dependencies</strong> between React Native, Metro, and the CLI. We uncovered how some design decisions during the <a href="https://github.com/react-native-community/discussions-and-proposals/issues/6" target="_blank" rel="noopener noreferrer">“Lean Core” effort</a>, when we extracted the CLI from React Native, made these two projects codependent with some functionalities duplicated among efforts. The decisions back then made sense and allowed the CLI team to iterate faster than ever.</p>
<p>It was about time to revisit them and take the experience of both teams to figure out the way through. As a result, the Metro team will take over the <a href="https://github.com/react-native-community/cli/tree/main/packages/cli-plugin-metro" target="_blank" rel="noopener noreferrer"><code>@react-native-community/cli-plugin-metro</code></a> development, temporarily moving it back to the core of React Native, and then most likely to the Metro monorepo.</p>
<p><img loading="lazy" src="https://reactnative.dev/assets/images/core-contributor-summit-2022-fe0899624299a2b699322a43a20cb7a3.jpg" width="1865" height="1252" class="img_SS3x"></p>
<p>The biggest takeaway, apart from three hours of drawing dependencies between the packages on the whiteboard, was for the CLI and Metro team to exchange their issues, experiences, and plans, resulting in a better understanding of each other.</p>
<p>We wouldn’t be able to achieve this level of cooperation without actually meeting each other.</p>
<hr>
<p>We’re still impressed by how spending several hours together for a couple of days resulted in so much knowledge-sharing and cross-pollination of ideas. During this summit, we planted the seeds for initiatives that will help us improve and re-shape the React Native ecosystem.</p>
<p>We want to say thank you again to <a href="https://www.callstack.com/" target="_blank" rel="noopener noreferrer">Callstack</a> for hosting us and to all the participants for joining us at the Core Contributor Summit 2022.</p>
<p>If you’re interested in joining the development of React Native, make sure you join our open initiatives and read the <a href="https://reactnative.dev/contributing/overview" target="_blank" rel="noopener noreferrer">contribution guide</a> we have on our website. We hope to meet you in person as well in the future!</p>]]></content:encoded>
            <category>announcement</category>
        </item>
        <item>
            <title><![CDATA[Announcing React Native 0.70]]></title>
            <link>https://reactnative.dev/blog/2022/09/05/version-070</link>
            <guid>https://reactnative.dev/blog/2022/09/05/version-070</guid>
            <pubDate>Mon, 05 Sep 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[We are excited to release a new version of React Native, 0.70.0. This version comes with several improvements like a new unified configuration for Codegen, Hermes as default engine, and full CMake support for Android builds along with a refresh of the documentation for the New Architecture. Read on to learn more!]]></description>
            <content:encoded><![CDATA[<p>We are excited to release a new version of React Native, 0.70.0. This version comes with several improvements like a new unified configuration for Codegen, Hermes as default engine, and full CMake support for Android builds along with a refresh of the documentation for the New Architecture. Read on to learn more!</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="sections">Sections<a href="https://reactnative.dev/blog/2022/09/05/version-070#sections" class="hash-link" aria-label="Direct link to Sections" title="Direct link to Sections">​</a></h3>
<ul>
<li><a href="https://reactnative.dev/blog/2022/09/05/version-070#new-architectures-new-documentation">New Architecture’s New Documentation</a></li>
<li><a href="https://reactnative.dev/blog/2022/09/05/version-070#hermes-as-default-engine">Hermes as default engine</a></li>
<li><a href="https://reactnative.dev/blog/2022/09/05/version-070#a-new-unified-configuration-for-codegen">A new unified configuration for Codegen</a></li>
<li><a href="https://reactnative.dev/blog/2022/09/05/version-070#android-auto-linking-for-new-architecture-libraries">Android Auto-linking for New Architecture libraries</a></li>
<li><a href="https://reactnative.dev/blog/2022/09/05/version-070#full-cmake-support-for-android-builds">Full CMake support for Android builds</a></li>
<li><a href="https://reactnative.dev/blog/2022/09/05/version-070#highlights-of-070">Highlights of 0.70</a></li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="new-architectures-new-documentation">New Architecture’s New Documentation<a href="https://reactnative.dev/blog/2022/09/05/version-070#new-architectures-new-documentation" class="hash-link" aria-label="Direct link to New Architecture’s New Documentation" title="Direct link to New Architecture’s New Documentation">​</a></h2>
<p>Over the last few months, we have been working to add more content to the <a href="https://reactnative.dev/docs/next/the-new-architecture/landing-page" target="_blank" rel="noopener noreferrer">New Architecture</a> section of the documentation. In the new section you can find migration guides, examples and tutorials to get you up to speed.</p>
<p>Along with it, you can find new documents diving into <a href="https://reactnative.dev/docs/next/the-new-architecture/why" target="_blank" rel="noopener noreferrer">Why a New Architecture</a> and <a href="https://reactnative.dev/docs/next/the-new-architecture/pillars" target="_blank" rel="noopener noreferrer">the various parts of it</a>. We hope this helps you better understand the rationale behind the new APIs.</p>
<p>Any feedback is more than welcome, please let us know in the <a href="https://github.com/facebook/react-native-website" target="_blank" rel="noopener noreferrer">react-native-website</a> repository.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="hermes-as-default-engine">Hermes as default engine<a href="https://reactnative.dev/blog/2022/09/05/version-070#hermes-as-default-engine" class="hash-link" aria-label="Direct link to Hermes as default engine" title="Direct link to Hermes as default engine">​</a></h2>
<p>React Native 0.70 is the first version with Hermes, our in-house JS engine, enabled by default.</p>
<p>This is the result of collaborative effort between the Hermes team and the React Native team, alongside with the priceless contributions from the community. We worked to improve and fine tune Hermes to make it more performant and deliver highly requested features by the community.</p>
<p>You can read more about it in the <a href="https://reactnative.dev/blog/2022/07/08/hermes-as-the-default" target="_blank" rel="noopener noreferrer">official announcement blogpost</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="a-new-unified-configuration-for-codegen">A new unified configuration for Codegen<a href="https://reactnative.dev/blog/2022/09/05/version-070#a-new-unified-configuration-for-codegen" class="hash-link" aria-label="Direct link to A new unified configuration for Codegen" title="Direct link to A new unified configuration for Codegen">​</a></h2>
<p>With 0.70, we introduced a unified way to define the Codegen specs for both iOS and Android. Previously, you had to put the Android configuration in a separate <code>build.gradle</code> file.</p>
<p>Now, you can define it directly in the package.json with:</p>
<div class="language-json codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-json codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token plain">  </span><span class="token property" style="color:#2aa198">"codegenConfig"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token property" style="color:#2aa198">"name"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">"CustomAnimationView"</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token property" style="color:#2aa198">"type"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">"components"</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token property" style="color:#2aa198">"jsSrcsDir"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">"./src"</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token property" style="color:#2aa198">"android"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">      </span><span class="token property" style="color:#2aa198">"javaPackageName"</span><span class="token operator" style="color:#fc929e">:</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">"com.custom.animation"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">    </span><span class="token punctuation" style="color:#657b83">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">  </span><span class="token punctuation" style="color:#657b83">}</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<p>This improvement provides a more consistent experience for library maintainers in migrating their codebases to the New Architecture.</p>
<p>If you are a library maintainer, please make sure to let us know how the process is going for you in <a href="https://github.com/reactwg/react-native-new-architecture/discussions/6" target="_blank" rel="noopener noreferrer">this discussion</a> in the <a href="https://github.com/reactwg/react-native-new-architecture" target="_blank" rel="noopener noreferrer">React Native New Architecture working group</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="android-auto-linking-for-new-architecture-libraries">Android Auto-linking for New Architecture libraries<a href="https://reactnative.dev/blog/2022/09/05/version-070#android-auto-linking-for-new-architecture-libraries" class="hash-link" aria-label="Direct link to Android Auto-linking for New Architecture libraries" title="Direct link to Android Auto-linking for New Architecture libraries">​</a></h2>
<p>With 0.70, users on New Architecture are able to automatically link libraries without any additional configuration on their Android.mk or CMake files.</p>
<p>Autolinking is a crucial part of the React Native development experience. It allows you to include external libraries with a <code>yarn add</code> command, without dealing with CocoaPods or Gradle setups.</p>
<p>The New Architecture required us to adapt the auto-linking features to support libraries which are using the Codegen and exposing native code to app developers.</p>
<p>While Autolinking worked well for New Architecture libraries on iOS, the same was not true for Android. With 0.70 we closed this gap and you can now keep on including libraries with <code>yarn add</code> to your project: they will be linked correctly on any architecture.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="full-cmake-support-for-android-builds">Full CMake support for Android builds<a href="https://reactnative.dev/blog/2022/09/05/version-070#full-cmake-support-for-android-builds" class="hash-link" aria-label="Direct link to Full CMake support for Android builds" title="Direct link to Full CMake support for Android builds">​</a></h2>
<p>Starting from 0.70, users can now use CMake to configure their Native builds. While we don’t expect app users to directly write C++ code, you still need an entry point for the native compilation.</p>
<p>From now on you can use a <code>CMakeLists.txt</code> file instead of an <code>Android.mk</code> file for anything Android/Native related in your project.</p>
<p>This change benefits both app and library users on the New Architecture as:</p>
<ul>
<li>The CMake file created in your app is way smaller (<a href="https://github.com/facebook/react-native/blob/9923ac1b524ae959abdf50a28a3094198015f77e/packages/rn-tester/android/app/src/main/jni/CMakeLists.txt#L6-L11" target="_blank" rel="noopener noreferrer">3 lines of code</a> versus <a href="https://github.com/facebook/react-native/blob/main/template/android/app/src/main/jni/Android.mk?rgh-link-date=2022-07-20T18%3A29%3A07Z" target="_blank" rel="noopener noreferrer">50+ for Android.mk files</a>). This makes for an easier update experience between React Native versions in the future and less code to maintain on your end.</li>
<li>Codegen is now generating both <code>Android.mk</code> and <code>CMakeLists.txt</code>, so libraries should not worry about doing anything if they're using the default setup we provide for New Architecture libraries.</li>
<li>The Auto-linking mentioned above will work with both CMake and Android.mk files out of the box.</li>
<li>Despite apps being free to use either <code>Android.mk</code> or CMake files, the recommended solution in the future would be CMake files (due to better documentation, tooling and ecosystem around CMake).</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="highlights-of-070">Highlights of 0.70<a href="https://reactnative.dev/blog/2022/09/05/version-070#highlights-of-070" class="hash-link" aria-label="Direct link to Highlights of 0.70" title="Direct link to Highlights of 0.70">​</a></h2>
<p>As mentioned above, some of the more important improvements in this release are centered around the New Architecture experience. However, there have been other notable changes, including:</p>
<ul>
<li>Fix for Catalyst is live, set <code>mac_catalyst_enabled</code> to <code>true</code> in Podfile (see <a href="https://react-native-community.github.io/upgrade-helper/?from=0.69.1&amp;to=0.70.0-rc.0" target="_blank" rel="noopener noreferrer">upgrade-helper</a> diff for details).</li>
<li>Bumping metro to 0.72.0 which will enable the new React JSX Transform: <a href="https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html" target="_blank" rel="noopener noreferrer">reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html</a>.</li>
<li>Removing <code>reactnativeutilsjni</code> as it is built from the same sources as <code>reactnativejni</code> which results in ~220 KBs saved from every Android APK build. (<a href="https://github.com/facebook/react-native/pull/34339" target="_blank" rel="noopener noreferrer">https://github.com/facebook/react-native/pull/34339</a>).</li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="breaking-changes">Breaking changes<a href="https://reactnative.dev/blog/2022/09/05/version-070#breaking-changes" class="hash-link" aria-label="Direct link to Breaking changes" title="Direct link to Breaking changes">​</a></h3>
<p>There have also been a few breaking changes:</p>
<ul>
<li>Removed jest/preprocessor from the react-native package (<a href="https://github.com/facebook/react-native/commit/0301cb285b2e85b48a397fe58d565196654d9754" target="_blank" rel="noopener noreferrer">0301cb285b</a> by <a href="https://github.com/motiz88" target="_blank" rel="noopener noreferrer">@motiz88</a>)</li>
<li>Remove nonstandard <code>Promise.prototype.done</code> (<a href="https://github.com/facebook/react-native/commit/018d5cf985497273dd700b56168cf1cf64f498d5" target="_blank" rel="noopener noreferrer">018d5cf985</a> by <a href="https://github.com/motiz88" target="_blank" rel="noopener noreferrer">@motiz88</a>)</li>
</ul>
<p>Please also note that the version of Metro has been bumped to 0.72, which comes <a href="https://github.com/facebook/metro/releases/tag/v0.72.0" target="_blank" rel="noopener noreferrer">with 5 breaking changes</a>.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="upgrades">Upgrades<a href="https://reactnative.dev/blog/2022/09/05/version-070#upgrades" class="hash-link" aria-label="Direct link to Upgrades" title="Direct link to Upgrades">​</a></h3>
<p>And we upgraded some of our dependencies:</p>
<ul>
<li>Bump RN CLI to v9.0.0</li>
<li>Bump Android Gradle Plugin to 7.2.1</li>
<li>Bump Gradle to 7.5.1</li>
<li>Bump RCT-Folly to 2021-07-22</li>
<li>Bump Metro to 0.72</li>
<li>Bump SoLoader to 0.10.4</li>
</ul>
<p>You can check out the full list of changes <a href="https://github.com/facebook/react-native/blob/main/CHANGELOG.md" target="_blank" rel="noopener noreferrer">in the changelog</a>.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="acknowledgements">Acknowledgements<a href="https://reactnative.dev/blog/2022/09/05/version-070#acknowledgements" class="hash-link" aria-label="Direct link to Acknowledgements" title="Direct link to Acknowledgements">​</a></h3>
<p>88 contributors with their 493 commits have helped to make this release possible - thanks everyone! We are also thankful to everyone else who gave their feedback to ensure this release would be as stable as possible.</p>]]></content:encoded>
            <category>announcement</category>
            <category>release</category>
        </item>
        <item>
            <title><![CDATA[Hermes as the Default]]></title>
            <link>https://reactnative.dev/blog/2022/07/08/hermes-as-the-default</link>
            <guid>https://reactnative.dev/blog/2022/07/08/hermes-as-the-default</guid>
            <pubDate>Fri, 08 Jul 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[Last October, we announced that we had started work towards making Hermes the default engine for all React Native apps.]]></description>
            <content:encoded><![CDATA[<p>Last October, we <a href="https://reactnative.dev/blog/2021/10/26/toward-hermes-being-the-default">announced</a> that we had started work towards <strong>making</strong> <strong>Hermes the default engine for all React Native apps</strong>.</p>
<p>Hermes has provided a lot of value to React Native inside of Meta, and we believe the open-source community will benefit as well. Hermes is designed for resource constrained devices and optimizes for start up, app size, and memory consumption. One key difference between Hermes and other JS engines is its ability to compile JavaScript source code to bytecode ahead of time. This precompiled bytecode is bundled inside the binary, and saves the interpreter from having to perform this expensive step during app startup.</p>
<p>Since the announcement, a lot of work has gone into making Hermes better, and today, we are excited to share that <strong>React Native 0.70 will ship with Hermes as the default engine.</strong> This means that all new projects starting on v0.70 will have Hermes enabled by default. With the rollout coming up in July, we want to work closely with the community and make sure the transition is smooth and brings value to all users. This blogpost will go over what you can expect from the change, performance benchmarks, new features, and more. Note that you don’t need to wait for React Native 0.70 to start using Hermes - you can <strong>follow <a href="https://reactnative.dev/docs/hermes#enabling-hermes">these instructions</a> to enable Hermes on your existing React Native app</strong>.</p>
<p>Note that while Hermes will be enabled by default in new React Native projects, support for other engines will continue.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="benchmarking">Benchmarking<a href="https://reactnative.dev/blog/2022/07/08/hermes-as-the-default#benchmarking" class="hash-link" aria-label="Direct link to Benchmarking" title="Direct link to Benchmarking">​</a></h2>
<p>We measured three different metrics important to app developers: TTI, binary size, and memory consumption. We used the React Native app <a href="https://github.com/mattermost/mattermost-mobile" target="_blank" rel="noopener noreferrer">Mattermost</a> for testing. We ran these experiments for both Android and iOS on high end hardware from 2020.</p>
<ul>
<li>TTI, or time to interactive, is the duration of time from the app being launched to the user being able to interact with it. For this benchmark, we define it as the time from pressing the app icon to the first screen being rendered. We also show screen recordings of starting up Mattermost.</li>
<li>The binary size was measured as APK size on android and IPA size on iOS.</li>
<li>The memory consumption data was collected by using the Mattermost app over the span of a couple minutes. The same actions were performed in the app on both engines.</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="android-benchmarking-data">Android Benchmarking Data<a href="https://reactnative.dev/blog/2022/07/08/hermes-as-the-default#android-benchmarking-data" class="hash-link" aria-label="Direct link to Android Benchmarking Data" title="Direct link to Android Benchmarking Data">​</a></h2>
<p>All the android tests were performed on a Samsung Galaxy S20.</p>
<figure><img src="https://reactnative.dev/blog/assets/hermes-default-android-data.png" alt="Android Benchmarking Data"></figure>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="tti-video">TTI Video<a href="https://reactnative.dev/blog/2022/07/08/hermes-as-the-default#tti-video" class="hash-link" aria-label="Direct link to TTI Video" title="Direct link to TTI Video">​</a></h3>
<figure><img src="https://reactnative.dev/blog/assets/hermes-default-android-video.gif" alt="Android TTI Video"></figure>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="ios-benchmarking-data">iOS Benchmarking Data<a href="https://reactnative.dev/blog/2022/07/08/hermes-as-the-default#ios-benchmarking-data" class="hash-link" aria-label="Direct link to iOS Benchmarking Data" title="Direct link to iOS Benchmarking Data">​</a></h2>
<p>All the iOS tests were performed on an iPhone 12 Pro.</p>
<figure><img src="https://reactnative.dev/blog/assets/hermes-default-ios-data.png" alt="iOS Benchmarking Data"></figure>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="tti-video-1">TTI Video<a href="https://reactnative.dev/blog/2022/07/08/hermes-as-the-default#tti-video-1" class="hash-link" aria-label="Direct link to TTI Video" title="Direct link to TTI Video">​</a></h3>
<figure><img src="https://reactnative.dev/blog/assets/hermes-default-ios-video.gif" alt="iOS TTI Video"></figure>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="slowed-down-tti-video-to-better-show-the-difference-in-startup-time">Slowed Down TTI Video, to better show the difference in startup time.<a href="https://reactnative.dev/blog/2022/07/08/hermes-as-the-default#slowed-down-tti-video-to-better-show-the-difference-in-startup-time" class="hash-link" aria-label="Direct link to Slowed Down TTI Video, to better show the difference in startup time." title="Direct link to Slowed Down TTI Video, to better show the difference in startup time.">​</a></h3>
<figure><img src="https://reactnative.dev/blog/assets/hermes-default-ios-slow-video.gif" alt="iOS Slowed Down TTI Video"></figure>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="react-nativehermes-integration">React Native/Hermes Integration<a href="https://reactnative.dev/blog/2022/07/08/hermes-as-the-default#react-nativehermes-integration" class="hash-link" aria-label="Direct link to React Native/Hermes Integration" title="Direct link to React Native/Hermes Integration">​</a></h2>
<p>We addressed a long-standing problem that has caused compatibility issues and is a recurrent problem when releasing new React Native versions: React Native depended on Hermes via prebuilt binaries distributed through CocoaPods and npm, which makes it possible to have API or <a href="https://github.com/react-native-community/discussions-and-proposals/issues/257" target="_blank" rel="noopener noreferrer">ABI incompatibilities</a>. To solve this problem, starting on React Native 0.69, Hermes is built alongside every version of React Native. This ensures full compatibility with each version React Native. This also creates a much tighter integration. It unlocks a more rapid iteration time to develop features or deploy bug fixes, and will give us greater confidence in making sure big changes to Hermes are done correctly. There is more in-depth information on the new integration change <a href="https://github.com/facebook/react-native-website/pull/3159/files" target="_blank" rel="noopener noreferrer">here</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="ios-intl">iOS Intl<a href="https://reactnative.dev/blog/2022/07/08/hermes-as-the-default#ios-intl" class="hash-link" aria-label="Direct link to iOS Intl" title="Direct link to iOS Intl">​</a></h2>
<p>We finished the iOS counterpart implementation for <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl" target="_blank" rel="noopener noreferrer"><code>Intl</code></a>, the ECMAScript Internationalization API that provides a broad range of language sensitive functionality. This was a long-standing <a href="https://github.com/facebook/hermes/issues/23" target="_blank" rel="noopener noreferrer">gap</a> that prevented some developers from using Hermes. The Android implementation, done in partnership with Microsoft, was shipped in React Native 0.65. With React Native 0.70, developers will have native support on both platforms.</p>
<p>Typical implementations for <code>Intl</code> require importing large lookup tables or data like <a href="https://cldr.unicode.org/index" target="_blank" rel="noopener noreferrer">Unicode CLDR</a>. However, that can come with an expensive size increase of up to 6MB, so in order to avoid bloating the binary size of Hermes, we implemented <code>Intl</code> by calling into APIs exposed by iOS itself. This means we can take advantage of all the locale and internationalization data that comes with iOS already.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="ongoing-work">Ongoing Work<a href="https://reactnative.dev/blog/2022/07/08/hermes-as-the-default#ongoing-work" class="hash-link" aria-label="Direct link to Ongoing Work" title="Direct link to Ongoing Work">​</a></h2>
<p>As we continue evolving Hermes, we want to give the community a sense of our immediate priorities: improving developer experience and ensuring nobody avoids using Hermes due to lack of JavaScript language features. More specifically, we're:</p>
<ul>
<li>Enabling developers to run the sampling profiler directly from the Chrome devtools UI.</li>
<li>Adding support for <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt" target="_blank" rel="noopener noreferrer"><code>BigInt</code></a>, a long-standing request from the community that may block some developers from using Hermes as it can’t be polyfilled.</li>
<li>Adding support for <a href="https://github.com/facebook/hermes/issues/658" target="_blank" rel="noopener noreferrer"><code>WeakRef</code></a>, which will expose new memory management controls to developers.</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="wrap-up">Wrap Up<a href="https://reactnative.dev/blog/2022/07/08/hermes-as-the-default#wrap-up" class="hash-link" aria-label="Direct link to Wrap Up" title="Direct link to Wrap Up">​</a></h2>
<p>Hermes becoming the default marks the beginning of a long-term journey. We are working on new features that will enable the community to write efficient apps for many years to come. We also encourage the community to reach out on our <a href="https://github.com/facebook/react-native" target="_blank" rel="noopener noreferrer">GitHub Repo</a> to post any bugs, questions, feedback or ideas! We have created a <code>hermes</code> label that can be used for any Hermes-specific posts.</p>]]></content:encoded>
            <category>announcement</category>
            <category>release</category>
        </item>
        <item>
            <title><![CDATA[Announcing React Native 0.69]]></title>
            <link>https://reactnative.dev/blog/2022/06/21/version-069</link>
            <guid>https://reactnative.dev/blog/2022/06/21/version-069</guid>
            <pubDate>Tue, 21 Jun 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[We are excited to release a new version of React Native, 0.69.0. This version comes with several improvements for the New Architecture of React Native and new features: React 18 support & bundled Hermes. Read on to learn more!]]></description>
            <content:encoded><![CDATA[<p>We are excited to release a new version of React Native, 0.69.0. This version comes with several improvements for the New Architecture of React Native and new features: React 18 support &amp; bundled Hermes. Read on to learn more!</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="sections">Sections<a href="https://reactnative.dev/blog/2022/06/21/version-069#sections" class="hash-link" aria-label="Direct link to Sections" title="Direct link to Sections">​</a></h3>
<ul>
<li><a href="https://reactnative.dev/blog/2022/06/21/version-069#react-18">React 18</a></li>
<li><a href="https://reactnative.dev/blog/2022/06/21/version-069#bundled-hermes">Bundled Hermes</a></li>
<li><a href="https://reactnative.dev/blog/2022/06/21/version-069#highlights-of-069">Highlights of 0.69</a></li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="react-18">React 18<a href="https://reactnative.dev/blog/2022/06/21/version-069#react-18" class="hash-link" aria-label="Direct link to React 18" title="Direct link to React 18">​</a></h2>
<p>We are delighted to share with you that React Native 0.69 is the first release to support React 18. React 18 has brought <a href="https://reactjs.org/blog/2022/03/29/react-v18.html" target="_blank" rel="noopener noreferrer">lots of improvements</a>, like new hooks such as <code>useId</code>. Additionally, React 18 includes new concurrency features such as <code>useTransition</code> or full Suspense support.</p>
<p>On React Native 0.69, React 18 is enabled by default. However, if you have not migrated to the New Architecture, you will only be able to leverage the features that don't use concurrent rendering and concurrent features. The New Architecture has been built with concurrent rendering in mind but we cannot add that support for the old architecture.</p>
<p>You can learn more about the React 18 support in React Native <a href="https://reactnative.dev/docs/next/react-18-and-react-native">here</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="bundled-hermes">Bundled Hermes<a href="https://reactnative.dev/blog/2022/06/21/version-069#bundled-hermes" class="hash-link" aria-label="Direct link to Bundled Hermes" title="Direct link to Bundled Hermes">​</a></h2>
<p>Before this release, Hermes and React Native were released separately. That led to confusion on which version of Hermes is compatible with which version of React Native. To remedy this issue, starting with React Native 0.69 we will be shipping a compatible version of Hermes alongside React Native. Making this change will make using Hermes in React Native much more stable.</p>
<p>Using the proper version of Hermes is handled by React Native, however, make sure to follow the steps in the <a href="https://react-native-community.github.io/upgrade-helper/?from=0.68.2&amp;to=0.69.0" target="_blank" rel="noopener noreferrer">upgrade helper</a> to ensure the integration works as intended. If you don't have Hermes enabled already, you can follow the steps <a href="https://reactnative.dev/docs/hermes">here</a> to do so. While we will continue supporting other JavaScript engines, we recommend everyone to migrate to Hermes to have the best experience and to make sure we can support you better.</p>
<p>Note that users on the New Architecture on Android will need to <strong>build Hermes from source</strong>. For building Hermes from source, Windows users will need to additionally follow <a href="https://reactnative.dev/architecture/bundled-hermes#android-users-on-new-architecture-building-on-windows">these steps</a>.</p>
<p>If you are interested to learn more about how React Native bundles Hermes works under the hood, you can check out the deep-dive documentation <a href="https://reactnative.dev/architecture/bundled-hermes">here</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="new-architecture">New Architecture<a href="https://reactnative.dev/blog/2022/06/21/version-069#new-architecture" class="hash-link" aria-label="Direct link to New Architecture" title="Direct link to New Architecture">​</a></h2>
<p>We are continuing the roll-out of the New Architecture for both Android and iOS. If you have not migrated your app or library, yet, follow the steps <a href="https://reactnative.dev/docs/new-architecture-intro">here</a>. You can also read the <a href="https://reactnative.dev/blog/2022/06/16/resources-migrating-your-react-native-library-to-the-new-architecture">latest update</a> on tools and resources for the New Architecture to learn more.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="highlights-of-069">Highlights of 0.69<a href="https://reactnative.dev/blog/2022/06/21/version-069#highlights-of-069" class="hash-link" aria-label="Direct link to Highlights of 0.69" title="Direct link to Highlights of 0.69">​</a></h2>
<p>As mentioned above, the most important improvements in this release are centered around React 18 support and bundled Hermes. However, there have been other notable changes, including:</p>
<ul>
<li><a href="https://github.com/facebook/react-native/commit/982ca30de079d7e80bd0b50365d58b9048fb628f" target="_blank" rel="noopener noreferrer">Deprecating support</a> for iOS/tvOS SDK 11.0, version 12.4+ is now required</li>
<li><a href="https://github.com/facebook/react-native/commit/c5babd993a2bed2994ecc4710fa9e424b3e6cfc2" target="_blank" rel="noopener noreferrer">Better support</a> for M1 users developing for Android</li>
<li><a href="https://github.com/facebook/react-native/commit/0480f56c5b5478b6ebe5ad88e347cad2810bfb17" target="_blank" rel="noopener noreferrer">Addition</a> of the new <code>.xcode.env</code> configuration file for more deterministically sourcing the node executable</li>
<li><a href="https://github.com/facebook/react-native/commit/50c8e973f067d4ef1fc3c2eddd360a0709828968" target="_blank" rel="noopener noreferrer">React Native now uses</a> the latest status bar API from Android 11</li>
<li><a href="https://github.com/facebook/react-native/commit/c2e4ae39b8a5c6534a3fa4dae4130166eda15169" target="_blank" rel="noopener noreferrer">Support for C++17</a></li>
<li><a href="https://github.com/facebook/react-native/commit/1a1a304ed2023d60547aef65b1a7bf56467edf08" target="_blank" rel="noopener noreferrer">New</a> <code>hotkeysEnabled</code> option in the iOS debug menu</li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="breaking-changes">Breaking changes<a href="https://reactnative.dev/blog/2022/06/21/version-069#breaking-changes" class="hash-link" aria-label="Direct link to Breaking changes" title="Direct link to Breaking changes">​</a></h3>
<p>There have also been a few breaking changes:</p>
<ul>
<li>React Native CLI has been bumped to a new major version of <a href="https://github.com/react-native-community/cli/releases/tag/v8.0.0" target="_blank" rel="noopener noreferrer">8.0</a>:<!-- -->
<ul>
<li><code>link</code> and <code>unlink</code> commands have been removed in the favour of autolinking</li>
<li>Deprecated <code>initCompat</code> has been removed, use <code>init</code> command instead</li>
<li>Removed deprecated <code>run-android</code> properties</li>
<li>Removed <code>install</code> and <code>uninstall</code> commands</li>
<li>Removed assets and hooks from <code>react-native.config.js</code> – you'll need to remove these properties from your config</li>
<li><code>podspecPath</code> was removed from the iOS dependency config</li>
<li>Removed <code>--project-path</code> option from a <code>run-ios</code></li>
<li>Changed iOS source directory detection from looking for an Xcode project to looking for a Podfile</li>
</ul>
</li>
<li>Support for <code>console.disableYellowBox</code> <a href="https://github.com/facebook/react-native/commit/b633cc130533f0731b2577123282c4530e4f0abe" target="_blank" rel="noopener noreferrer">has been dropped</a></li>
<li>Already deprecated prop types have been removed (<a href="https://github.com/facebook/react-native/commit/cdfddb4dad7c69904850d7e5f089a32a1d3445d1" target="_blank" rel="noopener noreferrer">cdfddb4dad</a>, <a href="https://github.com/facebook/react-native/commit/3e229f27bc9c7556876ff776abf70147289d544b" target="_blank" rel="noopener noreferrer">3e229f27bc</a>, <a href="https://github.com/facebook/react-native/commit/10199b158138b8645550b5579df87e654213fe42" target="_blank" rel="noopener noreferrer">10199b1581</a>)</li>
<li><code>removeListener</code>, deprecated since RN 0.65, <a href="https://github.com/facebook/react-native/commit/8dfbed786b40082a7a222e00dc0a621c0695697d" target="_blank" rel="noopener noreferrer">was removed</a> from Appearance</li>
<li>If you were using <code>SegmentedComponentIOS</code>, you will now need to replace it with the third-party library, for example <a href="https://github.com/react-native-segmented-control/segmented-control" target="_blank" rel="noopener noreferrer">segmented-control</a> (<a href="https://github.com/facebook/react-native/commit/235f1685748442553e53f8ec6d904bc0314a8ae6" target="_blank" rel="noopener noreferrer">235f168574</a>)</li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="upgrades">Upgrades<a href="https://reactnative.dev/blog/2022/06/21/version-069#upgrades" class="hash-link" aria-label="Direct link to Upgrades" title="Direct link to Upgrades">​</a></h3>
<p>And we upgraded some of our dependencies:</p>
<ul>
<li>Bump <a href="https://github.com/facebook/react-native/commit/200488e87cf4bc355e03c78cd814b97b23452117" target="_blank" rel="noopener noreferrer">of AGP to 7.1.1</a> - we recommend sticking to this version in your apps</li>
<li><code>boost</code> for Android was updated to 1.76 <a href="https://github.com/facebook/react-native/commit/5cd6367f0b86543274a15bb6d0e53a8545fed845" target="_blank" rel="noopener noreferrer">to align with iOS</a></li>
<li>Ruby <a href="https://github.com/facebook/react-native/commit/2c87b7466e098c5cd230e02b279fc7bc7a357615" target="_blank" rel="noopener noreferrer">was bumped to 2.7.5</a></li>
<li>Direct metro dependencies <a href="https://github.com/facebook/react-native/commit/b74e964e705c40834acad7020562e870cdad9db1" target="_blank" rel="noopener noreferrer">have been upgraded</a> to 0.70.1</li>
</ul>
<p>You can check out the full list of changes <a href="https://github.com/facebook/react-native/blob/main/CHANGELOG.md#0690" target="_blank" rel="noopener noreferrer">in the changelog</a>.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="acknowledgements">Acknowledgements<a href="https://reactnative.dev/blog/2022/06/21/version-069#acknowledgements" class="hash-link" aria-label="Direct link to Acknowledgements" title="Direct link to Acknowledgements">​</a></h3>
<p>80 contributors with their 629 commits have helped to make this release possible - thanks everyone!</p>
<p>We are also thankful to the release testers, supporters, and everyone else who gave their feedback to ensure this release will be as stable as possible.</p>]]></content:encoded>
            <category>announcement</category>
            <category>release</category>
        </item>
        <item>
            <title><![CDATA[Helping migrate React Native libraries to the New Architecture]]></title>
            <link>https://reactnative.dev/blog/2022/06/16/resources-migrating-your-react-native-library-to-the-new-architecture</link>
            <guid>https://reactnative.dev/blog/2022/06/16/resources-migrating-your-react-native-library-to-the-new-architecture</guid>
            <pubDate>Thu, 16 Jun 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[tl; dr: We are working on improving the resources supporting the React Native New Architecture. We have already released a repository to help migrate your app (RNNewArchitectureApp) and one for your libraries (RNNewArchitectureLibraries). We are also revamping the New Architecture guide on the Website and we created a GitHub Working Group to answer questions related to the New Architecture.]]></description>
            <content:encoded><![CDATA[<p><strong>tl; dr</strong>: We are working on improving the resources supporting the React Native New Architecture. We have already released a repository to help migrate your app (<a href="https://github.com/react-native-community/RNNewArchitectureApp" target="_blank" rel="noopener noreferrer">RNNewArchitectureApp</a>) and one for your libraries (<a href="https://github.com/react-native-community/RNNewArchitectureLibraries" target="_blank" rel="noopener noreferrer">RNNewArchitectureLibraries</a>). We are also revamping the <a href="https://github.com/facebook/react-native-website/pull/3037" target="_blank" rel="noopener noreferrer">New Architecture guide</a> on the Website and we created a <a href="https://github.com/reactwg/react-native-new-architecture/discussions" target="_blank" rel="noopener noreferrer">GitHub Working Group</a> to answer questions related to the New Architecture.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="introduction">Introduction<a href="https://reactnative.dev/blog/2022/06/16/resources-migrating-your-react-native-library-to-the-new-architecture#introduction" class="hash-link" aria-label="Direct link to Introduction" title="Direct link to Introduction">​</a></h2>
<p>In this post we are sharing an update on tools and resources to help you migrate your <strong>Native Modules</strong> and <strong>Native Components</strong> to their <strong>New Architecture</strong> equivalents, <strong>TurboModule</strong> and <strong>Fabric Components</strong>.</p>
<p>React Native users leverage vast number of open source libraries for building apps. For a complete and consistent ecosystem, it is necessary that these libraries migrate such that everyone can benefit from the unlocked capabilities and performance improvements of the New Architecture.</p>
<p>Here is what we’re working on to support library developers in migrating to the New Architecture:</p>
<ul>
<li><strong>Documentation:</strong> We are expanding the <a href="https://github.com/facebook/react-native-website/pull/3037" target="_blank" rel="noopener noreferrer">New Architecture guide</a> on the website to cover more concepts of the New Architecture and how to develop your components.</li>
<li><strong>Example Migrations:</strong> We’ve set up two repositories to demonstrate how to migrate a React Native app to the New Architecture (<a href="https://github.com/react-native-community/RNNewArchitectureApp" target="_blank" rel="noopener noreferrer">RNNewArchitectureApp</a>) and how to create a <strong>Fabric Component</strong> and a <strong>TurboModule</strong> that work with both architectures (<a href="https://github.com/react-native-community/RNNewArchitectureLibraries" target="_blank" rel="noopener noreferrer">RNNewArchitectureLibraries</a>).</li>
<li><strong>Support:</strong> Earlier this year, we created a <a href="https://github.com/reactwg/react-native-new-architecture/discussions" target="_blank" rel="noopener noreferrer">GitHub Working Group</a> dedicated to discussion and questions around the New Architecture.</li>
</ul>
<p>In this post, we will dig deeper into these resources and explain in more detail how you can use them most efficiently. Finally, we will provide a snapshot of the current migration state for the most used React Native libraries.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="documentation">Documentation<a href="https://reactnative.dev/blog/2022/06/16/resources-migrating-your-react-native-library-to-the-new-architecture#documentation" class="hash-link" aria-label="Direct link to Documentation" title="Direct link to Documentation">​</a></h3>
<p>In the past 6 months, we’ve added a <a href="https://reactnative.dev/docs/new-architecture-intro">guide on adopting the New Architecture</a> and an <a href="https://reactnative.dev/architecture/overview">architecture deep-dive</a> on Fabric. We plan to expand this to include more guides and documentation around creating TurboModules, understanding CodeGen, and more. We plan to have updates to share by the 0.70 release.</p>
<p>Currently, the <strong>New Architecture</strong> guide covers how to <a href="https://reactnative.dev/docs/new-architecture-app-intro">migrate your app</a> and <a href="https://reactnative.dev/docs/new-architecture-library-intro">your libraries</a> to support the New Architecture properly.</p>
<p>If you are interested in the evolution of this guide, or have feedback, you can follow along on <a href="https://github.com/facebook/react-native-website/pull/3037" target="_blank" rel="noopener noreferrer">this</a> pull request.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="example-migrations">Example Migrations<a href="https://reactnative.dev/blog/2022/06/16/resources-migrating-your-react-native-library-to-the-new-architecture#example-migrations" class="hash-link" aria-label="Direct link to Example Migrations" title="Direct link to Example Migrations">​</a></h3>
<p>For developers who may want to follow along in code, we’ve prepared two example repositories.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="rnnewarchitectureapp">RNNewArchitectureApp<a href="https://reactnative.dev/blog/2022/06/16/resources-migrating-your-react-native-library-to-the-new-architecture#rnnewarchitectureapp" class="hash-link" aria-label="Direct link to RNNewArchitectureApp" title="Direct link to RNNewArchitectureApp">​</a></h4>
<p><a href="https://github.com/react-native-community/RNNewArchitectureApp" target="_blank" rel="noopener noreferrer">This repo</a> was created to demonstrate how to migrate an app, the native modules and the native components from the legacy architecture on the React Native version 0.67 to the New Architecture and the most recent version of React Native. Each commit corresponds to an isolated migration step.</p>
<figure><img src="https://reactnative.dev/blog/assets/new-arch-example-steps-to-migrate-an-app.png" alt="Example steps to migrate an app"><figcaption>Commit list for a migration in the RNNewArchitectureApp repository</figcaption></figure>
<p>The repo is organized as follows:</p>
<ul>
<li>A <strong>main</strong> branch has no code but a README.md which advertises other branches.</li>
<li>Several migration branches which show a migration from a specific version of RN to another.</li>
</ul>
<p>Some of the migration branches also have a <strong>RUN.md</strong> file which describes in a more human-readable fashion the exact steps that have been applied in every commit.</p>
<p>We plan to keep this example up to date with the most recent stable releases, adding migrations to any minor release of React Native we are going to release. If you notice issue with any of the steps, please file an issue in the repository. This will hold until we have the reasonable feeling that most of the React Native users have migrated to the New Architecture.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="rnnewarchitecturelibraries">RNNewArchitectureLibraries<a href="https://reactnative.dev/blog/2022/06/16/resources-migrating-your-react-native-library-to-the-new-architecture#rnnewarchitecturelibraries" class="hash-link" aria-label="Direct link to RNNewArchitectureLibraries" title="Direct link to RNNewArchitectureLibraries">​</a></h4>
<p>Similarly, <a href="https://github.com/react-native-community/RNNewArchitectureLibraries" target="_blank" rel="noopener noreferrer">this repo</a> provides a step-by-step guide on how to create a <strong>TurboModule</strong> and a <strong>Fabric Component</strong>. It has a focus on ensuring backward compatibility between the New Architecture and the legacy one.</p>
<p>The repository is organized in a similar way to the previous one:</p>
<ul>
<li>A <strong>main</strong> branch has no code but a README.md which advertises other branches.</li>
<li>Other branches to show how to develop <strong>TurboModules</strong> and <strong>Fabric Components</strong>.</li>
</ul>
<p>We plan to keep this example updated onto new releases of React Native, especially releases that affect library development, as well as add more examples on how to use advanced features (for example: implementing commands, event emitters, custom state). If you notice errors, please file an issue in the example repository.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="support">Support<a href="https://reactnative.dev/blog/2022/06/16/resources-migrating-your-react-native-library-to-the-new-architecture#support" class="hash-link" aria-label="Direct link to Support" title="Direct link to Support">​</a></h3>
<p>We’ve created a dedicated <a href="https://github.com/reactwg/react-native-new-architecture" target="_blank" rel="noopener noreferrer">working group</a> to give the community space to ask questions and get updates on the New Architecture. If you are a library maintainer, this is a valuable resource to find answers to your questions, and for us to know about your requirements. To join, please follow <a href="https://github.com/reactwg/react-native-new-architecture#how-to-join-the-working-group" target="_blank" rel="noopener noreferrer">these instructions</a>. Everyone is welcome.</p>
<p>The working group is organized into several sections:</p>
<ul>
<li><a href="https://github.com/reactwg/react-native-new-architecture/discussions/categories/announcements" target="_blank" rel="noopener noreferrer">Announcements</a>: A place to share milestones and significant updates on the RN New Architecture Rollout</li>
<li><a href="https://github.com/reactwg/react-native-new-architecture/discussions/categories/deep-dive" target="_blank" rel="noopener noreferrer">Deep Dive</a>: A place to chat about deep dives and technical-specific topics</li>
<li><a href="https://github.com/reactwg/react-native-new-architecture/discussions/categories/documentation" target="_blank" rel="noopener noreferrer">Documentation</a>: A place to chat about the New Architecture documentation and migration material</li>
<li><a href="https://github.com/reactwg/react-native-new-architecture/discussions/categories/libraries" target="_blank" rel="noopener noreferrer">Libraries</a>: A place to chat about 3rd party libraries and their migration story to the New Architecture</li>
<li><a href="https://github.com/reactwg/react-native-new-architecture/discussions/categories/q-a" target="_blank" rel="noopener noreferrer">Q&amp;A</a>: A place to ask the community for help on the New Architecture topics</li>
<li><a href="https://github.com/reactwg/react-native-new-architecture/discussions/categories/releases" target="_blank" rel="noopener noreferrer">Releases</a>: A place to chat about release specific bugs &amp; build problems</li>
</ul>
<p>To use this group effectively:</p>
<ul>
<li><strong>Make sure your library is listed inside the <a href="https://github.com/reactwg/react-native-new-architecture/discussions/categories/libraries" target="_blank" rel="noopener noreferrer">Libraries</a> section</strong>. This will help us share a status update on the migration of your library and will help us understand which struggles library authors are facing to support you better.</li>
<li><strong>Leverage the Q&amp;A <a href="https://github.com/reactwg/react-native-new-architecture/discussions/categories/q-a" target="_blank" rel="noopener noreferrer">section</a> if you face a blocker and need support</strong>. Our team and community experts are monitoring and will support at our best effort.</li>
<li><strong>Keep an eye on the other sections for topics that may affect you</strong>. A new release may introduce exactly the API that you were looking for. You can subscribe to particular discussions via GitHub.</li>
</ul>
<p>We plan to support this group until the <strong>New Architecture</strong> is enabled by default and all the major libraries have been migrated to it.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="migration-status-of-popular-libraries">Migration Status of Popular Libraries<a href="https://reactnative.dev/blog/2022/06/16/resources-migrating-your-react-native-library-to-the-new-architecture#migration-status-of-popular-libraries" class="hash-link" aria-label="Direct link to Migration Status of Popular Libraries" title="Direct link to Migration Status of Popular Libraries">​</a></h3>
<p>Libraries maintainers have been sharing with us <a href="https://github.com/reactwg/react-native-new-architecture/discussions/categories/libraries" target="_blank" rel="noopener noreferrer">in the working group</a> the status of their migration effort, and we wanted to provide you with a quick overview:</p>
<ul>
<li><a href="https://github.com/reactwg/react-native-new-architecture/discussions/15" target="_blank" rel="noopener noreferrer">react-native-gesture-handler</a>: ✅ Migrated</li>
<li><a href="https://github.com/reactwg/react-native-new-architecture/discussions/17" target="_blank" rel="noopener noreferrer">react-native-navigation</a>: 🏃‍♂️ Ongoing</li>
<li><a href="https://github.com/reactwg/react-native-new-architecture/discussions/16" target="_blank" rel="noopener noreferrer">react-native-pager-view</a>: 🏃‍♂️ Ongoing</li>
<li><a href="https://github.com/reactwg/react-native-new-architecture/discussions/14" target="_blank" rel="noopener noreferrer">react-native-reanimated</a>: ✅ Migrated. In the process of testing and profiling for performances</li>
<li><a href="https://github.com/reactwg/react-native-new-architecture/discussions/13" target="_blank" rel="noopener noreferrer">react-native-screens</a>: 🏃‍♂️ Ongoing</li>
<li><a href="https://github.com/reactwg/react-native-new-architecture/discussions/38" target="_blank" rel="noopener noreferrer">react-native-slider</a>: 🎬 Started</li>
<li><a href="https://github.com/reactwg/react-native-new-architecture/discussions/21" target="_blank" rel="noopener noreferrer">react-native-template-new-architecture</a>: ✅ Migrated. Gradually adopting/testing more companion Libraries</li>
<li><a href="https://github.com/reactwg/react-native-new-architecture/discussions/22" target="_blank" rel="noopener noreferrer">react-native-template-typescript</a>: ✅ Migrated</li>
<li><a href="https://github.com/reactwg/react-native-new-architecture/discussions/19" target="_blank" rel="noopener noreferrer">react-native-webview</a>: 🎬 Started</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="next-steps">Next Steps<a href="https://reactnative.dev/blog/2022/06/16/resources-migrating-your-react-native-library-to-the-new-architecture#next-steps" class="hash-link" aria-label="Direct link to Next Steps" title="Direct link to Next Steps">​</a></h2>
<p>We are invested in supporting the React Native community’s adoption of the New Architecture. Concretely, we will continue to:</p>
<ul>
<li>Offer best-effort support in the <strong>Working Group.</strong></li>
<li>Provide more examples about how to achieve amazing results with the New Architecture in the <strong>RNNewArchitecture</strong> repositories.</li>
<li>Provide clear and up-to-date documentation on the <strong>New Architecture</strong>.</li>
<li>Track the migration status of essential React Native libraries in the <strong>Working Group</strong>.</li>
<li>Simplify the migration path for developers</li>
</ul>
<p>In addition, React Native 0.69 will ship with improved devX for app and library developers for New Architecture adoption. You can find more information about the 0.69.0 release <a href="https://github.com/reactwg/react-native-releases/discussions/21" target="_blank" rel="noopener noreferrer">here</a>.</p>
<p>We are excited about what we will build together with the <strong>New Architecture</strong>!</p>]]></content:encoded>
            <category>announcement</category>
        </item>
        <item>
            <title><![CDATA[React Native Accessibility - GAAD 2022 Update]]></title>
            <link>https://reactnative.dev/blog/2022/05/19/GAAD-2022-update</link>
            <guid>https://reactnative.dev/blog/2022/05/19/GAAD-2022-update</guid>
            <pubDate>Thu, 19 May 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[May 19th, 2022 marks the 11th annual celebration of Global Accessibility Awareness Day and we wanted to update everyone on the accessibility progress we’ve made on the React Native Framework. Meta (formerly Facebook) was the first organization to take the GAAD pledge in 2020, committing to making the React Native framework accessible.]]></description>
            <content:encoded><![CDATA[<p>May 19th, 2022 marks the 11th annual celebration of Global Accessibility Awareness Day and we wanted to update everyone on the accessibility progress we’ve made on the React Native Framework. Meta (formerly Facebook) was the <a href="https://reactnative.dev/blog/2021/03/08/GAAD-React-Native-Accessibility">first organization to take the GAAD pledge in 2020</a>, committing to making the React Native framework accessible.</p>
<blockquote>
<p><em>“We hope this pledge makes it easier for developers using React Native to create fully accessible mobile apps and inspires other organizations to make similar commitments to a more accessible future.”</em></p>
<p>— <a href="https://gaad.foundation/gaadpledge/" target="_blank" rel="noopener noreferrer">Mike Shebanek, head of accessibility Meta, 2020</a></p>
</blockquote>
<p>The process initially began with a thorough review and gap analysis of the framework focused on React Native utilized the iOS and Android APIs to support accessibility features. Dozens of issues have since been fixed or closed out, making good on the pledge to make React Native accessible and advancing the accessibility of the framework ever forward.</p>
<p>We didn’t stop there, and in early 2022, we reviewed and prioritized the remaining issues from this gap analysis on the <a href="https://github.com/facebook/react-native/projects/15" target="_blank" rel="noopener noreferrer">Improved React Native Accessibility Board</a> based on their impact on developers and end users.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="fixes-that-have-already-landed-in-2022">Fixes that have already landed in 2022<a href="https://reactnative.dev/blog/2022/05/19/GAAD-2022-update#fixes-that-have-already-landed-in-2022" class="hash-link" aria-label="Direct link to Fixes that have already landed in 2022" title="Direct link to Fixes that have already landed in 2022">​</a></h2>
<ul>
<li><a href="https://github.com/facebook/react-native/issues/30840" target="_blank" rel="noopener noreferrer">Android: Disabled state not announced/disabled functionality not applied for some components</a></li>
<li><a href="https://github.com/facebook/react-native/issues/30977" target="_blank" rel="noopener noreferrer">Android: Position in collection not supported by some components</a></li>
<li><a href="https://github.com/facebook/react-native/pull/31757" target="_blank" rel="noopener noreferrer">Android: Make links independently focusable by Talkback</a></li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="fixes-currently-in-progress">Fixes currently in progress<a href="https://reactnative.dev/blog/2022/05/19/GAAD-2022-update#fixes-currently-in-progress" class="hash-link" aria-label="Direct link to Fixes currently in progress" title="Direct link to Fixes currently in progress">​</a></h2>
<ul>
<li><a href="https://github.com/facebook/react-native/issues/30848" target="_blank" rel="noopener noreferrer">iOS/Android: Text input error announcement</a></li>
<li><a href="https://github.com/facebook/react-native/issues/30859" target="_blank" rel="noopener noreferrer">Android: Form field error state announcement</a></li>
<li><a href="https://github.com/facebook/react-native/issues/31042" target="_blank" rel="noopener noreferrer">Android: Role description is announced before the components text, rather than after</a></li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="contributor-highlight">Contributor highlight<a href="https://reactnative.dev/blog/2022/05/19/GAAD-2022-update#contributor-highlight" class="hash-link" aria-label="Direct link to Contributor highlight" title="Direct link to Contributor highlight">​</a></h2>
<p>We want to recognize and send a tremendous thank you to <a href="https://github.com/fabriziobertoglio1987" target="_blank" rel="noopener noreferrer">Fabrizo Bertoglio</a> who has contributed several high-quality accessibility fixes to React Native in 2021 and 2022.</p>
<p>Fabrizio has made it a personal goal to enable users through high quality solutions. By learning how to use TalkBack and VoiceOver himself, he has discovered how difficult it can be for screen reader users to experience everyday applications. He wants to build software that removes friction from these experiences and please disabled users.</p>
<p>His pull requests have been very high quality, well documented, and include thorough test cases. Well done Fabrizio! The React Native Accessibility community thanks you for your many outstanding contributions.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="whats-next-in-2022">What’s next in 2022<a href="https://reactnative.dev/blog/2022/05/19/GAAD-2022-update#whats-next-in-2022" class="hash-link" aria-label="Direct link to What’s next in 2022" title="Direct link to What’s next in 2022">​</a></h2>
<p>Our goal is to fix as many of the remaining accessibility issues as possible in 2022. We will also be reviewing the backlog of <a href="https://github.com/facebook/react-native/issues" target="_blank" rel="noopener noreferrer">React Native community reported issues</a> to look for any new accessibility-related requests.</p>]]></content:encoded>
            <category>announcement</category>
        </item>
        <item>
            <title><![CDATA[Announcing React Native 0.68]]></title>
            <link>https://reactnative.dev/blog/2022/03/30/version-068</link>
            <guid>https://reactnative.dev/blog/2022/03/30/version-068</guid>
            <pubDate>Wed, 30 Mar 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[Hello everyone! Today we are announcing the 0.68.0 release of React Native, with opt-in to the New React Native Architecture, bug fixes and more.]]></description>
            <content:encoded><![CDATA[<p>Hello everyone! Today we are announcing the 0.68.0 release of React Native, with opt-in to the New React Native Architecture, bug fixes and more.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="sections">Sections<a href="https://reactnative.dev/blog/2022/03/30/version-068#sections" class="hash-link" aria-label="Direct link to Sections" title="Direct link to Sections">​</a></h3>
<ul>
<li><a href="https://reactnative.dev/blog/2022/03/30/version-068#highlights-of-068">Highlights of 0.68</a></li>
<li><a href="https://reactnative.dev/blog/2022/03/30/version-068#opting-in-to-the-new-architecture">Opting in to the New Architecture</a></li>
<li><a href="https://reactnative.dev/blog/2022/03/30/version-068#website-updates">Website updates</a></li>
<li><a href="https://reactnative.dev/blog/2022/03/30/version-068#interested-in-helping-react-native-stabilize-new-releases">Interested in helping React Native stabilise new releases?</a></li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="highlights-of-068">Highlights of 0.68<a href="https://reactnative.dev/blog/2022/03/30/version-068#highlights-of-068" class="hash-link" aria-label="Direct link to Highlights of 0.68" title="Direct link to Highlights of 0.68">​</a></h2>
<p><a href="https://twitter.com/Andrei_Calazans" target="_blank" rel="noopener noreferrer">Andrei Calazans</a> helped us selecting the most relevant changes that 0.68 brings along:</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="breaking-changes-and-version-bumps">Breaking changes and version bumps<a href="https://reactnative.dev/blog/2022/03/30/version-068#breaking-changes-and-version-bumps" class="hash-link" aria-label="Direct link to Breaking changes and version bumps" title="Direct link to Breaking changes and version bumps">​</a></h3>
<p>This version brings along a few breaking changes:</p>
<ul>
<li>React Native has been updated to Node 16, the latest LTS. Since on CI we test for LTS and the previous LTS, this change means that users are now required to use a version of Node &gt;= 14.</li>
<li>Android Gradle Plugin was updated to 7.0.1, enforcing JDK 11 for Android builds, so make sure to upgrade your configurations (we recommend you use the <code>zulu11</code> JDK flavor for both Intel and M1 Macs)</li>
<li>Removed <code>fallbackResource</code> from <code>RCTBundleURLProvider</code> API on iOS. This parameter can be safely removed from the method call without replacement.</li>
</ul>
<p>Tooling has also been updated - here are the main bumps:</p>
<ul>
<li>@react-native-community/cli to 7.0.3</li>
<li>Metro to 0.67</li>
<li>react-devtools-core dependency to 4.23.0</li>
<li>Flipper to 0.125.0</li>
<li>react-native-codegen to 0.0.9</li>
<li>Kotlin to 1.6.10</li>
<li>Soloader to 0.10.3</li>
<li>Gradle to 7.3</li>
<li>Android compile and target SDK to 31</li>
</ul>
<p>Also, thanks to <a href="https://github.com/facebook/react-native/commit/bd7caa64f5d6ee5ea9484e92c3629c9ce711f73c" target="_blank" rel="noopener noreferrer">this commit</a> by <a href="https://github.com/cortinico" target="_blank" rel="noopener noreferrer">Nicola Corti</a> the Android Gradle Plugin will download the default version of NDK by itself, so you don’t have to specify and install it separately anymore.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="other-improvements">Other improvements<a href="https://reactnative.dev/blog/2022/03/30/version-068#other-improvements" class="hash-link" aria-label="Direct link to Other improvements" title="Direct link to Other improvements">​</a></h3>
<p>There are a lot of other changes and fixes landed in this release, but here’s a small selection that you might be interested in:</p>
<ul>
<li><a href="https://github.com/GijsWeterings" target="_blank" rel="noopener noreferrer">Gijs Weterings</a> <a href="https://github.com/facebook/react-native/commit/5050e7eaa17cb417baf7c20eb5c4406cce6790a5" target="_blank" rel="noopener noreferrer">fixed Forwarding testID to RCTModalHostView</a> for easier E2E targeting of Modals.</li>
<li><a href="https://github.com/liamjones" target="_blank" rel="noopener noreferrer">Liam Jones</a> <a href="https://github.com/facebook/react-native/commit/9d2df5b8ae9" target="_blank" rel="noopener noreferrer">fixed an issue</a> where calling <code>console.error</code> caused the RedBox to appear alongside the LogBox.</li>
<li><a href="https://github.com/samkline" target="_blank" rel="noopener noreferrer">Sam Kline</a> <a href="https://github.com/facebook/react-native/commit/c8d823b9bd9619dfa1f5851af003cc24ba2e8830" target="_blank" rel="noopener noreferrer">fixed the empty blank screen</a> after a BundleDownloader failure in dev mode on Android.</li>
<li><a href="https://github.com/JeffreyHyer" target="_blank" rel="noopener noreferrer">Jeffrey Hyer</a> <a href="https://github.com/facebook/react-native/commit/9c5e177a79c" target="_blank" rel="noopener noreferrer">fixed an issue</a> where the KeyboardAvoidingView didn't work as expected with the <code>onLayout</code> prop.</li>
</ul>
<p>If you are interested in the full list of changes, you can read it in the changelog <a href="https://github.com/facebook/react-native/blob/main/CHANGELOG.md#0680" target="_blank" rel="noopener noreferrer">at the link here</a>.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="acknowledgements">Acknowledgements<a href="https://reactnative.dev/blog/2022/03/30/version-068#acknowledgements" class="hash-link" aria-label="Direct link to Acknowledgements" title="Direct link to Acknowledgements">​</a></h3>
<p>This release includes 614 commits by 68 contributors! Thank you all!</p>
<p>We wanted to also thank the release testers and supporters who helped us catch regressions before the stable 0.68.0 release: you are incredibly valuable to the success of this release!</p>
<p>If you, your app or your company is interested in joining the “Release Tester” program, you can <a href="https://forms.gle/fPuPE1MZRDGWNqpd6" target="_blank" rel="noopener noreferrer">sign up here</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="opting-in-to-the-new-architecture">Opting in to the New Architecture<a href="https://reactnative.dev/blog/2022/03/30/version-068#opting-in-to-the-new-architecture" class="hash-link" aria-label="Direct link to Opting in to the New Architecture" title="Direct link to Opting in to the New Architecture">​</a></h2>
<p>As briefly mentioned above, React Native 0.68 is the first version with opt-in support for the Fabric Renderer and the TurboModule system. This marks a crucial milestone for the rollout of the New React Native Architecture. To help you get up to speed with the changes, we added <a href="https://reactnative.dev/architecture/overview">the Architecture section</a> to the website, where you can find several in-depth guides about internals of the new systems.</p>
<p>At the same time, we added the <a href="https://reactnative.dev/docs/next/new-architecture-intro">migration guide</a> to the documentation and launched <a href="https://github.com/reactwg/react-native-new-architecture" target="_blank" rel="noopener noreferrer">a working group</a> dedicated to the New Architecture. You can find more information, including how to opt in, in <a href="https://reactnative.dev/blog/2022/03/15/an-update-on-the-new-architecture-rollout">the previous blog post</a>.</p>
<p>Please note that the New Architecture still needs some fine tuning. Some of the third-party libraries that you depend on might not be migrated yet, and you may encounter issues that we haven’t discovered yet. If you do so, please report them to our <a href="https://github.com/reactwg/react-native-new-architecture" target="_blank" rel="noopener noreferrer">New Architecture Working Group</a>.</p>
<p><strong>About React 18:</strong> React 18's new rendering engine is not supported by React Native 0.68, this will happen in a future version. This is because React 18 relies on the New Architecture to benefit from the new capabilities presented in <a href="https://reactjs.org/blog/2022/03/29/react-v18.html" target="_blank" rel="noopener noreferrer">the React 18 announcement blog post</a>. For more information, see the <a href="https://www.youtube.com/watch?v=FZ0cG47msEk&amp;t=1530s" target="_blank" rel="noopener noreferrer">React Conf keynote here</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="website-updates">Website updates<a href="https://reactnative.dev/blog/2022/03/30/version-068#website-updates" class="hash-link" aria-label="Direct link to Website updates" title="Direct link to Website updates">​</a></h2>
<p>Along with improvements to the main codebase, with the help of <a href="https://github.com/Simek" target="_blank" rel="noopener noreferrer">Simek</a>, <a href="https://github.com/Megatron4537" target="_blank" rel="noopener noreferrer">Megatron4537</a> and <a href="https://github.com/slorber" target="_blank" rel="noopener noreferrer">slorber</a> there have been quite a few improvements landing on the website too! In particular, you will now be able to learn how to contribute to React Native via the new section in the top toolbar.
Moreover, the “Contributing” section and the new “Architecture” section are now unversioned — there is now only one copy of these sections, rather than one for each React Native version.</p>]]></content:encoded>
            <category>announcement</category>
            <category>release</category>
        </item>
        <item>
            <title><![CDATA[An update on the New Architecture Rollout]]></title>
            <link>https://reactnative.dev/blog/2022/03/15/an-update-on-the-new-architecture-rollout</link>
            <guid>https://reactnative.dev/blog/2022/03/15/an-update-on-the-new-architecture-rollout</guid>
            <pubDate>Tue, 15 Mar 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[Hi everyone,]]></description>
            <content:encoded><![CDATA[<p>Hi everyone,
<a href="https://reactnative.dev/blog/2022/01/21/react-native-h2-2021-recap#the-new-architecture-rollout-and-releases">As previously announced</a>:</p>
<blockquote>
<p>2022 is going to be the year of the New Architecture in open source</p>
</blockquote>
<p>If you still haven’t had the time to look into the New React Native Architecture (the Fabric Renderer and the TurboModule system), there is no better time to do it <strong>than now</strong>!</p>
<p>We would like to share with the community some initiatives and material we prepared to make sure everyone is onboard on this endeavor.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="the-working-group">The Working Group<a href="https://reactnative.dev/blog/2022/03/15/an-update-on-the-new-architecture-rollout#the-working-group" class="hash-link" aria-label="Direct link to The Working Group" title="Direct link to The Working Group">​</a></h3>
<p>Recently, we launched the <a href="https://github.com/reactwg/react-native-new-architecture" target="_blank" rel="noopener noreferrer">React Native New Architecture Working Group</a> on GitHub, a <em>discussion only</em> repository to coordinate and support the rollout of the New Architecture across the ecosystem.</p>
<p>We envision this working group as a space where the community can <strong>meet</strong>, share <strong>ideas</strong>, and <strong>discuss</strong> challenges during the adoption of the New Architecture. Moreover, we're going to use this working group to <strong>share</strong> information and updates with the wider community for the sake of transparency.</p>
<p>To keep the discussion focused, we decided to have this working group <strong>open to read</strong> publicly and <strong>restricted to write</strong> only for approved users.</p>
<p>If you wish to join the conversation, you can <a href="https://forms.gle/8emgdwFZXuzEpyyn9" target="_blank" rel="noopener noreferrer">fill in this form</a> to either <strong>apply or nominate</strong> someone that you think would be a valuable addition to the discussion.</p>
<p><strong>Everyone is welcome</strong> to apply to join the conversation.</p>
<p>As every discussion forum, we would like to stress once more the importance of being <strong>respectful</strong> and welcoming towards others’ opinions. Please take the chance to read our <a href="https://github.com/reactwg/react-native-new-architecture/blob/main/CODE_OF_CONDUCT.md" target="_blank" rel="noopener noreferrer"><strong>code of conduct</strong></a> if you haven’t yet done it.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="the-migration-guide">The Migration Guide<a href="https://reactnative.dev/blog/2022/03/15/an-update-on-the-new-architecture-rollout#the-migration-guide" class="hash-link" aria-label="Direct link to The Migration Guide" title="Direct link to The Migration Guide">​</a></h3>
<p>After several rounds of review &amp; feedback, we finally merged <strong>the Migration Guide</strong> (f.k.a. <em>the Playbook</em>). You can find it <a href="https://reactnative.dev/docs/next/new-architecture-intro">on the website in the Guides section.</a></p>
<p>This Migration Guide will show you <strong>how to create a custom Fabric component or a TurboModule</strong> with a step-by-step approach. The guide will also show you how to <strong>adapt your existing app or library</strong> to use the New Architecture.</p>
<p>Moreover, we would like to remind you the brand-new <a href="https://reactnative.dev/architecture/overview">Architecture section</a> of our website. There you can find several in-depth articles and explanation of the React Native internals. Specifically, <a href="https://reactnative.dev/architecture/fabric-renderer">the Fabric section</a> can help you understand the rendering pipeline in the New Architecture world.</p>
<p>Finally, please consider <strong>sharing your feedback</strong> to this documentation material <a href="https://github.com/reactwg/react-native-new-architecture/discussions/7" target="_blank" rel="noopener noreferrer">on the working group</a>. We’re constantly looking for developer’s opinion, and we want to make sure we’re delivering the content that you find most useful.</p>
<p>Over the next months, we will look into refining and adding more documentation to help you further.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="the-new-architecture-template">The New Architecture Template<a href="https://reactnative.dev/blog/2022/03/15/an-update-on-the-new-architecture-rollout#the-new-architecture-template" class="hash-link" aria-label="Direct link to The New Architecture Template" title="Direct link to The New Architecture Template">​</a></h3>
<p>React Native <strong>0.68.0</strong> is close to release. This version of React Native marks a crucial milestone in the New Architecture Rollout as it’s the first version to include an <strong>opt-in switch</strong> in the <strong>new app template.</strong></p>
<p>This means that you will be able to try the New Architecture <strong>by changing one line</strong> in the template. We also added extensive <strong>comments and documentation</strong> to the template to make sure you don’t need extra reading to use it out of the box. We hope this will help you adopt the New Architecture by <strong>reducing the amount of code</strong> your have to write.</p>
<p>In the next releases, we will keep on updating the template to make it even more streamlined and simple to use.</p>
<p>To enable the New Architecture on either platform, you can:</p>
<ul>
<li>On iOS, run <code>RCT_NEW_ARCH_ENABLED=1 bundle exec pod install</code> inside the <code>ios</code> folder.</li>
<li>On Android, set the <code>newArchEnabled</code> property to <code>true</code> by <strong>either</strong>:<!-- -->
<ul>
<li>Changing the corresponding line inside the <code>android/gradle.properties</code> file.</li>
<li>Set an environment variable <code>ORG_GRADLE_PROJECT_newArchEnabled=true</code></li>
<li>Invoke Gradle with <code>-PnewArchEnabled=true</code></li>
</ul>
</li>
</ul>
<p>Then you can <strong>run your app</strong> with <code>yarn react-native run-android</code> or <code>run-ios</code> and you’ll be running using Fabric and TurboModules enabled.</p>
<p>Please consider trying this new template, and <a href="https://github.com/reactwg/react-native-new-architecture/discussions/5" target="_blank" rel="noopener noreferrer">report any bug or unexpected behavior</a> that you might face. Over the last months we worked hard to fix bugs and build failures that would have been <strong>hard to catch</strong> without the constant community feedback and testing.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="the-3rd-party-libraries-ecosystem">The 3rd-party Libraries Ecosystem<a href="https://reactnative.dev/blog/2022/03/15/an-update-on-the-new-architecture-rollout#the-3rd-party-libraries-ecosystem" class="hash-link" aria-label="Direct link to The 3rd-party Libraries Ecosystem" title="Direct link to The 3rd-party Libraries Ecosystem">​</a></h3>
<p>The community won't be able to migrate to the New Architecture without the full support of <strong>3rd-party libraries author &amp; maintainers</strong>.</p>
<p>We understand how this can be a tedious process, and we understand the importance of supporting users on <strong>both</strong> old and New Architecture. Over the next months, we will focus on supporting our library developers to help them migrate over.</p>
<p>If you’re a <strong>library developer</strong>, <a href="https://github.com/reactwg/react-native-new-architecture/discussions/categories/libraries" target="_blank" rel="noopener noreferrer">we invite you to post an update</a> in the New Architecture working group with the <strong>status of your libraries</strong>. This will help you attract early adopters and us to understand if any library is facing a blocker.</p>
<p>If instead you’re a <strong>library user</strong>, you can <a href="https://github.com/reactwg/react-native-new-architecture/discussions/6" target="_blank" rel="noopener noreferrer">post a message here</a> to request a migration of a library. If we identify a library that becomes a blocker for a number of users, we will try to reach out to the maintainer and understand why they haven’t migrated yet.</p>
<p>Finally, we would like to give a shout out to Software Mansion for releasing a new version of <a href="https://github.com/software-mansion/react-native-screens" target="_blank" rel="noopener noreferrer"><code>react-native-screens</code></a>, which has support for both architectures. Moreover, they published a blog-post (<a href="https://blog.swmansion.com/introducing-fabric-to-react-native-screens-fd17bf18858e" target="_blank" rel="noopener noreferrer">Introducing Fabric to react-native-screens</a>) where they <strong>tell their migration story</strong>. We hope you will find this story inspiring and useful to tackle your migration.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="releases">Releases<a href="https://reactnative.dev/blog/2022/03/15/an-update-on-the-new-architecture-rollout#releases" class="hash-link" aria-label="Direct link to Releases" title="Direct link to Releases">​</a></h3>
<p>Work on the 0.68 pre-release has realized much of <a href="https://reactnative.dev/blog/2022/01/19/version-067#improvements-to-release-process">the improved release process we had defined last half</a>.</p>
<p>We’re happy to share that with 0.68 we were able to:</p>
<ul>
<li>Successfully onboard release work to an internal rotation. Much of this is supported by <a href="https://reactnative.dev/contributing/overview">improved documentation</a> on the release process which will reduce the bus factor of the release process.</li>
<li>Initiated discussions with partners to support a <a href="https://reactnative.dev/contributing/release-roles-responsibilities#release-role-2--release-copilot">Copilot rotation</a>. We hope this effort will improve transparency of the process and inform our partners where to invest to support React Native releases and eco-system.</li>
<li><a href="https://github.com/reactwg/react-native-releases/discussions/11" target="_blank" rel="noopener noreferrer">Onboarded several Release Supporters and Testers from the community</a>. We had put a call-out for help last half and so many folks stepped up! The feedback from our testers and supporters have <strong>helped us fix crucial bugs</strong> and regressions, especially around the new architecture, for the upcoming release. Thank you to everyone who signed up and tested out the release!</li>
</ul>
<p>With React Native 0.69 we will continue refining this process, ideally getting partners to provide earlier release signal and onboarding co-pilots. As always, <a href="https://github.com/reactwg/react-native-releases/discussions" target="_blank" rel="noopener noreferrer">any feedback is more than welcome</a>. If you’d like to join as a release tester or supporter, <a href="https://forms.gle/fPuPE1MZRDGWNqpd6" target="_blank" rel="noopener noreferrer">please sign up here</a>.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="towards-hermes-as-default-engine">Towards Hermes as Default engine<a href="https://reactnative.dev/blog/2022/03/15/an-update-on-the-new-architecture-rollout#towards-hermes-as-default-engine" class="hash-link" aria-label="Direct link to Towards Hermes as Default engine" title="Direct link to Towards Hermes as Default engine">​</a></h3>
<p>One of the crucial point of the New Architecture Rollout is the adoption of the new JavaScript engine: <strong>Hermes.</strong></p>
<p>With the New React Native Architecture, we’re going to <strong>set Hermes as default engine</strong>. This means that all the new documentation and templates will have Hermes enabled.</p>
<p>Please note that we'll continue working with the community to make sure <strong>other engines</strong>, such as JSC (JavaScript Core), <strong>are supported</strong>. You can still use the engine you wish, but you’ll have to <strong>explicitly disable Hermes</strong>.</p>
<p>To improve the stability of Hermes, we’re working towards changing the <strong>distribution model</strong> of Hermes. Specifically, we envision the Hermes release process <strong>to be closer</strong> to the React Native release process.</p>
<p>This will allow us to ship a version of React Native, with a bundled JS engine that is <strong>fully compatible</strong>. You won’t have to deal with run-time crashes and Hermes incompatibilities that are really hard to debug and understand.</p>
<p>Moreover, this will <strong>shorten the cycle</strong> for picking up <strong>improvements</strong> and bug fixes in Hermes, which will allow us to be more <strong>responsive</strong> to the needs of React Native users.</p>
<p>We will be sharing more on this matter in the coming months. In the meanwhile, feel free to <a href="https://github.com/reactwg/react-native-new-architecture/discussions/4" target="_blank" rel="noopener noreferrer">join the discussion</a> about it on the Working Group.</p>
<p>If you haven’t tried Hermes yet, now is the time to give it a go. And please make sure to flag any issues or blockers you might face.</p>
<p>With this, that’s a wrap.</p>
<p>I’d like to thank Andrei, Aleksandar, Dmitry, Eli, Luna, Héctor &amp; Neil for reviewing this blog-post and providing valuable contributions to those efforts.</p>
<p>And looking forward to <strong>reading your migration stories</strong>.</p>]]></content:encoded>
            <category>announcement</category>
        </item>
        <item>
            <title><![CDATA[React Native - H2 2021 Recap]]></title>
            <link>https://reactnative.dev/blog/2022/01/21/react-native-h2-2021-recap</link>
            <guid>https://reactnative.dev/blog/2022/01/21/react-native-h2-2021-recap</guid>
            <pubDate>Fri, 21 Jan 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[While we're all still excited for the release of React Native 0.67, we want to take a moment to celebrate what the community achieved in the last half and share what we have on the horizon for the future of React Native.]]></description>
            <content:encoded><![CDATA[<p>While we're all still excited for the <a href="https://reactnative.dev/blog/2022/01/19/version-067">release of React Native 0.67</a>, we want to take a moment to <strong>celebrate</strong> what the community achieved in the last half and share what we have on the <strong>horizon</strong> for the future of React Native.</p>
<p>Specifically, H2 2021 was an <a href="https://reactnative.dev/blog/2021/08/19/h2-2021#pushing-the-technology-forward">exciting half for both us and the community</a> where we had the opportunity to invest more in our open-source ecosystem. We revamped some of our processes and created new ones from scratch that will help you, us, and the community to enjoy a <strong>better</strong> React Native experience.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="repository-health">Repository Health<a href="https://reactnative.dev/blog/2022/01/21/react-native-h2-2021-recap#repository-health" class="hash-link" aria-label="Direct link to Repository Health" title="Direct link to Repository Health">​</a></h2>
<p>In H2 2021, we invested in tackling some of the <em>OSS debt</em> that our repository built up over the years. Specifically, most of our focus was around <strong>pull requests</strong>. We built an internal process to make sure all the new pull requests are addressed in a timely manner.</p>
<p>Although this is not a complete list, we would like to highlight some <strong>impactful</strong> PRs we received from our contributors:</p>
<ul>
<li><strong>Accessibility</strong>
<ul>
<li><a href="https://github.com/facebook/react-native/pull/31630" target="_blank" rel="noopener noreferrer">#31630</a> <code>Added Support for Entrance/exit from collection by Flatlist</code> by <a href="https://github.com/anaskhraza" target="_blank" rel="noopener noreferrer">@anaskhraza</a></li>
</ul>
</li>
<li><strong>Crash</strong>
<ul>
<li><a href="https://github.com/facebook/react-native/pull/29452" target="_blank" rel="noopener noreferrer">#29452</a> <code>Fix - TextInput Drawable to avoid Null Pointer Exception RuntimeError</code> by <a href="https://github.com/fabriziobertoglio1987" target="_blank" rel="noopener noreferrer">@fabriziobertoglio1987</a></li>
</ul>
</li>
<li><strong>Display</strong>
<ul>
<li><a href="https://github.com/facebook/react-native/pull/31777" target="_blank" rel="noopener noreferrer">#31777</a> <code>fix: TouchableNativeFeedback ripple starts on previous touch location</code> by <a href="https://github.com/intergalacticspacehighway" target="_blank" rel="noopener noreferrer">@intergalacticspacehighway</a></li>
<li><a href="https://github.com/facebook/react-native/pull/31789" target="_blank" rel="noopener noreferrer">#31789</a> <code>Fix support for blobs larger than 64 KB on Android</code> by <a href="https://github.com/tomekzaw" target="_blank" rel="noopener noreferrer">@tomekzaw</a></li>
<li><a href="https://github.com/facebook/react-native/pull/31007" target="_blank" rel="noopener noreferrer">#31007</a> <code>Fix selectionColor doesn't style Android TextInput selection handles</code> by <a href="https://github.com/fabriziobertoglio1987" target="_blank" rel="noopener noreferrer">@fabriziobertoglio1987</a></li>
<li><a href="https://github.com/facebook/react-native/pull/32398" target="_blank" rel="noopener noreferrer">#32398</a> <code>Fix Android border positioning regression</code> by <a href="https://github.com/oblador" target="_blank" rel="noopener noreferrer">@oblador</a></li>
<li><a href="https://github.com/facebook/react-native/pull/29099" target="_blank" rel="noopener noreferrer">#29099</a> <code>[Android] Allows to set individual (left,top,right,bottom) dotted/dashed</code> by <a href="https://github.com/fabriziobertoglio1987" target="_blank" rel="noopener noreferrer">@fabriziobertoglio1987</a></li>
<li><a href="https://github.com/facebook/react-native/pull/29117" target="_blank" rel="noopener noreferrer">#29117</a> <code>[Android] Fix font weight numeric values</code> by <a href="https://github.com/fabriziobertoglio1987" target="_blank" rel="noopener noreferrer">@fabriziobertoglio1987</a></li>
</ul>
</li>
<li><strong>Interaction</strong>
<ul>
<li><a href="https://github.com/facebook/react-native/pull/28995" target="_blank" rel="noopener noreferrer">#28995</a> <code>[Android] Fix TextInput Cursor jumping to the right when placeholder null</code> by <a href="https://github.com/fabriziobertoglio1987" target="_blank" rel="noopener noreferrer">@fabriziobertoglio1987</a></li>
<li><a href="https://github.com/facebook/react-native/pull/28952" target="_blank" rel="noopener noreferrer">#28952</a> <code>[Android] Fix non selectable Text in FlatList</code> by <a href="https://github.com/fabriziobertoglio1987" target="_blank" rel="noopener noreferrer">@fabriziobertoglio1987</a></li>
<li><a href="https://github.com/facebook/react-native/pull/29046" target="_blank" rel="noopener noreferrer">#29046</a> <code>[Android] onKeyPress event not fired with numeric keys</code> by <a href="https://github.com/fabriziobertoglio1987" target="_blank" rel="noopener noreferrer">@fabriziobertoglio1987</a></li>
<li><a href="https://github.com/facebook/react-native/pull/31500" target="_blank" rel="noopener noreferrer">#31500</a> <code>fix#29319 - ios dismiss modal</code> by <a href="https://github.com/intergalacticspacehighway" target="_blank" rel="noopener noreferrer">@intergalacticspacehighway</a></li>
<li><a href="https://github.com/facebook/react-native/pull/32179" target="_blank" rel="noopener noreferrer">#32179</a> <code>Fix: multiline textinput start "jerking" when trying to move cursor.</code> by <a href="https://github.com/xiankuncheng" target="_blank" rel="noopener noreferrer">@xiankuncheng</a></li>
<li><a href="https://github.com/facebook/react-native/pull/29039" target="_blank" rel="noopener noreferrer">#29039</a> <code>Fix to make taps on views outside parent bounds work on Android</code> by <a href="https://github.com/hsource" target="_blank" rel="noopener noreferrer">@hsource</a></li>
</ul>
</li>
<li><strong>Performance</strong>
<ul>
<li><a href="https://github.com/facebook/react-native/pull/31764" target="_blank" rel="noopener noreferrer">#31764</a> <code>Optimize font handling on iOS</code> by <a href="https://github.com/Adlai-Holler" target="_blank" rel="noopener noreferrer">@Adlai-Holler</a></li>
<li><a href="https://github.com/facebook/react-native/pull/32536" target="_blank" rel="noopener noreferrer">#32536</a> <code>Don't reconstruct app component on split-screen</code> by <a href="https://github.com/Somena1" target="_blank" rel="noopener noreferrer">@Somena1</a></li>
</ul>
</li>
<li><strong>Testing</strong>
<ul>
<li><a href="https://github.com/facebook/react-native/pull/31401" target="_blank" rel="noopener noreferrer">#31401</a> <code>Add unit tests for VirtualizedList render quirks</code> by <a href="https://github.com/NickGerleman" target="_blank" rel="noopener noreferrer">@NickGerleman</a></li>
</ul>
</li>
</ul>
<p>Some of those PRs addressed issues that were impacting both Meta and the overall OSS community, given the number of reactions on the corresponding issue they closed.</p>
<p>There are so many more PRs we would like to call out, and we want to <strong>thank</strong> again all the people that are spending their time to help us address bugs and improve React Native.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="community-engagement">Community Engagement<a href="https://reactnative.dev/blog/2022/01/21/react-native-h2-2021-recap#community-engagement" class="hash-link" aria-label="Direct link to Community Engagement" title="Direct link to Community Engagement">​</a></h2>
<p>At the beginning of the half we set a goal to <strong>communicate</strong> with our community more and set process for the behavior to continue. Here were some of our engagements in H2 2021:</p>
<ul>
<li>We had the opportunity to participate in <a href="https://www.react-native.eu/" target="_blank" rel="noopener noreferrer">React Native EU</a> with a talk from <a href="https://twitter.com/joshuaisgross" target="_blank" rel="noopener noreferrer">Joshua Gross</a> - <a href="https://www.youtube.com/watch?v=xKOkILSLs0Q&amp;t=3987s" target="_blank" rel="noopener noreferrer">Bringing the Fabric renderer to the “Facebook” app</a></li>
<li>We hosted an <a href="https://www.reddit.com/r/reactnative/comments/pzdo1r/react_native_team_aua_thursday_oct_14_9am_pt/" target="_blank" rel="noopener noreferrer">“Ask Us Anything“ (AUA) on Reddit</a> and received over 100 questions! AUAs are a great opportunity for both us, to get a sense of the community engagement, and you all, to ask any kind of questions. If you haven’t yet, make sure you check the answers as some of them are extremely insightful</li>
<li>We shared our <a href="https://reactnative.dev/blog/2021/08/26/many-platform-vision" target="_blank" rel="noopener noreferrer">Many Platform Vision</a>, a guide for gotchas for <a href="https://reactnative.dev/blog/2021/09/01/preparing-your-app-for-iOS-15-and-android-12" target="_blank" rel="noopener noreferrer">Android 12 and iOS 15</a>, and the progress and <a href="https://reactnative.dev/blog/2021/10/26/toward-hermes-being-the-default" target="_blank" rel="noopener noreferrer">vision for Hermes to become the default JS engine</a> for React Native!</li>
<li>Our own <a href="https://twitter.com/fkgozali" target="_blank" rel="noopener noreferrer">Kevin Gozali</a> appeared on <a href="https://reactnativeradio.com/episodes/rnr-222-the-new-architecture-with-kevin-gozali-from-the-rn-core-team" target="_blank" rel="noopener noreferrer">an episode of React Native Radio podcast</a> to talk about the new architecture.</li>
<li>At <a href="https://conf.reactjs.org/" target="_blank" rel="noopener noreferrer">ReactConf 2021</a>, ReactConf <a href="https://twitter.com/rickhanlonii" target="_blank" rel="noopener noreferrer">Rick Hanlon</a> shared the unified many-platform vision for React and React Native. Moreover, <a href="https://twitter.com/EricRozell" target="_blank" rel="noopener noreferrer">Eric Rozell</a> and <a href="https://twitter.com/moyessa" target="_blank" rel="noopener noreferrer">Steven Moyes</a> got to share the amazing progress React Native Desktop has made in supporting both Meta and Microsoft apps and showcasing the Many Platform Vision in practice.</li>
</ul>
<p>Beyond sharing more updates in H2 2021, we also <strong>leaned</strong> on our community more than ever. We relied on critical feedback from contributors as they dogfooded early drafts of the New Architecture material. As well, we were heavily supported by the expertise of our community in debugging critical release issues and improvements.</p>
<p>There is a wealth of knowledge that our community brings into React Native, and we need to continue to nurture it.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="the-new-architecture-rollout-and-releases">The New Architecture Rollout and Releases<a href="https://reactnative.dev/blog/2022/01/21/react-native-h2-2021-recap#the-new-architecture-rollout-and-releases" class="hash-link" aria-label="Direct link to The New Architecture Rollout and Releases" title="Direct link to The New Architecture Rollout and Releases">​</a></h2>
<p>2022 is going to be the year of the <strong>New Architecture in open source</strong>.</p>
<p>We’ve been working hard to deliver the infrastructure needed to rollout the New Architecture to apps and libraries. We involved some of our partners and core contributors/library maintainers to refine our support for the new architecture to get early stage feedback.</p>
<p>We are now preparing to release a new guide on our website: <a href="https://github.com/facebook/react-native-website/pull/2879" target="_blank" rel="noopener noreferrer">Getting Started with the New Architecture</a>. That will be the entry point to a collection of material that we’re going to release in 2022 and will help you migrate/start your project with the new architecture.</p>
<p>Moreover, we would like to stress the <a href="https://github.com/facebook/react-native-website/pull/2879" target="_blank" rel="noopener noreferrer">importance of <strong>giving feedback</strong></a> on the New Architecture material. We’re still in the process of finalizing the last details and your input will help everyone adopt the new architecture more seamlessly.</p>
<p><strong>Releases</strong> play a critical role in the New Architecture rollout. Our goal last half was to ensure any release blocking issues did not stagnate. We approached the problem by <a href="https://github.com/facebook/react-native/wiki/Releases" target="_blank" rel="noopener noreferrer">clarifying and improving process and responsibilities</a> for better accountability. Our release coordination now occurs in a <a href="https://github.com/reactwg/react-native-releases/discussions" target="_blank" rel="noopener noreferrer">dedicated discussions repository</a> with <a href="https://github.com/facebook/react-native/issues/new?assignees=&amp;labels=Needs%3A+Triage+%3Amag%3A%2CType%3A+Upgrade+Issue&amp;template=upgrade-regression-form.yml" target="_blank" rel="noopener noreferrer">clearer release issue reporting</a>.</p>
<p>In H1 2022, we will continue to iterate on release responsibilities to support new architecture rollout. If you’d like to help out testing release candidates or <a href="https://github.com/facebook/react-native/projects/18" target="_blank" rel="noopener noreferrer">working on improvements</a>, feel free to <a href="https://github.com/reactwg/react-native-releases/discussions/categories/improvements" target="_blank" rel="noopener noreferrer">join the discussion</a>!</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="to-mobile-and-beyond">To Mobile and beyond<a href="https://reactnative.dev/blog/2022/01/21/react-native-h2-2021-recap#to-mobile-and-beyond" class="hash-link" aria-label="Direct link to To Mobile and beyond" title="Direct link to To Mobile and beyond">​</a></h2>
<p>As you can see from <a href="https://conf.reactjs.org/" target="_blank" rel="noopener noreferrer">the ReactConf talk lineup</a>, React Native is not only Android &amp; iOS.</p>
<p>Earlier in 2021, we shared our <a href="https://reactnative.dev/blog/2021/08/26/many-platform-vision" target="_blank" rel="noopener noreferrer">Many Platform Vision</a>, and we had a successful time rolling out React Native on both Desktop and VR.</p>
<p>We’re looking forward to <strong>converging patterns</strong> that are platform-specific into the React Native experience.</p>
<p>Finally, we want to thank again the community for the enormous support in H2 2021. It’s always amazing to see how contributors come together and support each other on GitHub, fixing bugs, sharing their and helping us deliver React Native to millions of users.</p>
<p>Stay tuned and looking forward to an <strong>even more amazing 2022</strong> 🎉!</p>]]></content:encoded>
            <category>announcement</category>
        </item>
        <item>
            <title><![CDATA[Announcing React Native 0.67]]></title>
            <link>https://reactnative.dev/blog/2022/01/19/version-067</link>
            <guid>https://reactnative.dev/blog/2022/01/19/version-067</guid>
            <pubDate>Wed, 19 Jan 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[Happy new year everyone! Today we are announcing the latest release of React Native, 0.67.0, along with some updates on the release process that we have been working on in the past few months.]]></description>
            <content:encoded><![CDATA[<p>Happy new year everyone! Today we are announcing the latest release of React Native, 0.67.0, along with some updates on the release process that we have been working on in the past few months.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="sections">Sections<a href="https://reactnative.dev/blog/2022/01/19/version-067#sections" class="hash-link" aria-label="Direct link to Sections" title="Direct link to Sections">​</a></h3>
<ul>
<li><a href="https://reactnative.dev/blog/2022/01/19/version-067#highlights-of-067">Highlights of 0.67</a></li>
<li><a href="https://reactnative.dev/blog/2022/01/19/version-067#improvements-to-release-process">Improvements to Release Process</a></li>
<li><a href="https://reactnative.dev/blog/2022/01/19/version-067#interested-in-helping-react-native-stabilise-new-releases">Interested in helping React Native stabilise new releases?</a></li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="highlights-of-067">Highlights of 0.67<a href="https://reactnative.dev/blog/2022/01/19/version-067#highlights-of-067" class="hash-link" aria-label="Direct link to Highlights of 0.67" title="Direct link to Highlights of 0.67">​</a></h2>
<p>As mentioned in Meta's <a href="https://reactnative.dev/blog/2021/08/19/h2-2021" target="_blank" rel="noopener noreferrer">H2 2021 plans</a>, React Native is attempting more frequent releases for a shorter turnaround time for new features and fixes (like the new architecture) to land in the community. Naturally, many releases will focus on fixes and improvements.</p>
<p>Here are some notable changes coming in 0.67.0:</p>
<ul>
<li>Lean-core removals: <a href="https://github.com/facebook/react-native/commit/7a770526c626e6659a12939f8c61057a688aa623#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346" target="_blank" rel="noopener noreferrer">DatePickerAndroid</a></li>
<li>Bump Gradle version to 7.2, Bump Kotlin version to 1.5.31 <a href="https://github.com/facebook/react-native/commit/9ae3367431428748f5486c782199beb4f9c6b477" target="_blank" rel="noopener noreferrer">Bump Kotlin and Gradle versions (#32319)</a></li>
<li>A notable callout: 0.67 continues to depend on Hermes 0.9.0, unchanged from 0.66</li>
</ul>
<p>You can find the <a href="https://github.com/facebook/react-native/blob/main/CHANGELOG.md#v0670" target="_blank" rel="noopener noreferrer">full changelog here</a>.</p>
<p>You can participate in the conversation on the status of this release at <a href="https://github.com/reactwg/react-native-releases/discussions/10" target="_blank" rel="noopener noreferrer">this discussion</a> - and, as always, to help you upgrade to this version, you can use the <a href="https://react-native-community.github.io/upgrade-helper/" target="_blank" rel="noopener noreferrer">upgrade helper</a> ⚛️</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="acknowledgements">Acknowledgements<a href="https://reactnative.dev/blog/2022/01/19/version-067#acknowledgements" class="hash-link" aria-label="Direct link to Acknowledgements" title="Direct link to Acknowledgements">​</a></h3>
<p>This release includes <a href="https://github.com/facebook/react-native/compare/0.66-stable...0.67-stable" target="_blank" rel="noopener noreferrer">379 commits with 74 contributors</a>! Thank you, to all our contributors (old and new)! You can find the <a href="https://github.com/facebook/react-native/blob/main/CHANGELOG.md#v0670" target="_blank" rel="noopener noreferrer">full changelog here</a>.</p>
<p>We wanted to also thank the release testers who helped us make sure that 0.67.0 could reach your codebases without any massive regression. Specifically, we wanted to thank:</p>
<ul>
<li>Marc Rousavy (<a href="https://github.com/mrousavy" target="_blank" rel="noopener noreferrer">@mrousavy</a>) from <a href="https://margelo.io/" target="_blank" rel="noopener noreferrer">Margelo</a>, that surfaced a <a href="https://github.com/facebook/hermes/issues/649" target="_blank" rel="noopener noreferrer">regression for Hermes 0.10</a> (that would have never been caught on CI testing) which will be fixed in Hermes 0.11 in the 0.68 release of React Native.</li>
<li>The Reanimated team for quickly preparing a <a href="https://github.com/software-mansion/react-native-reanimated/releases/tag/2.2.4" target="_blank" rel="noopener noreferrer">0.67 compatible version</a> of their lib early in the 0.67 RC phase.</li>
<li>Elias Nahum (<a href="https://github.com/enahum" target="_blank" rel="noopener noreferrer">@enahum</a>) from <a href="https://mattermost.com/" target="_blank" rel="noopener noreferrer">Mattermost</a></li>
<li>Mike Hardy (<a href="https://github.com/mikeHardy" target="_blank" rel="noopener noreferrer">@mikeHardy</a>) working with <a href="https://invertase.io/" target="_blank" rel="noopener noreferrer">Invertase</a></li>
</ul>
<p>We appreciate also <a href="https://rainbow.me/" target="_blank" rel="noopener noreferrer">Rainbow</a>, <a href="https://comm.app/" target="_blank" rel="noopener noreferrer">Comm</a> and <a href="https://www.ledger.com/ledger-live" target="_blank" rel="noopener noreferrer">Ledger Live</a> for also being part of the pilot of the "Release Tester" program (more details below).</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="improvements-to-release-process">Improvements to Release Process<a href="https://reactnative.dev/blog/2022/01/19/version-067#improvements-to-release-process" class="hash-link" aria-label="Direct link to Improvements to Release Process" title="Direct link to Improvements to Release Process">​</a></h2>
<p>As mentioned, React Native has been restructuring the release pipeline to allow for more frequent releases such that new features and fixes can roll out faster to the community.</p>
<p>Over the last few months we tackled some issues that delay releases.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="coordination-and-knowledge-sharing">Coordination and Knowledge Sharing<a href="https://reactnative.dev/blog/2022/01/19/version-067#coordination-and-knowledge-sharing" class="hash-link" aria-label="Direct link to Coordination and Knowledge Sharing" title="Direct link to Coordination and Knowledge Sharing">​</a></h3>
<p>We invested in our documentation of releases to cover how to run a release, FAQs, coordination of release issues, etc – all of which can be found in this section of the <a href="https://github.com/facebook/react-native/wiki/Releases" target="_blank" rel="noopener noreferrer">react-native wiki</a>.
By documentation, releases are no longer blocked on any individual or tribal knowledge.</p>
<p>In addition to documentation, we have also revamped the coordination of releases and have moved discussion of pre-release status and patches to a dedicated discussion group: <a href="https://github.com/reactwg/react-native-releases/discussions" target="_blank" rel="noopener noreferrer">react-wg/react-native-releases</a>.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="clarity-of-responsibility">Clarity of responsibility<a href="https://reactnative.dev/blog/2022/01/19/version-067#clarity-of-responsibility" class="hash-link" aria-label="Direct link to Clarity of responsibility" title="Direct link to Clarity of responsibility">​</a></h3>
<p>Following more documentation, release work can scale such that no one person is critical to running a release.</p>
<p>A React Native release is susceptible to a broad spectrum of potential points of failure and has a lot of dependencies and follow-up. Considering that usage of React Native varies across the community, it’s essential to have stakeholders involved in releases. We have defined a set of <a href="https://github.com/facebook/react-native/wiki/Release-Roles-and-Responsibilities" target="_blank" rel="noopener noreferrer">roles and responsibilities in supporting a release</a>.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="release-candidate-signal">Release candidate signal<a href="https://reactnative.dev/blog/2022/01/19/version-067#release-candidate-signal" class="hash-link" aria-label="Direct link to Release candidate signal" title="Direct link to Release candidate signal">​</a></h3>
<p>Another issue with releases is getting a good signal that a release will not suffer from build regressions. This can be addressed with growing investment in testing build variants, etc. but signal from adoption will continue to be useful for some time.</p>
<p>In the 0.67 release we piloted a “Release Tester” program where React Native developers working on Open Source apps <a href="https://github.com/facebook/react-native/wiki/Release-Roles-and-Responsibilities#release-tester-responsibilities" target="_blank" rel="noopener noreferrer">commit to testing release candidates</a> on their apps. Prior, there was no formal expectation that the community will test out release candidates to raise any potential issues. This program helps us get faster signal to ensure a level of stability of the release.</p>
<p>Open source React Native apps are particularly useful due to availability of source code to help debug any regressions. With this program in place, a release tester surfaced a regression in 0.67 and we were able to resolve it without thrashing the larger community with a faulty release.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="interested-in-helping-react-native-stabilise-new-releases">Interested in helping React Native stabilise new releases?<a href="https://reactnative.dev/blog/2022/01/19/version-067#interested-in-helping-react-native-stabilise-new-releases" class="hash-link" aria-label="Direct link to Interested in helping React Native stabilise new releases?" title="Direct link to Interested in helping React Native stabilise new releases?">​</a></h2>
<p>A great way to help us catch regressions is to integrate the React Native pre-release version <a href="https://www.npmjs.com/package/react-native" target="_blank" rel="noopener noreferrer"><code>react-native@next</code></a> or <a href="https://www.npmjs.com/package/react-native" target="_blank" rel="noopener noreferrer"><code>react-native@nightly</code></a> to your CI. For any regressions, you can <a href="https://github.com/facebook/react-native/issues/new?assignees=&amp;labels=Needs%3A+Triage+%3Amag%3A%2CType%3A+Upgrade+Issue&amp;template=upgrade-regression-form.yml" target="_blank" rel="noopener noreferrer">file a release issue</a> and notify the appropriate discussion.</p>
<p>If your app or company is interested in joining the “Release Tester” program, head to the dedicated section at the bottom of the <a href="https://github.com/facebook/react-native/wiki/Release-Roles-and-Responsibilities#release-tester-responsibilities" target="_blank" rel="noopener noreferrer">Release Roles and Responsibilities wiki</a> to learn more.</p>
<p>Lastly any help on trying our release candidates or helping unblock release issues is much appreciated!</p>]]></content:encoded>
            <category>announcement</category>
            <category>release</category>
        </item>
        <item>
            <title><![CDATA[Toward Hermes being the Default]]></title>
            <link>https://reactnative.dev/blog/2021/10/26/toward-hermes-being-the-default</link>
            <guid>https://reactnative.dev/blog/2021/10/26/toward-hermes-being-the-default</guid>
            <pubDate>Tue, 26 Oct 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[Since we announced Hermes in 2019, it has been increasingly gaining adoption in the community. The team at Expo, who maintain a popular meta-framework for React Native apps, recently announced experimental support for Hermes after being one of the most requested features of Expo. The team at Realm, a popular mobile database, also recently shipped its alpha support for Hermes. In this post, we want to highlight some of the most exciting progress we've made over the past two years to push Hermes towards being the best JavaScript engine for React Native. Looking forward, we are confident that with these improvements and more to come, we can make Hermes the default JavaScript engine for React Native across all platforms.]]></description>
            <content:encoded><![CDATA[<p>Since <a href="https://engineering.fb.com/2019/07/12/android/hermes/" target="_blank" rel="noopener noreferrer">we announced Hermes in 2019</a>, it has been increasingly gaining adoption in the community. The team at <a href="https://expo.dev/" target="_blank" rel="noopener noreferrer">Expo</a>, who maintain a popular meta-framework for React Native apps, recently <a href="https://blog.expo.dev/expo-sdk-42-579aee2348b6" target="_blank" rel="noopener noreferrer">announced experimental</a> <a href="https://blog.expo.dev/expo-sdk-43-beta-is-now-available-47dc54a8d29f" target="_blank" rel="noopener noreferrer">support</a> for Hermes after being <a href="https://expo.canny.io/feature-requests/p/enabling-hermes" target="_blank" rel="noopener noreferrer">one of the most requested features of Expo</a>. The team at <a href="https://realm.io/" target="_blank" rel="noopener noreferrer">Realm</a>, a popular mobile database, also recently shipped its <a href="https://github.com/realm/realm-js/issues/3940" target="_blank" rel="noopener noreferrer">alpha support</a> for Hermes. In this post, we want to highlight some of the most exciting progress we've made over the past two years to push Hermes towards being <em>the best</em> JavaScript engine for React Native. Looking forward, we are confident that with these improvements and more to come, we can make Hermes the default JavaScript engine for React Native across all platforms.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="optimizing-for-react-native">Optimizing for React Native<a href="https://reactnative.dev/blog/2021/10/26/toward-hermes-being-the-default#optimizing-for-react-native" class="hash-link" aria-label="Direct link to Optimizing for React Native" title="Direct link to Optimizing for React Native">​</a></h2>
<p>Hermes’s defining feature is how it performs compilation work ahead-of-time, meaning that React Native apps with Hermes enabled ship with precompiled optimized bytecode instead of plain JavaScript source. This drastically reduces the amount of work needed to start up your product for users. Measurements from both Facebook and community apps have suggested that enabling Hermes often cut a product’s TTI (or <a href="https://web.dev/interactive/" target="_blank" rel="noopener noreferrer">Time-To-Interactive</a>) metric by nearly half.</p>
<p>That being said, we’ve been working on improving Hermes in many other aspects to make it even better as a JavaScript engine specialized for React Native.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="building-a-new-garbage-collector-for-fabric">Building a New Garbage Collector for Fabric<a href="https://reactnative.dev/blog/2021/10/26/toward-hermes-being-the-default#building-a-new-garbage-collector-for-fabric" class="hash-link" aria-label="Direct link to Building a New Garbage Collector for Fabric" title="Direct link to Building a New Garbage Collector for Fabric">​</a></h3>
<p>With the upcoming <a href="https://github.com/react-native-community/discussions-and-proposals/issues/4" target="_blank" rel="noopener noreferrer">Fabric</a> renderer in the new React Native architecture, it will be possible to synchronously call JavaScript on the UI thread. However, this means if the JavaScript thread takes too long to execute, it can cause noticeable UI frame drops and block user inputs. The <a href="https://reactjs.org/blog/2021/06/08/the-plan-for-react-18.html" target="_blank" rel="noopener noreferrer">concurrent rendering</a> enabled by React <a href="https://reactjs.org/docs/faq-internals.html#what-is-react-fiber" target="_blank" rel="noopener noreferrer">Fiber</a> will avoid scheduling long JavaScript tasks by splitting rendering work into chunks. However, there is another common source of latency from the JavaScript thread — when the JavaScript engine has to “stop the world” to perform a garbage collection (GC).</p>
<p>The previous default garbage collector in Hermes, <a href="https://hermesengine.dev/docs/gengc/" target="_blank" rel="noopener noreferrer">GenGC</a>, was a single-threaded generational garbage collector. The new generations uses a typical semi-space copying strategy, and the old generations uses a mark-compact strategy to make it really good at aggressively returning memory to the operating system. Due to its single-thread, GenGC has the downside of causing long GC pauses. On apps that are as complicated as Facebook for Android, we observed an average pause of 200ms, or 1.4s at p99. We have even seen it be as long as 7 seconds, considering the large and diverse user base of Facebook for Android.</p>
<p>In order to mitigate this, we implemented a brand new <em>mostly concurrent</em> GC named <a href="https://hermesengine.dev/docs/hades" target="_blank" rel="noopener noreferrer">Hades</a>. Hades collects its young generation exactly the same as GenGC, but it manages its old generation with a snapshot-at-the-beginning style mark-sweep collector. which can significantly reduce GC pause time by performing most of its work in a background thread without blocking the engine’s main thread from executing JavaScript code. <strong>Our statistics show that Hades only pauses for 48ms at p99.9 on 64-bit devices (34x faster than GenGC!)</strong> and around 88ms at p99.9 on 32-bit devices (where it operates as a single-threaded <em>incremental</em> GC). These pause time improvements can come at the cost of overall throughput, due to the need for more expensive write barriers, slower freelist based allocation (as opposed to a bump pointer allocator), and increased heap fragmentation. We think those are the right trade-offs, and we were able to achieve overall lower memory consumption via coalescing and additional memory optimizations that we’ll talk about.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="striking-on-performance-pain-points">Striking on Performance Pain Points<a href="https://reactnative.dev/blog/2021/10/26/toward-hermes-being-the-default#striking-on-performance-pain-points" class="hash-link" aria-label="Direct link to Striking on Performance Pain Points" title="Direct link to Striking on Performance Pain Points">​</a></h3>
<p>Startup time of applications is critical to the success of many apps, and we are continuously pushing the boundary for React Native. For any new JavaScript feature we implement in Hermes, we carefully monitor their impact on production performance and ensure that they don’t regress metrics. At Facebook, we are currently experimenting with a <a href="https://github.com/facebook/react-native/blob/main/packages/react-native-babel-preset/src/configs/main.js#L41" target="_blank" rel="noopener noreferrer">dedicated Babel transform profile for Hermes in Metro</a> to replace a dozen Babel transforms with Hermes’s native ESNext implementations. We were able to observe <strong>18-25% TTI improvements</strong> on many surfaces and <strong>overall bytecode size decreases</strong> and we expect to see similar results for OSS.</p>
<p>In addition to startup performance, we identified memory footprint as an opportunity for improvement in React Native apps especially for <a href="https://reactnative.dev/blog/2021/08/26/many-platform-vision#expanding-to-new-platforms" target="_blank" rel="noopener noreferrer">virtual reality.</a> Thanks to the low-level control we have as a JavaScript engine, we were able to deliver rounds of memory optimizations by squeezing bits and bytes out:</p>
<ol>
<li>Previously, all JavaScript values were represented as 64-bit NaN-boxing encoded tagged values to represent floating point doubles and pointers on 64-bit architecture. However, this is wasteful in practice because most numbers are small integers (SMI) and JavaScript heap of client-side applications is not expected to be larger than 4GiB generally. To address this, we introduced a new 32-bit encoding in which SMI and pointers are encoded in 29 bits (because pointers are 8-byte aligned, we can assume the bottom 3 bits are always zero), and the rest of JS numbers are boxed onto the heap. <strong>This reduced the JavaScript heap size by ~30%.</strong></li>
<li>Different kinds of JavaScript objects are represented as different kinds of GC-managed cells in the JavaScript heap. By aggressively optimizing the memory layout of headers for those cells, <strong>we are able to reduce memory usage by another ~15%</strong>.</li>
</ol>
<p>One of our key decisions with Hermes was to not implement a <a href="https://en.wikipedia.org/wiki/Just-in-time_compilation" target="_blank" rel="noopener noreferrer">just-in-time (JIT) compiler</a> because we believe that for most React Native apps, the additional warm-up costs and extra footprints on binary and memory would not actually be worthwhile. For years, we invested a lot of effort in optimizing interpreter performance and compiler optimizations to make Hermes’s throughput competitive with other engines for React Native workloads. We are continuing to focus on improving throughput by identifying performance bottlenecks from everywhere (interpreter dispatch loop, stack layout, object model, GC, etc.). Expect some more numbers in upcoming releases!</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="pioneering-at-vertical-integrations">Pioneering at Vertical Integrations<a href="https://reactnative.dev/blog/2021/10/26/toward-hermes-being-the-default#pioneering-at-vertical-integrations" class="hash-link" aria-label="Direct link to Pioneering at Vertical Integrations" title="Direct link to Pioneering at Vertical Integrations">​</a></h3>
<p>At Facebook, we prefer to colocate projects within a large <a href="https://en.wikipedia.org/wiki/Monorepo" target="_blank" rel="noopener noreferrer">monorepo</a>. By having the engine (Hermes) and the host (React Native) closely iterating together, we opened a lot of room for vertical integrations. To name a few:</p>
<ul>
<li>Hermes supports <a href="https://reactnative.dev/docs/hermes#debugging-js-on-hermes-using-google-chromes-devtools" target="_blank" rel="noopener noreferrer">on-device JavaScript debugging with the Chrome debugger</a> by speaking the <a href="https://chromedevtools.github.io/devtools-protocol/" target="_blank" rel="noopener noreferrer">Chrome DevTools Protocol</a>. It’s better than the legacy “<a href="https://reactnative.dev/docs/debugging#chrome-developer-tools" target="_blank" rel="noopener noreferrer">Remote JS Debugging</a>” (which uses an in-app proxy to run JS in desktop Chrome) because it supports debugging synchronous native calls and guaranteed a consistent runtime environment. Together with React DevTools, Metro, Inspector, and so on, Hermes debugger is now part of <a href="https://reactnative.dev/blog/2020/03/26/version-0.62" target="_blank" rel="noopener noreferrer">Flipper</a> to provide a one-stop developer experience.</li>
<li>Objects allocated during the initialization path of React Native apps are often long-lived and don’t follow the <em>generational</em> <em>hypothesis</em> leveraged by generational GCs. Therefore, we <a href="https://github.com/facebook/react-native/blob/main/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/OnLoad.cpp#L37-L42" target="_blank" rel="noopener noreferrer">configured Hermes in React Native</a> to allocate the first 32MiB directly into old generations (known as <em>pre-tenuring</em>) to avoid triggering GC pauses and delaying TTI.</li>
<li>The new React Native architecture is heavily based on <a href="https://github.com/react-native-community/discussions-and-proposals/issues/91" target="_blank" rel="noopener noreferrer">JSI (or JavaScript Interface)</a>, a lightweight, general-purposed API for embedding a JavaScript engine into a C++ program. By having the team maintaining the JS engine also maintains the JSI API implementation, we are confident in providing the best possible integration that is reliable, performant and battle-tested at the Facebook’s scale.</li>
<li>Getting JavaScript concurrency primitives (e.g. <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises" target="_blank" rel="noopener noreferrer">promises</a>) and platform concurrency primitives (e.g. <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide" target="_blank" rel="noopener noreferrer">microtasks</a>) both semantically correct and performant are critical to React concurrent rendering and the future of React Native apps. Historically, promises in React Native were <a href="https://github.com/facebook/react-native/blob/main/Libraries/Core/polyfillPromise.js#L37" target="_blank" rel="noopener noreferrer">polyfilled</a> using non-standardized <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate" target="_blank" rel="noopener noreferrer"><code>setImmediate</code></a> APIs. We are working on making native promises and microtasks from JS engines available via JSI, and introducing <a href="https://developer.mozilla.org/en-US/docs/Web/API/queueMicrotask" target="_blank" rel="noopener noreferrer"><code>queueMicrotask</code></a>, a recent addition to the web standard, to the platform, to better support modern asynchronous JavaScript code.</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="bringing-along-the-whole-community">Bringing Along the Whole Community<a href="https://reactnative.dev/blog/2021/10/26/toward-hermes-being-the-default#bringing-along-the-whole-community" class="hash-link" aria-label="Direct link to Bringing Along the Whole Community" title="Direct link to Bringing Along the Whole Community">​</a></h2>
<p>Hermes has been really great for us at Facebook. But our work is not done until our community can use Hermes to power experiences throughout the ecosystem, so that everyone leverage all of its features and to embrace its full potential.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="expanding-to-new-platforms">Expanding to New Platforms<a href="https://reactnative.dev/blog/2021/10/26/toward-hermes-being-the-default#expanding-to-new-platforms" class="hash-link" aria-label="Direct link to Expanding to New Platforms" title="Direct link to Expanding to New Platforms">​</a></h3>
<p>Hermes was initially open sourced only for React Native on Android. Since then, we have been thrilled to see our members of the community expanding Hermes support into <a href="https://reactnative.dev/blog/2021/08/26/many-platform-vision" target="_blank" rel="noopener noreferrer">many other platforms that React Native’s ecosystem has expanded</a>.</p>
<p><a href="https://callstack.com/" target="_blank" rel="noopener noreferrer">Callstack</a> led the effort of bringing <a href="https://reactnative.dev/blog/2021/03/12/version-0.64" target="_blank" rel="noopener noreferrer">Hermes to iOS in React Native 0.64</a>. They wrote a <a href="https://callstack.com/blog/bringing-hermes-to-ios-in-react-native/" target="_blank" rel="noopener noreferrer">series of articles</a> and hosted a <a href="https://callstack.com/podcasts/react-native-0-64-with-hermes-for-ios-ep-5" target="_blank" rel="noopener noreferrer">podcast</a> on how they achieved it. According to their benchmarks, Hermes was able to <strong>consistently deliver ~40% improvement to startup and ~18% reduced memory on iOS</strong> compared to JSC for the Mattermost app, with only 2.4 MiB of app size overhead. I encourage you to <a href="https://callstack.com/blog/hermes-performance-on-ios/" target="_blank" rel="noopener noreferrer">see it live with your own eyes</a>.</p>
<p>Microsoft has been bringing <a href="https://microsoft.github.io/react-native-windows/docs/hermes" target="_blank" rel="noopener noreferrer">Hermes to React Native for Windows and macOS</a>. <a href="https://youtu.be/QMFbrHZnvvw?t=389" target="_blank" rel="noopener noreferrer">At Microsoft Build 2020</a>, Microsoft shared that Hermes’s memory impact (<a href="https://en.wikipedia.org/wiki/Working_set" target="_blank" rel="noopener noreferrer">working set</a>) is 13% lower than the Chakra engine on React Native for Windows. Recently, on some synthetic benchmarks, they’ve found Hermes 0.8 (shipped with Hades and aforementioned SMI and pointer compression optimization) <strong>uses 30%-40% less memory than other engines</strong>. Not surprisingly, the <a href="https://www.messenger.com/desktop" target="_blank" rel="noopener noreferrer">desktop Messenger</a> video calling experience built on React Native, is also powered by Hermes.</p>
<p>Last but not least, Hermes has also been powering all virtual reality experiences built with the React family of technologies on Oculus, including Oculus Home.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="supporting-our-community">Supporting our Community<a href="https://reactnative.dev/blog/2021/10/26/toward-hermes-being-the-default#supporting-our-community" class="hash-link" aria-label="Direct link to Supporting our Community" title="Direct link to Supporting our Community">​</a></h3>
<p>We acknowledge there are still blockers that prevent parts of the community from adopting Hermes and we are committed to building support for these missing features. Our goal is to be fully featured so that Hermes is the right choice for most React Native apps. Here is how the community has already shaped the Hermes roadmap:</p>
<ul>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Meta_programming" target="_blank" rel="noopener noreferrer"><code>Proxy</code> and <code>Reflect</code></a> were originally excluded from Hermes because Facebook does not use them. We were also concerned that adding Proxy would hurt property lookup performance even when Proxy is not used. But Proxy quickly become <a href="https://github.com/facebook/hermes/issues/33" target="_blank" rel="noopener noreferrer">the most requested feature</a> of Hermes due to popular libraries such as <a href="https://mobx.js.org/README.html" target="_blank" rel="noopener noreferrer">MobX</a> and <a href="https://immerjs.github.io/immer/" target="_blank" rel="noopener noreferrer">Immer</a>. We carefully evaluated and decided to build it just for the community, and we managed to implement it with very low cost. Since this is a feature we don’t use, we relied on our community to prove its stability. We started by testing Proxy behind a flag and created opt-in npm packages for <a href="https://github.com/facebook/hermes/issues/33#issuecomment-668374607" target="_blank" rel="noopener noreferrer">release v0.4</a> and <a href="https://github.com/facebook/hermes/issues/33#issuecomment-668374607" target="_blank" rel="noopener noreferrer">v0.5</a>, and it’s <a href="https://github.com/facebook/hermes/releases/tag/v0.7.0" target="_blank" rel="noopener noreferrer">enabled by default starting from v0.7</a>.</li>
<li><a href="https://hermesengine.dev/docs/intl" target="_blank" rel="noopener noreferrer">ECMAScript Internationalization API Specification (ECMA-402, or <code>Intl</code>)</a> was <a href="https://github.com/facebook/hermes/issues/23" target="_blank" rel="noopener noreferrer">the second most requested feature</a>. <code>Intl</code> is a huge set of APIs and often requires the implementation to include <strong>6MB worth</strong> of <a href="https://cldr.unicode.org/index" target="_blank" rel="noopener noreferrer">Unicode CLDR</a> data. This is why polyfills like <a href="https://github.com/formatjs/formatjs" target="_blank" rel="noopener noreferrer">FormatJS (a.k.a. <code>react-intl</code>)</a> and JS engines like the <a href="https://github.com/react-native-community/jsc-android-buildscripts#international-variant" target="_blank" rel="noopener noreferrer">international variant build of community JSC</a> are so huge. To avoid substantially increasing the binary size of Hermes, we decided to implement it with another strategy by consuming and mapping the ICU facilities provided by the libraries included in the operating systems, at the cost of some (often minor) variance in behaviors across platforms.<!-- -->
<ul>
<li>Microsoft collaborated to build support on Android. It covers almost everything from ECMA-402 up to ES2020, <strong>with only a size impact as small as 3% (57-62K per ABI)</strong>. We ran <a href="https://twitter.com/tmikov/status/1336442786694893568" target="_blank" rel="noopener noreferrer">a poll on Twitter</a> and the results were strongly in favor of including <code>Intl</code> by default, so that’s what we did and it’s available starting from <a href="https://github.com/facebook/hermes/releases/tag/v0.8.0" target="_blank" rel="noopener noreferrer">release v0.8</a>.</li>
<li>Facebook has sponsored <a href="https://mlh.io/" target="_blank" rel="noopener noreferrer">Major League Hacking</a> to launch a <a href="https://news.mlh.io/welcoming-facebook-back-as-a-sponsor-of-the-2020-2021-mlh-fellowship-08-12-2020" target="_blank" rel="noopener noreferrer">remote open source fellowship program</a>. Last year, we launched the <a href="https://reactnative.dev/docs/profile-hermes" target="_blank" rel="noopener noreferrer">Hermes sampling profiler</a>. This year, our fellows will be working with members from Hermes, React Native, and Callstack, to add support for Hermes <code>Intl</code> on iOS. Stayed tuned!</li>
</ul>
</li>
<li>We appreciate that people have been working with us to discover issues affecting the community.<!-- -->
<ul>
<li>People have helped us identify critical spec divergence such as <a href="https://github.com/facebook/hermes/issues/212" target="_blank" rel="noopener noreferrer">stability of <code>Array.prototype.sort</code></a> amended in <a href="https://github.com/tc39/ecma262/pull/1340" target="_blank" rel="noopener noreferrer">ES2019</a>. This has been fixed and will be available in the next release.</li>
<li>People found out that our default heap size limit was too small and caused <a href="https://github.com/facebook/hermes/issues/295" target="_blank" rel="noopener noreferrer">unnecessary GC pressure</a> and <a href="https://github.com/facebook/hermes/issues/511" target="_blank" rel="noopener noreferrer">OOM crashes</a> for many users who are not familiar with customizing Hermes’s GC configs. So we increased it from 512MiB to 3GiB to be more than sufficient for most users by default.</li>
<li>People also reported that our specialized <code>Function.prototype.toString</code> implementation <a href="https://github.com/facebook/hermes/issues/471#issuecomment-820123463" target="_blank" rel="noopener noreferrer">caused performance to drop in libraries doing improper feature detection</a> and <a href="https://github.com/facebook/hermes/issues/114#issuecomment-887106990" target="_blank" rel="noopener noreferrer">blocked users from doing source code injecting</a>. This helped us strengthen our stance that Hermes, whenever possible, should not get in the way of developers and to respect de-facto practices.</li>
</ul>
</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="summary">Summary<a href="https://reactnative.dev/blog/2021/10/26/toward-hermes-being-the-default#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary">​</a></h2>
<p>In summary, our vision is to make Hermes ready to be the default JavaScript engine across all React Native platforms. We’ve already started working towards it, and we want to hear from all of you about this direction.</p>
<p>It’s extremely important for us to prepare the ecosystem for a smooth adoption. We encourage you to try out Hermes, and file issues on our <a href="https://github.com/facebook/hermes" target="_blank" rel="noopener noreferrer">GitHub repository</a> for any feedbacks, questions, feature requests and incompatibilities.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="thanks">Thanks<a href="https://reactnative.dev/blog/2021/10/26/toward-hermes-being-the-default#thanks" class="hash-link" aria-label="Direct link to Thanks" title="Direct link to Thanks">​</a></h2>
<p>We’d love to thank the Hermes team, the React Native team, and the many contributors from the React Native community for their work to improve Hermes.</p>
<p>I’d also love to personally thank (in alphabetic order) Eli White, Luna Wei, Neil Dhar, Tim Yung, Tzvetan Mikov, and many others for their help during the writing.</p>]]></content:encoded>
            <category>announcement</category>
        </item>
        <item>
            <title><![CDATA[Announcing React Native 0.66]]></title>
            <link>https://reactnative.dev/blog/2021/10/01/version-066</link>
            <guid>https://reactnative.dev/blog/2021/10/01/version-066</guid>
            <pubDate>Fri, 01 Oct 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[Today we’re releasing React Native v0.66 for Android 12 and iOS 15 support alongside fixes and general updates.]]></description>
            <content:encoded><![CDATA[<p>Today we’re releasing React Native v0.66 for Android 12 and iOS 15 support alongside fixes and general updates.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="highlights">Highlights<a href="https://reactnative.dev/blog/2021/10/01/version-066#highlights" class="hash-link" aria-label="Direct link to Highlights" title="Direct link to Highlights">​</a></h2>
<ul>
<li><a href="https://reactnative.dev/blog/2021/10/01/version-066#handle-taps-on-child-views-outside-parent-boundaries-on-android">Handle taps on views outside parent bounds on Android</a></li>
<li><a href="https://reactnative.dev/blog/2021/10/01/version-066#new-bluetooth-permissions-on-android">New Bluetooth Permissions on Android</a></li>
<li><a href="https://reactnative.dev/blog/2021/10/01/version-066#better-support-for-apple-silicon-xcode-13-and-ios-15">Better Support for Apple Silicon, Xcode 13, and iOS 15</a></li>
<li><a href="https://reactnative.dev/blog/2021/10/01/version-066#hermes-090">Hermes 0.9.0</a></li>
<li><a href="https://reactnative.dev/blog/2021/10/01/version-066#nightly-and-commitly-releases">Nightly and “Commitly” Releases</a></li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="handle-taps-on-child-views-outside-parent-boundaries-on-android">Handle taps on child views outside parent boundaries on Android<a href="https://reactnative.dev/blog/2021/10/01/version-066#handle-taps-on-child-views-outside-parent-boundaries-on-android" class="hash-link" aria-label="Direct link to Handle taps on child views outside parent boundaries on Android" title="Direct link to Handle taps on child views outside parent boundaries on Android">​</a></h3>
<p>Thanks to <a href="https://github.com/hsource" target="_blank" rel="noopener noreferrer">@hsource</a> for adding interaction support for children rendered outside of parent view boundaries via <code>overflow: visible</code>. This is a common use-case and aligns React Native on Android more closely with web standards.</p>
<p>Find more details on the <a href="https://github.com/facebook/react-native/pull/29039" target="_blank" rel="noopener noreferrer">pull request</a>.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="new-bluetooth-permissions-on-android">New Bluetooth Permissions on Android<a href="https://reactnative.dev/blog/2021/10/01/version-066#new-bluetooth-permissions-on-android" class="hash-link" aria-label="Direct link to New Bluetooth Permissions on Android" title="Direct link to New Bluetooth Permissions on Android">​</a></h3>
<p>We’ve added support for <a href="https://developer.android.com/about/versions/12/features/bluetooth-permissions" target="_blank" rel="noopener noreferrer">new Bluetooth permissions</a> in preparation for Android 12 and we plan to update the <code>targetSDKVersion</code> to 31 in the next release.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="better-support-for-apple-silicon-xcode-13-and-ios-15">Better Support for Apple Silicon, Xcode 13, and iOS 15<a href="https://reactnative.dev/blog/2021/10/01/version-066#better-support-for-apple-silicon-xcode-13-and-ios-15" class="hash-link" aria-label="Direct link to Better Support for Apple Silicon, Xcode 13, and iOS 15" title="Direct link to Better Support for Apple Silicon, Xcode 13, and iOS 15">​</a></h3>
<p>This release provides a number of solutions to make Xcode builds for iOS on Apple Silicon (M1) Mac machines more reliable.</p>
<p>Notably, the new app template now includes a CocoaPods workaround (thanks to <a href="https://github.com/MikeHardy" target="_blank" rel="noopener noreferrer">@mikehardy</a>!).
To apply, make sure your app’s Podfile has <code>__apply_Xcode_12_5_M1_post_install_workaround(installer)</code> added in the <code>post_install</code> step.</p>
<p>In addition <code>RCT-Folly.podspec</code> has been <a href="https://github.com/facebook/react-native/commit/8b6d7fddd65a9b5caf599e8ff7b090a176a6f11f" target="_blank" rel="noopener noreferrer">updated to prevent arm64 linker failure</a>.</p>
<p>Check out this <a href="https://reactnative.dev/blog/2021/09/01/preparing-your-app-for-iOS-15-and-android-12">post</a> we shared on preparing your app for iOS 15 and Android 12.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="hermes-090">Hermes 0.9.0<a href="https://reactnative.dev/blog/2021/10/01/version-066#hermes-090" class="hash-link" aria-label="Direct link to Hermes 0.9.0" title="Direct link to Hermes 0.9.0">​</a></h3>
<p>Hermes 0.9.0 is primarily about closing the gap between Hermes release cut point and this React Native release.</p>
<p>Among ~400 commits, there have been general bug fixes alongside memory and size wins.</p>
<p>See <a href="https://github.com/facebook/hermes/issues/586" target="_blank" rel="noopener noreferrer">Hermes 0.9.0 release issue</a> for more details</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="nightly-and-commitly-releases">Nightly and “Commitly” Releases<a href="https://reactnative.dev/blog/2021/10/01/version-066#nightly-and-commitly-releases" class="hash-link" aria-label="Direct link to Nightly and “Commitly” Releases" title="Direct link to Nightly and “Commitly” Releases">​</a></h3>
<p>In a <a href="https://reactnative.dev/blog/2021/08/19/h2-2021">recent blog post</a> we shared that one of our goals in the second half of 2021 is to improve our release process to be faster and more stable. As part of this effort we are working to make React Native more stable on main and to reduce the bugs identified during our Release Candidate process.</p>
<p>While we have been publishing nightly releases of React Native for over a year, these releases haven’t been effectively used by most projects. They are now easier to access and we hope to use them as release candidates going forward. Nightly releases are published to npm under the “nightly” tag.</p>
<p>To improve the process of testing individual commits, React Native’s CI will now create a tarball artifact for each commit on the main and release branches as well as for each PR. We refer to them as commitlies. These commitlies will not be published to npm, but they can be downloaded directly from CircleCI. See instructions below.</p>
<p>Want to help get a PR merged? By trying out the related commitly and verifying the change, you will be providing valuable signal to help get the change landed!</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="using-nightly-releases-nightlies">Using Nightly Releases (Nightlies)<a href="https://reactnative.dev/blog/2021/10/01/version-066#using-nightly-releases-nightlies" class="hash-link" aria-label="Direct link to Using Nightly Releases (Nightlies)" title="Direct link to Using Nightly Releases (Nightlies)">​</a></h4>
<p>The process for migrating your project to a React Native nightly release is very similar to the one you would follow when upgrading to a regular version, with the exception that tools like the Upgrade Helper do not currently work with nightlies. With that in mind, we recommend that you first upgrade your project to the most recent stable release if you have not done so yet. Then, run <code>yarn upgrade react-native@nightly</code> to install the most recent nightly release. Note that there may be additional changes that are needed for your project to work properly on a nightly release.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="using-commitly-releases-commitlies">Using Commitly Releases (Commitlies)<a href="https://reactnative.dev/blog/2021/10/01/version-066#using-commitly-releases-commitlies" class="hash-link" aria-label="Direct link to Using Commitly Releases (Commitlies)" title="Direct link to Using Commitly Releases (Commitlies)">​</a></h4>
<figure><img src="https://reactnative.dev/blog/assets/0.66-artifact.png" alt="Screenshot of CircleCI artifact panel to find tarball"><figcaption><p>Find the "build_npm_package-1" job related to a commit and head to the "Artifacts" panel to download the tarball for the commitly.</p></figcaption></figure>
<p>Just like with a nightly release, first make sure that your project has been upgraded to the most recent stable version. Then, go to the <a href="https://app.circleci.com/pipelines/github/facebook/react-native" target="_blank" rel="noopener noreferrer"><code>react-native</code> dashboard on Circle CI</a> and look up the workflow that was triggered by the commit in question. There, you should see a job named <code>build_npm_package</code>. That job will have an “Artifacts” panel which will provide a link that you may use to download a tarball file. You can then run the following:</p>
<div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token comment" style="color:#93a1a1"># Update your react-native dependency to the tarball</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain"></span><span class="token comment" style="color:#93a1a1"># using your preferred package manager</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">$ </span><span class="token function" style="color:#79b6f2">yarn</span><span class="token plain"> </span><span class="token function" style="color:#79b6f2">add</span><span class="token plain"> </span><span class="token operator" style="color:#fc929e">&lt;</span><span class="token plain">path to tarball</span><span class="token operator" style="color:#fc929e">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token plain">$ </span><span class="token function" style="color:#79b6f2">npm</span><span class="token plain"> </span><span class="token function" style="color:#79b6f2">add</span><span class="token plain"> </span><span class="token operator" style="color:#fc929e">&lt;</span><span class="token plain">path to tarball</span><span class="token operator" style="color:#fc929e">&gt;</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="acknowledgements">Acknowledgements<a href="https://reactnative.dev/blog/2021/10/01/version-066#acknowledgements" class="hash-link" aria-label="Direct link to Acknowledgements" title="Direct link to Acknowledgements">​</a></h3>
<p>This release includes <strong>621 commits</strong> with <strong>92 contributors</strong>! Thank you to all our contributors new and old! You can find the <a href="https://github.com/facebook/react-native/blob/main/CHANGELOG.md#v0660" target="_blank" rel="noopener noreferrer">full changelog here</a>.</p>
<p>As well, thank you to the following contributors for their support in preparing, testing and unblocking this release!</p>
<ul>
<li><a href="https://github.com/acoates-ms" target="_blank" rel="noopener noreferrer">@acoates-ms</a></li>
<li><a href="https://github.com/dulmandakh" target="_blank" rel="noopener noreferrer">@dulmandakh</a></li>
<li><a href="https://github.com/kelset" target="_blank" rel="noopener noreferrer">@kelset</a></li>
<li><a href="https://github.com/kraenhansen" target="_blank" rel="noopener noreferrer">@kraenhansen</a></li>
<li><a href="https://github.com/MikeHardy" target="_blank" rel="noopener noreferrer">@mikehardy</a></li>
<li><a href="https://github.com/NickGerleman" target="_blank" rel="noopener noreferrer">@NickGerleman</a></li>
<li><a href="https://github.com/pvinis" target="_blank" rel="noopener noreferrer">@pvinis</a></li>
<li><a href="https://github.com/satya164" target="_blank" rel="noopener noreferrer">@satya164</a></li>
<li><a href="https://github.com/Simek" target="_blank" rel="noopener noreferrer">@Simek</a></li>
<li><a href="https://github.com/swrobel" target="_blank" rel="noopener noreferrer">@swrobel</a></li>
<li><a href="https://github.com/thymikee" target="_blank" rel="noopener noreferrer">@thymikee</a></li>
<li><a href="https://github.com/tido64" target="_blank" rel="noopener noreferrer">@tido64</a></li>
<li><a href="https://github.com/titozzz" target="_blank" rel="noopener noreferrer">@titozzz</a></li>
</ul>]]></content:encoded>
            <category>announcement</category>
            <category>release</category>
        </item>
        <item>
            <title><![CDATA[Preparing Your App for iOS 15 and Android 12]]></title>
            <link>https://reactnative.dev/blog/2021/09/01/preparing-your-app-for-iOS-15-and-android-12</link>
            <guid>https://reactnative.dev/blog/2021/09/01/preparing-your-app-for-iOS-15-and-android-12</guid>
            <pubDate>Wed, 01 Sep 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[Hello everyone!]]></description>
            <content:encoded><![CDATA[<p>Hello everyone!</p>
<p>With new mobile OS versions releasing late this year, we recommend preparing your React Native apps beforehand to avoid regressions when the releases become generally available.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="ios-15">iOS 15<a href="https://reactnative.dev/blog/2021/09/01/preparing-your-app-for-iOS-15-and-android-12#ios-15" class="hash-link" aria-label="Direct link to iOS 15" title="Direct link to iOS 15">​</a></h2>
<p>The release date of iOS 15 hasn’t been announced yet, but based on previous iOS releases, it will likely be around September 16th. Please also account for App Store review time if any changes are required to prepare your app for iOS 15.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="what-to-watch-out-for">What to watch out for<a href="https://reactnative.dev/blog/2021/09/01/preparing-your-app-for-iOS-15-and-android-12#what-to-watch-out-for" class="hash-link" aria-label="Direct link to What to watch out for" title="Direct link to What to watch out for">​</a></h3>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="quicktype-bar">QuickType Bar<a href="https://reactnative.dev/blog/2021/09/01/preparing-your-app-for-iOS-15-and-android-12#quicktype-bar" class="hash-link" aria-label="Direct link to QuickType Bar" title="Direct link to QuickType Bar">​</a></h4>
<p>The way to disable <em>QuickType</em> bar in <em><a href="https://reactnative.dev/docs/textinput">TextInput</a></em> has changed. <em>QuickType</em> bar is the bar above keyboard with three suggested words. In case your UI needs to have the bar hidden, setting <a href="https://reactnative.dev/docs/textinput#autocorrect">autoCorrect</a> to <code>false</code> no longer disables <em>QuickType</em> bar in iOS 15 like earlier versions. In order to hide the <em>QuickType</em> bar, you need to also set <a href="https://reactnative.dev/docs/textinput#spellcheck-ios">spellCheck</a> to <code>false</code>. This will disable spell check, the red underlines, in your <em>TextInput</em>. Disabling QuickType bar with spell check enabled is no longer an option.</p>
<figure><img src="https://reactnative.dev/blog/assets/ios-15-quicktype-bar.png" alt="Screenshot of QuickType bar"><figcaption><p>QuickType bar with three suggested words</p></figcaption></figure>
<p>To disable QuickType bar in iOS 15, set prop <a href="https://reactnative.dev/docs/textinput#spellcheck-ios">spellCheck</a> and <a href="https://reactnative.dev/docs/textinput#autocorrect">autoCorrect</a> to <code>false</code>.</p>
<div class="language-jsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#FFFFFF;--prism-background-color:#282C34"><div class="codeBlockContent_D5yF"><pre tabindex="0" class="prism-code language-jsx codeBlock_RMoD thin-scrollbar"><code class="codeBlockLines_AclH"><span class="token-line" style="color:#FFFFFF"><span class="token tag punctuation" style="color:#657b83">&lt;</span><span class="token tag class-name" style="color:#fac863">TextInput</span><span class="token tag" style="color:#fc929e"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token tag" style="color:#fc929e">  </span><span class="token tag attr-name" style="color:#c5a5c5">placeholder</span><span class="token tag attr-value punctuation attr-equals" style="color:#657b83">=</span><span class="token tag attr-value punctuation" style="color:#657b83">"</span><span class="token tag attr-value" style="color:#8dc891">something</span><span class="token tag attr-value punctuation" style="color:#657b83">"</span><span class="token tag" style="color:#fc929e"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token tag" style="color:#fc929e">  </span><span class="token tag attr-name" style="color:#c5a5c5">autoCorrect</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:#657b83">=</span><span class="token tag script language-javascript punctuation" style="color:#657b83">{</span><span class="token tag script language-javascript boolean" style="color:#ff8b50">false</span><span class="token tag script language-javascript punctuation" style="color:#657b83">}</span><span class="token tag" style="color:#fc929e"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token tag" style="color:#fc929e">  </span><span class="token tag attr-name" style="color:#c5a5c5">spellCheck</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:#657b83">=</span><span class="token tag script language-javascript punctuation" style="color:#657b83">{</span><span class="token tag script language-javascript boolean" style="color:#ff8b50">false</span><span class="token tag script language-javascript punctuation" style="color:#657b83">}</span><span class="token tag" style="color:#fc929e"></span><br></span><span class="token-line" style="color:#FFFFFF"><span class="token tag" style="color:#fc929e"></span><span class="token tag punctuation" style="color:#657b83">/&gt;</span><br></span></code></pre><div class="buttonGroup_aaMX"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_z5j7" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_FoOz"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_L0B6"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="transparent-navigation-bar">Transparent Navigation Bar<a href="https://reactnative.dev/blog/2021/09/01/preparing-your-app-for-iOS-15-and-android-12#transparent-navigation-bar" class="hash-link" aria-label="Direct link to Transparent Navigation Bar" title="Direct link to Transparent Navigation Bar">​</a></h4>
<p>iOS 15 changes the default behaviour of the navigation bar. Unlike in iOS 14, the navigation bar becomes transparent when the content is scrolled all the way up. Make sure to watch out for this as it can make content difficult to read. For tips on how to work around this issue, check out <a href="https://developer.apple.com/forums/thread/682420" target="_blank" rel="noopener noreferrer">this thread</a>.</p>
<p><img loading="lazy" alt="Screenshot of navigation bar on iOS 14 and iOS 15" src="https://reactnative.dev/assets/images/ios-15-navigation-bar-848434e416d217cea351622e47f107a7.jpg" width="2330" height="661" class="img_SS3x"></p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="how-to-install-ios-15">How to install iOS 15<a href="https://reactnative.dev/blog/2021/09/01/preparing-your-app-for-iOS-15-and-android-12#how-to-install-ios-15" class="hash-link" aria-label="Direct link to How to install iOS 15" title="Direct link to How to install iOS 15">​</a></h3>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="device">Device<a href="https://reactnative.dev/blog/2021/09/01/preparing-your-app-for-iOS-15-and-android-12#device" class="hash-link" aria-label="Direct link to Device" title="Direct link to Device">​</a></h4>
<p>If you have a spare device, you can join the <a href="https://beta.apple.com/sp/betaprogram/" target="_blank" rel="noopener noreferrer">beta program</a> and install iOS 15. At this point, beta releases are generally stable, but keep in mind that <strong>the upgrade to iOS 15 is irreversible</strong>.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="simulator">Simulator<a href="https://reactnative.dev/blog/2021/09/01/preparing-your-app-for-iOS-15-and-android-12#simulator" class="hash-link" aria-label="Direct link to Simulator" title="Direct link to Simulator">​</a></h4>
<p>To test your app on a simulator with iOS 15, you will need to download Xcode 13. You can find Xcode 13 <a href="https://developer.apple.com/xcode/" target="_blank" rel="noopener noreferrer">here</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_JmGV" id="android-12">Android 12<a href="https://reactnative.dev/blog/2021/09/01/preparing-your-app-for-iOS-15-and-android-12#android-12" class="hash-link" aria-label="Direct link to Android 12" title="Direct link to Android 12">​</a></h2>
<p>Android 12 will be released this autumn and it introduces some changes which can potentially affect your app experience. Traditionally, Google Play requires target SDK of your app to be upgraded before November of the following year. (see requirements for previous release <a href="https://developer.android.com/distribute/best-practices/develop/target-sdk" target="_blank" rel="noopener noreferrer">here</a>).</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="what-to-watch-out-for-1">What to watch out for<a href="https://reactnative.dev/blog/2021/09/01/preparing-your-app-for-iOS-15-and-android-12#what-to-watch-out-for-1" class="hash-link" aria-label="Direct link to What to watch out for" title="Direct link to What to watch out for">​</a></h3>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="overscroll-effect">Overscroll Effect<a href="https://reactnative.dev/blog/2021/09/01/preparing-your-app-for-iOS-15-and-android-12#overscroll-effect" class="hash-link" aria-label="Direct link to Overscroll Effect" title="Direct link to Overscroll Effect">​</a></h4>
<p>Android 12 introduces new <a href="https://developer.android.com/about/versions/12/overscroll" target="_blank" rel="noopener noreferrer">overscroll effect</a> which affects all scroll containers. As React Native scroll views are based on the native views, we recommend to check your scrollable containers to ensure the effect is applied correctly. You can opt-out from it by setting <a href="https://reactnative.dev/docs/scrollview#overscrollmode-android"><code>overScrollMode</code></a> prop to <code>never</code>.</p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="permission-updates">Permission Updates<a href="https://reactnative.dev/blog/2021/09/01/preparing-your-app-for-iOS-15-and-android-12#permission-updates" class="hash-link" aria-label="Direct link to Permission Updates" title="Direct link to Permission Updates">​</a></h4>
<p>Android 12 allows users of your app to only provide access to the approximate location if you request it with <strong><code>ACCESS_FINE_LOCATION</code></strong> permission. Learn more about it <a href="https://developer.android.com/about/versions/12/approximate-location" target="_blank" rel="noopener noreferrer">here</a>.</p>
<p>Check out Google’s <a href="https://developer.android.com/about/versions/12/behavior-changes-all" target="_blank" rel="noopener noreferrer">detailed behavior changes</a> for all apps running on Android 12.</p>
<h3 class="anchor anchorWithStickyNavbar_JmGV" id="how-to-install-android-12">How to install Android 12<a href="https://reactnative.dev/blog/2021/09/01/preparing-your-app-for-iOS-15-and-android-12#how-to-install-android-12" class="hash-link" aria-label="Direct link to How to install Android 12" title="Direct link to How to install Android 12">​</a></h3>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="device-1">Device<a href="https://reactnative.dev/blog/2021/09/01/preparing-your-app-for-iOS-15-and-android-12#device-1" class="hash-link" aria-label="Direct link to Device" title="Direct link to Device">​</a></h4>
<p>If you have a spare Android device, check if you’re able to install Android 12 Beta via <a href="https://developer.android.com/about/versions/12/get" target="_blank" rel="noopener noreferrer">instructions here.</a></p>
<h4 class="anchor anchorWithStickyNavbar_JmGV" id="emulator">Emulator<a href="https://reactnative.dev/blog/2021/09/01/preparing-your-app-for-iOS-15-and-android-12#emulator" class="hash-link" aria-label="Direct link to Emulator" title="Direct link to Emulator">​</a></h4>
<p>If you don’t have a device available, you can set up an emulator following <a href="https://developer.android.com/about/versions/12/get#on_emulator" target="_blank" rel="noopener noreferrer">instructions here</a>.</p>]]></content:encoded>
            <category>engineering</category>
        </item>
    </channel>
</rss>