diff --git a/docs/appearance.md b/docs/appearance.md index 22cc758f47f..01bc93a7415 100644 --- a/docs/appearance.md +++ b/docs/appearance.md @@ -32,7 +32,7 @@ The color scheme preference will map to the user's Light or [Dark theme](https:/ :::info -The color scheme preference will map to the user's Light or [Dark Mode](https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/dark-mode/) preference on iOS 13 devices and higher. +The color scheme preference will map to the user's Light or [Dark Mode](https://developer.apple.com/design/human-interface-guidelines/dark-mode) preference on iOS 13 devices and higher. ::: :::note diff --git a/docs/appregistry.md b/docs/appregistry.md index 62ba81a928a..1efa32e945d 100644 --- a/docs/appregistry.md +++ b/docs/appregistry.md @@ -5,7 +5,7 @@ title: AppRegistry

Project with Native Code Required

-

If you are using the managed Expo workflow there is only ever one entry component registered with AppRegistry and it is handled automatically (or through registerRootComponent). You do not need to use this API.

+

If you are using the managed Expo workflow there is only ever one entry component registered with AppRegistry and it is handled automatically (or through registerRootComponent). You do not need to use this API.

`AppRegistry` is the JS entry point to running all React Native apps. App root components should register themselves with `AppRegistry.registerComponent`, then the native system can load the bundle for the app and then actually run the app when it's ready by invoking `AppRegistry.runApplication`. diff --git a/docs/colors.md b/docs/colors.md index 78dfcae70ce..d1350ddbd8d 100644 --- a/docs/colors.md +++ b/docs/colors.md @@ -6,7 +6,7 @@ title: Color Reference Components in React Native are [styled using JavaScript](style). Color properties usually match how [CSS works on the web](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). General guides on the color usage on each platform could be found below: - [Android](https://material.io/design/color/color-usage.html) -- [iOS](https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/color/) +- [iOS](https://developer.apple.com/design/human-interface-guidelines/color) ## Color APIs diff --git a/docs/dynamiccolorios.md b/docs/dynamiccolorios.md index 08b024d15f6..c2f3a4e6437 100644 --- a/docs/dynamiccolorios.md +++ b/docs/dynamiccolorios.md @@ -34,7 +34,7 @@ If you’re familiar with `@media (prefers-color-scheme: dark)` in CSS, this is :::info -The `DynamicColorIOS` function is similar to the iOS native methods [`UIColor colorWithDynamicProvider:`](https://developer.apple.com/documentation/uikit/uicolor/3238040-colorwithdynamicprovider). +The `DynamicColorIOS` function is similar to the iOS native methods [`UIColor colorWithDynamicProvider:`](). ::: diff --git a/docs/javascript-environment.md b/docs/javascript-environment.md index d66b5a996de..80564b3e57e 100644 --- a/docs/javascript-environment.md +++ b/docs/javascript-environment.md @@ -69,7 +69,7 @@ A full list of React Native's enabled transformations can be found in [@react-na Miscellaneous - + diff --git a/website/architecture/render-pipeline.md b/website/architecture/render-pipeline.md index b91a82438c1..12388a6beab 100644 --- a/website/architecture/render-pipeline.md +++ b/website/architecture/render-pipeline.md @@ -202,7 +202,7 @@ For most information in the _Shadow Tree_, React is the single owner and single However, there is one exception and important mechanism: components in C++ can contain state that is not directly exposed to JavaScript, and JavaScript is not the source of truth. C++ and _Host Platform_ control this _C++ State_. Generally, this is only relevant if you are developing a complicated _Host Component_ that needs _C++ State_. The vast majority of _Host Components_ do not need this functionality. -For example, `ScrollView` uses this mechanism to let the renderer know what the current offset is. The update is triggered from the _host platform_, specifically from the host view that represents the `ScrollView` component. The information about offset is used in an API like [measure](https://reactnative.dev/docs/direct-manipulation#measurecallback). Since this update stems from the host platform, and does not affect the React Element Tree, this state data is held by _C++ State_. +For example, `ScrollView` uses this mechanism to let the renderer know what the current offset is. The update is triggered from the _host platform_, specifically from the host view that represents the `ScrollView` component. The information about offset is used in an API like [measure](https://reactnative.dev/docs/legacy/direct-manipulation#measurecallback). Since this update stems from the host platform, and does not affect the React Element Tree, this state data is held by _C++ State_. Conceptually, _C++ State_ updates are similar to the [React State Updates](render-pipeline#react-state-updates) described above. With two important differences: diff --git a/website/blog/2015-03-26-react-native-bringing-modern-web-techniques-to-mobile.md b/website/blog/2015-03-26-react-native-bringing-modern-web-techniques-to-mobile.md index bed19b2953f..6f0136c6035 100644 --- a/website/blog/2015-03-26-react-native-bringing-modern-web-techniques-to-mobile.md +++ b/website/blog/2015-03-26-react-native-bringing-modern-web-techniques-to-mobile.md @@ -9,7 +9,7 @@ hero: '/blog/assets/dark-hero.png' tags: [announcement] --- -We introduced [React](https://code.facebook.com/projects/176988925806765/react/) to the world two years ago, and since then it's seen impressive growth, both inside and outside of Facebook. Today, even though no one is forced to use it, new web projects at Facebook are commonly built using React in one form or another, and it's being broadly adopted across the industry. Engineers are choosing to use React every day because it enables them to spend more time focusing on their products and less time fighting with their framework. It wasn't until we'd been building with React for a while, though, that we started to understand what makes it so powerful. +We introduced [React](https://react.dev/) to the world two years ago, and since then it's seen impressive growth, both inside and outside of Facebook. Today, even though no one is forced to use it, new web projects at Facebook are commonly built using React in one form or another, and it's being broadly adopted across the industry. Engineers are choosing to use React every day because it enables them to spend more time focusing on their products and less time fighting with their framework. It wasn't until we'd been building with React for a while, though, that we started to understand what makes it so powerful. React forces us to break our applications down into discrete components, each representing a single view. These components make it easier to iterate on our products, since we don't need to keep the entire system in our head in order to make changes to one part of it. More important, though, React wraps the DOM's mutative, imperative API with a declarative one, which raises the level of abstraction and simplifies the programming model. What we've found is that when we build with React, our code is a lot more predictable. This predictability makes it so we can iterate more quickly with confidence, and our applications are a lot more reliable as a result. Additionally, it's not only easier to scale our applications when they're built with React, but we've found it's also easier to scale the size of our teams themselves. diff --git a/website/blog/2016-03-24-introducing-hot-reloading.md b/website/blog/2016-03-24-introducing-hot-reloading.md index ed6988114ed..aa194a906c7 100644 --- a/website/blog/2016-03-24-introducing-hot-reloading.md +++ b/website/blog/2016-03-24-introducing-hot-reloading.md @@ -120,7 +120,7 @@ For `log` to pick up `time` changes, we'll need to clear its cached exports beca ## HMR API -HMR in React Native extends the module system by introducing the `hot` object. This API is based on [webpack](https://webpack.github.io/hot-module-replacement.md)'s one. The `hot` object exposes a function called `accept` which allows you to define a callback that will be executed when the module needs to be hot swapped. For instance, if we would change `time`'s code as follows, every time we save time, we'll see “time changed” in the console: +HMR in React Native extends the module system by introducing the `hot` object. This API is based on [webpack](https://webpack.js.org/concepts/hot-module-replacement/)'s one. The `hot` object exposes a function called `accept` which allows you to define a callback that will be executed when the module needs to be hot swapped. For instance, if we would change `time`'s code as follows, every time we save time, we'll see “time changed” in the console: ``` // time.js diff --git a/website/blog/2017-07-28-react-native-monthly-2.md b/website/blog/2017-07-28-react-native-monthly-2.md index a8a5e51f691..1e6cbbc1e2a 100644 --- a/website/blog/2017-07-28-react-native-monthly-2.md +++ b/website/blog/2017-07-28-react-native-monthly-2.md @@ -42,7 +42,7 @@ Here are the notes from each team: ### Expo -- Recently launched [Native Directory](https://native.directory) to help with discoverability and evaluation of libraries in React Native ecosystem. The problem: lots of libraries, hard to test, need to manually apply heuristics and not immediately obvious which ones are just the best ones that you should use. It's also hard to know if something is compatible with CRNA/Expo. So Native Directory tries to solve these problems. Check it out and [add your library](https://github.com/react-community/native-directory) to it. The list of libraries is in [here](https://github.com/react-community/native-directory/blob/master/react-native-libraries.json). This is just our first pass of it, and we want this to be owned and run by the community, not just Expo folks. So please pitch in if you think this is valuable and want to make it better! +- Recently launched [React Native Directory](https://reactnative.directory) to help with discoverability and evaluation of libraries in React Native ecosystem. The problem: lots of libraries, hard to test, need to manually apply heuristics and not immediately obvious which ones are just the best ones that you should use. It's also hard to know if something is compatible with CRNA/Expo. So Native Directory tries to solve these problems. Check it out and [add your library](https://github.com/react-community/native-directory) to it. The list of libraries is in [here](https://github.com/react-community/native-directory/blob/master/react-native-libraries.json). This is just our first pass of it, and we want this to be owned and run by the community, not just Expo folks. So please pitch in if you think this is valuable and want to make it better! - Added initial support for installing npm packages in [Snack](https://snack.expo.io/) with Expo SDK 19. Let us know if you run into any issues with it, we are still working through some bugs. Along with Native Directory, this should make it easy to test libraries that have only JS dependencies, or dependencies included in [Expo SDK](https://github.com/expo/expo-sdk). Try it out: - [react-native-modal](https://snack.expo.io/ByBCD_2r-) - [react-native-animatable](https://snack.expo.io/SJfJguhrW) diff --git a/website/blog/2017-09-21-react-native-monthly-4.md b/website/blog/2017-09-21-react-native-monthly-4.md index 43b0fab1c89..7310de87844 100644 --- a/website/blog/2017-09-21-react-native-monthly-4.md +++ b/website/blog/2017-09-21-react-native-monthly-4.md @@ -23,7 +23,7 @@ Trying to lower the entry barrier for the developers embracing React Native with - Will release SDK 21 shortly, which adds support for react-native 0.48.3 and a bunch of bugfixes/reliability improvements/new features in the Expo SDK, including video recording, a new splash screen API, support for `react-native-gesture-handler`, and improved error handling. - Re: [react-native-gesture-handler](https://github.com/kmagiera/react-native-gesture-handler), [Krzysztof Magiera](https://github.com/kmagiera) of [Software Mansion](https://swmansion.com/) continues pushing this forward and we've been helping him with testing it and funding part of his development time. Having this integrated in Expo in SDK21 will allow people to play with it easily in Snack, so we're excited to see what people come up with. - Re: improved error logging / handling - see [this gist of an internal Expo PR](https://gist.github.com/brentvatne/00407710a854627aa021fdf90490b958) for details on logging, (in particular, "Problem 2"), and [this commit](https://github.com/expo/xdl/commit/1d62eca293dfb867fc0afc920c3dad94b7209987) for a change that handles failed attempts to import npm standard library modules. There is plenty of opportunity to improve error messages upstream in React Native in this way and we will work on follow up upstream PRs. It would be great for the community to get involved too. -- [native.directory](https://native.directory/) continues to grow, you can add your projects from [the GitHub repo](https://github.com/react-community/native-directory). +- [React Native Directory](https://reactnative.directory/) continues to grow, you can add your projects from [the GitHub repo](https://github.com/react-community/native-directory). - Visit hackathons around North America, including [PennApps](https://pennapps.com/), [Hack The North](https://hackthenorth.com/), [HackMIT](https://hackmit.org/), and soon [MHacks](https://mhacks.org/). ### Facebook diff --git a/website/blog/2018-01-18-implementing-twitters-app-loading-animation-in-react-native.md b/website/blog/2018-01-18-implementing-twitters-app-loading-animation-in-react-native.md index f4468727dd9..19eac90e19b 100644 --- a/website/blog/2018-01-18-implementing-twitters-app-loading-animation-in-react-native.md +++ b/website/blog/2018-01-18-implementing-twitters-app-loading-animation-in-react-native.md @@ -282,6 +282,6 @@ This component has been published to npm and is on GitHub as [react-native-mask- ## More Reading / Extra Credit -1. [This gitbook](https://browniefed.com/react-native-animation-book/) is a great resource to learn more about Animated after you have read the React Native docs. +1. [This gitbook](https://github.com/browniefed/react-native-animation-book) is a great resource to learn more about Animated after you have read the React Native docs. 1. The actual Twitter animation seems to speed up the mask reveal towards the end. Try modifying the loader to use a different easing function (or a spring!) to better match that behavior. 1. The current end-scale of the mask is hard coded and likely won’t reveal the entire app on a tablet. Calculating the end scale based on screen size and image size would be an awesome PR. diff --git a/website/blog/2018-03-22-building-input-accessory-view-for-react-native.md b/website/blog/2018-03-22-building-input-accessory-view-for-react-native.md index 33194f0617f..febb6567a71 100644 --- a/website/blog/2018-03-22-building-input-accessory-view-for-react-native.md +++ b/website/blog/2018-03-22-building-input-accessory-view-for-react-native.md @@ -73,7 +73,7 @@ On iPhone X, text and emoji keyboard are different heights. Most applications us Another tricky bug we encountered was avoiding the home pill on iPhone X. You may be thinking, “Apple developed [safeAreaLayoutGuide](https://developer.apple.com/documentation/uikit/uiview/2891102-safearealayoutguide?language=objc) for this very reason, this is trivial!”. We were just as naive. The first issue is that the native `` implementation has no window to anchor to until the moment it is about to appear. That's alright, we can override `-(BOOL)becomeFirstResponder` and enforce layout constraints there. Adhering to these constraints bumps the accessory view up, but another bug arises: -The input accessory view successfully avoids the home pill, but now content behind the unsafe area is visible. The solution lies in this [radar](https://www.openradar.me/34411433). I wrapped the native `` hierarchy in a container which doesn't conform to the `safeAreaLayoutGuide` constraints. The native container covers the content in the unsafe area, while the `` stays within the safe area boundaries. +The input accessory view successfully avoids the home pill, but now content behind the unsafe area is visible. The solution lies in this [radar](https://openradar.appspot.com/34411433). I wrapped the native `` hierarchy in a container which doesn't conform to the `safeAreaLayoutGuide` constraints. The native container covers the content in the unsafe area, while the `` stays within the safe area boundaries.
diff --git a/website/blog/2018-05-07-using-typescript-with-react-native.md b/website/blog/2018-05-07-using-typescript-with-react-native.md index 71d928b8045..bdbb535049e 100644 --- a/website/blog/2018-05-07-using-typescript-with-react-native.md +++ b/website/blog/2018-05-07-using-typescript-with-react-native.md @@ -298,7 +298,7 @@ it('renders correctly with defaults', () => { }); ``` -The first time the test is run, it will create a snapshot of the rendered component and store it in the `components/__tests__/__snapshots__/Hello.tsx.snap` file. When you modify your component, you'll need to update the snapshots and review the update for inadvertent changes. You can read more about testing React Native components [here](https://facebook.github.io/jest/docs/en/tutorial-react-native.html). +The first time the test is run, it will create a snapshot of the rendered component and store it in the `components/__tests__/__snapshots__/Hello.tsx.snap` file. When you modify your component, you'll need to update the snapshots and review the update for inadvertent changes. You can read more about testing React Native components [here](https://jestjs.io/docs/tutorial-react-native). ## Next Steps diff --git a/website/blog/2020-07-17-react-native-principles.md b/website/blog/2020-07-17-react-native-principles.md index 28216641fc4..0e556de5800 100644 --- a/website/blog/2020-07-17-react-native-principles.md +++ b/website/blog/2020-07-17-react-native-principles.md @@ -12,7 +12,7 @@ Our top priority for React Native is to **match the expectations people have for For example, the TextInput in React Native renders to a UITextField on iOS. This ensures that integration with password managers and keyboard controls work out of the box. By using platform primitives, React Native apps are also able to stay up-to-date with design and behavior changes from new releases of Android and iOS. -In order to match the look-and-feel of native apps, we must also match their performance. This is where we focus our most ambitious efforts. For example, Facebook created Hermes, [a new JavaScript Engine built from scratch for React Native on Android](https://facebook.github.io/react-native/blog/2019/07/17/hermes). Hermes significantly improves the start time of React Native apps. We are also working on major architectural changes that optimize the threading model and make React Native easier to interoperate with native code. +In order to match the look-and-feel of native apps, we must also match their performance. This is where we focus our most ambitious efforts. For example, Facebook created Hermes, [a new JavaScript Engine built from scratch for React Native on Android](/blog/2019/07/17/hermes). Hermes significantly improves the start time of React Native apps. We are also working on major architectural changes that optimize the threading model and make React Native easier to interoperate with native code. ## Massive Scale diff --git a/website/blog/2021-10-26-toward-hermes-being-the-default.mdx b/website/blog/2021-10-26-toward-hermes-being-the-default.mdx index 6c2cdc097ed..72c3ab9ed6d 100644 --- a/website/blog/2021-10-26-toward-hermes-being-the-default.mdx +++ b/website/blog/2021-10-26-toward-hermes-being-the-default.mdx @@ -65,7 +65,7 @@ We acknowledge there are still blockers that prevent parts of the community from - [`Proxy` and `Reflect`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Meta_programming) 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 [the most requested feature](https://github.com/facebook/hermes/issues/33) of Hermes due to popular libraries such as [MobX](https://mobx.js.org/README.html) and [Immer](https://immerjs.github.io/immer/). 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 [release v0.4](https://github.com/facebook/hermes/issues/33#issuecomment-668374607) and [v0.5](https://github.com/facebook/hermes/issues/33#issuecomment-668374607), and it’s [enabled by default starting from v0.7](https://github.com/facebook/hermes/releases/tag/v0.7.0). - [ECMAScript Internationalization API Specification (ECMA-402, or `Intl`)](https://hermesengine.dev/docs/intl) was [the second most requested feature](https://github.com/facebook/hermes/issues/23). `Intl` is a huge set of APIs and often requires the implementation to include **6MB worth** of [Unicode CLDR](https://cldr.unicode.org/index) data. This is why polyfills like [FormatJS (a.k.a. `react-intl`)](https://github.com/formatjs/formatjs) and JS engines like the [international variant build of community JSC](https://github.com/react-native-community/jsc-android-buildscripts#international-variant) 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. - Microsoft collaborated to build support on Android. It covers almost everything from ECMA-402 up to ES2020, **with only a size impact as small as 3% (57-62K per ABI)**. We ran [a poll on Twitter](https://twitter.com/tmikov/status/1336442786694893568) and the results were strongly in favor of including `Intl` by default, so that’s what we did and it’s available starting from [release v0.8](https://github.com/facebook/hermes/releases/tag/v0.8.0). - - Facebook has sponsored [Major League Hacking](https://mlh.io/) to launch a [remote open source fellowship program](https://news.mlh.io/welcoming-facebook-back-as-a-sponsor-of-the-2020-2021-mlh-fellowship-08-12-2020). Last year, we launched the [Hermes sampling profiler](https://reactnative.dev/docs/profile-hermes). This year, our fellows will be working with members from Hermes, React Native, and Callstack, to add support for Hermes `Intl` on iOS. Stayed tuned! + - Facebook has sponsored [Major League Hacking](https://mlh.io/) to launch a [remote open source fellowship program](https://news.mlh.io/welcoming-facebook-back-as-a-sponsor-of-the-2020-2021-mlh-fellowship-08-12-2020). Last year, we launched the [Hermes sampling profiler](https://reactnative-archive-august-2023.netlify.app/docs/0.66/profile-hermes). This year, our fellows will be working with members from Hermes, React Native, and Callstack, to add support for Hermes `Intl` on iOS. Stayed tuned! - We appreciate that people have been working with us to discover issues affecting the community. - People have helped us identify critical spec divergence such as [stability of `Array.prototype.sort`](https://github.com/facebook/hermes/issues/212) amended in [ES2019](https://github.com/tc39/ecma262/pull/1340). This has been fixed and will be available in the next release. - People found out that our default heap size limit was too small and caused [unnecessary GC pressure](https://github.com/facebook/hermes/issues/295) and [OOM crashes](https://github.com/facebook/hermes/issues/511) 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. diff --git a/website/contributing/how-to-contribute-code.md b/website/contributing/how-to-contribute-code.md index 4bff72313b0..ea72139397b 100644 --- a/website/contributing/how-to-contribute-code.md +++ b/website/contributing/how-to-contribute-code.md @@ -25,7 +25,7 @@ Now you are set up to run several commands: - `yarn test` runs the Jest-based JavaScript test suite. - `yarn test --watch` runs an interactive JavaScript test watcher. - `yarn test ` runs JavaScript tests with matching filenames. -- `yarn flow` runs the [Flow](https://flowtype.org/) typechecks. +- `yarn flow` runs the [Flow](https://flow.org/) typechecks. - `yarn flow-check-android` does a full Flow check over `*.android.js` files. - `yarn flow-check-ios` does a full Flow check over `*.ios.js` files. - `yarn test-typescript` runs the [TypeScript](https://www.typescriptlang.org/) typechecks. diff --git a/website/contributing/how-to-run-and-write-tests.md b/website/contributing/how-to-run-and-write-tests.md index fe1cee3603f..d1d9b762c37 100644 --- a/website/contributing/how-to-run-and-write-tests.md +++ b/website/contributing/how-to-run-and-write-tests.md @@ -16,7 +16,7 @@ yarn test This will run tests using [Jest](https://jestjs.io). -You should also make sure your code passes [Flow](https://flowtype.org/) and lint tests: +You should also make sure your code passes [Flow](https://flow.org/) and lint tests: ```bash yarn flow