Skip to content

Commit 4fdfde2

Browse files
cut 78 docs (#1010)
## Description Cut 78 documentation ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/react-native-windows-samples/pull/1010) --------- Co-authored-by: Jon Thysell <[email protected]>
1 parent 28b1874 commit 4fdfde2

File tree

8 files changed

+288
-4
lines changed

8 files changed

+288
-4
lines changed

website/.unbroken_exclusions

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
!versioned_docs/version-0.75/native-api/*-api-windows*.md
1717
!versioned_docs/version-0.76/native-api/*-api-windows*.md
1818
!versioned_docs/version-0.77/native-api/*-api-windows*.md
19+
!versioned_docs/version-0.78/native-api/*-api-windows*.md
1920

2021
# See Issue 410
2122
File not found IReactContext while parsing versioned_docs/version-0.64/native-modules-advanced.md
@@ -30,6 +31,16 @@ File not found native-api/ReactNativeHost-api-windows.md while parsing versioned
3031
File not found IViewManagerCreateWithProperties while parsing versioned_docs/version-0.76/view-managers.md
3132

3233
#fix-unbroken.js auto-generated do not edit this line or below
34+
File not found getting-started.md while parsing versioned_docs/version-0.78/getting-started.md
35+
File not found new-architecture.md while parsing versioned_docs/version-0.78/getting-started.md
36+
File not found autolink-windows-cli.md while parsing versioned_docs/version-0.78/getting-started.md
37+
File not found init-windows-cli.md while parsing versioned_docs/version-0.78/getting-started.md
38+
File not found run-windows-cli.md while parsing versioned_docs/version-0.78/getting-started.md
39+
File not found native-modules.md while parsing versioned_docs/version-0.78/getting-started.md
40+
File not found rnw-dependencies.md while parsing versioned_docs/version-0.78/getting-started.md
41+
File not found autolink-windows-cli.md while parsing versioned_docs/version-0.78/native-modules-autolinking.md
42+
File not found run-windows-cli.md while parsing versioned_docs/version-0.78/native-modules-autolinking.md
43+
File not found config.md while parsing versioned_docs/version-0.78/native-modules-autolinking.md
3344
File not found getting-started.md while parsing versioned_docs/version-0.77/getting-started.md
3445
File not found new-architecture.md while parsing versioned_docs/version-0.77/getting-started.md
3546
File not found autolink-windows-cli.md while parsing versioned_docs/version-0.77/getting-started.md

website/pages/en/support.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ The React Native for Windows (RNW) Team strives to provide full support for the
1616
| Version | Support Phase | Release Date | Active Support Start | Maintenance Support Start | End of Support |
1717
| -- | -- | -- | -- | -- | -- |
1818
| [main](https://www.npmjs.com/package/react-native-windows/v/canary) | [Canary](#canary-support) | *N/A* | *N/A* | *N/A* | *N/A* |
19-
| [0.77](https://www.npmjs.com/package/react-native-windows/v/latest) | [Active](#active-support) | 01/24/2025 | 01/24/2025 | *TBD* | *TBD* |
20-
| [0.76](https://www.npmjs.com/package/react-native-windows/v/v0.76-stable) | [Active](#active-support) | 11/11/2024 | 11/11/2024 | 02/28/2025 | 04/30/2025 |
21-
| [0.75](https://www.npmjs.com/package/react-native-windows/v/v0.75-stable) | [Maintenance](#active-support) | 8/19/2024 | 8/19/2024 | 12/31/2024 | 02/28/2025 |
19+
| [0.78](https://www.npmjs.com/package/react-native-windows/v/latest) | [Active](#active-support) | 02/27/2025 | 02/27/2025 | *TBD* | *TBD* |
20+
| [0.77](https://www.npmjs.com/package/react-native-windows/v/v0.77-stable) | [Active](#active-support) | 01/24/2025 | 01/24/2025 | 03/27/2025 | 05/31/2025 |
21+
| [0.76](https://www.npmjs.com/package/react-native-windows/v/v0.76-stable) | [Maintenance](#active-support) | 11/11/2024 | 11/11/2024 | 02/28/2025 | 04/30/2025 |
22+
| [0.75](https://www.npmjs.com/package/react-native-windows/v/v0.75-stable) | [Unsupported](#unsupported) | 8/19/2024 | 8/19/2024 | 12/31/2024 | 02/28/2025 |
2223
| [0.74](https://www.npmjs.com/package/react-native-windows/v/v0.74-stable) | [Unsupported](#unsupported) | 4/29/2024 | 4/29/2024 | 9/30/2024 | 11/30/2024 |
2324
| [0.73](https://www.npmjs.com/package/react-native-windows/v/v0.73-stable) | [Unsupported](#unsupported) | 12/11/2023 | 12/11/2023 | 5/31/2024 | 7/31/2024 |
2425
| [0.72](https://www.npmjs.com/package/react-native-windows/v/v0.72-stable) | [Unsupported](#unsupported) | 06/23/2023 | 06/23/2023 | 01/31/2024 | 03/31/2024 |

website/siteConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// See https://docusaurus.io/docs/site-config for all the possible
99
// site configuration options.
1010

11-
const defaultVersionShown = "0.77";
11+
const defaultVersionShown = "0.78";
1212
const repoUrl = "https://github.com/microsoft/react-native-windows";
1313

1414
const siteConfig = {
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
---
2+
id: version-0.78-getting-started
3+
title: Get Started with Windows
4+
original_id: getting-started
5+
---
6+
7+
This guide will help you get started on setting up your very first React Native for Windows app.
8+
9+
Make sure you have installed all of the [development dependencies](rnw-dependencies.md).
10+
11+
For information around how to set up React Native, see the [React Native Getting Started Guide](https://reactnative.dev/docs/getting-started).
12+
13+
> **Interested in migrating to [React Native's New Architecture](https://reactnative.dev/architecture/landing-page)?** New Architecture support in React Native for Windows is now available to preview in 0.76. Note there are several key changes, so if you’d like to be an early adopter, check out the information in the [New Architecture Guide](new-architecture.md).
14+
15+
## Create a new React Native project
16+
17+
Remember to call `@react-native-community/cli init` from the place you want your project directory to live.
18+
19+
<!-- Note, make sure both `@react-native-community/cli@ABC` and `--version "XYZ"` are pointing to the correct NPM tags in the command below. -->
20+
21+
<!-- 1. For the next version (i.e. in docs/getting-started.md) use "next" for the CLI and "nightly" for the RN version -->
22+
<!-- 2. For the latest stable version in versioned_docs use "^0.xx.0" for both the CLI and RN version -->
23+
<!-- 3. For older stable versions you'll have to look up the CLI version, but for the RN version use the stable tag name, i.e. "0.73-stable" -->
24+
25+
<!-- See https://www.npmjs.com/package/@react-native-community/cli?activeTab=versions for the CLI version tags. -->
26+
<!-- See https://www.npmjs.com/package/react-native?activeTab=versions for the RN version tags. -->
27+
28+
```bat
29+
npx --yes @react-native-community/cli@next init <projectName> --version ^0.78.0
30+
```
31+
32+
### Navigate into this newly created directory
33+
34+
React Native will have created your project in a new sub-directory, which you must enter before continuing.
35+
36+
```bat
37+
cd <projectName>
38+
```
39+
40+
### Add React Native Windows to your project's dependencies
41+
42+
<!-- Note, make sure "version" is pointing to the correct react-native-windows NPM tag in the command below. -->
43+
44+
<!-- 1. For the next version (i.e. in docs/getting-started.md) use "canary" -->
45+
<!-- 2. For other versions in versioned_docs use the version in the format "^0.XY.0" -->
46+
47+
<!--DOCUSAURUS_CODE_TABS-->
48+
49+
<!--Using Yarn (Recommended)-->
50+
51+
```bat
52+
yarn add react-native-windows@^0.78.0
53+
```
54+
55+
<!--Using NPM-->
56+
57+
```bat
58+
npm install --save react-native-windows@^0.78.0
59+
```
60+
61+
<!--END_DOCUSAURUS_CODE_TABS-->
62+
63+
### Initialize the React Native Windows native code and projects
64+
65+
Lastly, initialize the React Native for Windows application with the [init-windows command](init-windows-cli.md):
66+
67+
```bat
68+
npx react-native init-windows --overwrite
69+
```
70+
71+
> **Note:** RNW templates contain a customized `metro.config.js` file, which is meant to merge cleanly into the default config provided by the standard React Native project template. If you are starting a new app, overwriting `metro.config.js` should have no impact. However, if you are adding Windows to an existing app with an already modified `metro.config.js` file, please make sure to back up and re-apply your modifications after adding RNW.
72+
73+
## Running a React Native Windows App
74+
75+
> Make sure a browser is launched and running before running a React Native Windows app.
76+
> Also ensure your system meets all the [requirements](rnw-dependencies.md) to build a Windows app as well.
77+
78+
- Without Using Visual Studio
79+
80+
In your React Native Windows project directory, run the [run-windows command](run-windows-cli.md):
81+
82+
```bat
83+
npx react-native run-windows
84+
```
85+
86+
A new Command Prompt window will open with the React packager as well as your React Native for Windows app. This step may take a while during first run since it involves building the entire project and all dependencies. You can now start developing! :tada:
87+
88+
- Using Visual Studio
89+
90+
- From the root of the project directory, run the [autolink-windows command](autolink-windows-cli.md), which will automatically link your app's dependencies:
91+
```bat
92+
npx react-native autolink-windows
93+
```
94+
- Open the solution file in the application folder in Visual Studio (e.g., `AwesomeProject/windows/AwesomeProject.sln` if you used `AwesomeProject` as `<projectName>`)
95+
- Select the `Debug` configuration and the `x64` platform from the combo box controls to the left of the `Run` button and underneath the `Team` and `Tools` menu item.
96+
- Run `yarn start` (or `npm start`) from your project directory, and wait for the React Native packager to report success.
97+
- Click the `Run` button to the right of the platform combo box control in VS, or select the `Debug`->`Start without Debugging` menu item. You now see your new app and Chrome should have loaded `http://localhost:8081/debugger-ui/` in a new tab. Press `F12` or `Ctrl+Shift+I` in Chrome to open its Developer Tools. :tada:
98+
99+
- With VS Code
100+
- Open your applications folder in VS Code.
101+
- Install the [React Native Tools](https://marketplace.visualstudio.com/items?itemName=msjsdiag.vscode-react-native) plugin for VS Code.
102+
- Create a new file in the applications root directory, `.vscode/launch.json` and paste the following configuration:
103+
```json
104+
{
105+
"version": "0.2.0",
106+
"configurations": [
107+
{
108+
"name": "Debug Windows",
109+
"cwd": "${workspaceFolder}",
110+
"type": "reactnative",
111+
"request": "launch",
112+
"platform": "windows"
113+
}
114+
]
115+
}
116+
```
117+
- Press `F5` or navigate to the debug menu (alternatively press `Ctrl+Shift+D`) and in the Debug drop-down select "Debug Windows" and press the green arrow to run the application.
118+
119+
## Authoring Native Modules
120+
121+
See [Native Modules and React Native Windows](native-modules.md).
122+
123+
## Building a standalone React Native Windows App
124+
125+
Follow these steps to build a version of your app that you can install or publish to the store. This version will package your bundle and assets into the APPX package so you don't need to run Metro.
126+
127+
- Open the solution in Visual Studio
128+
- Select the Release configuration from the Configuration Manager drop-down.
129+
- Build the solution. You can now launch without first launching Metro.
130+
- If you want to build an APPX package to share or publish, use the **Project** > **Publish** > **Create App Packages...** option.
131+
132+
> The Debug configuration uses the Web Debugger by default, which means the application's JavaScript code runs in Chrome.<br>
133+
> If you're getting different runtime behavior between the Release and Debug configurations, consider disabling the `UseWebDebugger` setting in [`App.cpp`](https://github.com/microsoft/react-native-windows/blob/6b415659aa017dbc41e3f28e817fb768a8e80435/vnext/template/cpp-app/src/App.cpp#L30) or [`App.xaml.cs`](https://github.com/microsoft/react-native-windows/blob/6b415659aa017dbc41e3f28e817fb768a8e80435/vnext/template/cs-app/src/App.xaml.cs#L20) to get the same behavior in the Debug configuration.
134+
135+
See also this article for additional details: https://techcommunity.microsoft.com/t5/windows-dev-appconsult/getting-started-with-react-native-for-windows/ba-p/912093#
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
id: version-0.78-native-modules-autolinking
3+
title: Autolinking Native Modules
4+
original_id: native-modules-autolinking
5+
---
6+
7+
Autolinking is a mechanism that allows your React Native app project to discover and use native modules and view managers provided by React Native libraries.
8+
9+
This document covers autolinking for the Windows platform. It is an extension to the [React Native CLI Autolinking doc](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md).
10+
11+
Add a library using your favorite package manager and run the build:
12+
13+
```bat
14+
yarn add react-native-webview
15+
npx react-native run-windows
16+
```
17+
18+
That's it. No more editing native files to use native code.
19+
20+
## How does it work
21+
22+
From the [React Native CLI Autolinking doc](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-does-it-work):
23+
24+
> Each platform defines its own [`platforms`](https://github.com/react-native-community/cli/blob/master/docs/platforms.md) configuration. It instructs the CLI on how to find information about native dependencies. This information is exposed through the [`config`](https://github.com/react-native-community/cli/blob/master/docs/commands.md#config) command in a JSON format. It's then used by the scripts run by the platform's build tools. Each script applies the logic to link native dependencies specific to its platform.
25+
26+
The information provided by `config` is described in [React Native Config Schema](config.md).
27+
28+
## Autolinking process
29+
30+
Autolinking is performed automatically as a part of the [run-windows command](run-windows-cli.md):
31+
32+
1. At build time, autolinking is performed first, before `msbuild.exe` is invoked and the build actually started. It uses the information provided by `config` to both generate and modify certain native files consumed by your app project.
33+
1. The `AutolinkedNativeModules.g.props` and `AutolinkedNativeModules.g.targets` file contains the necessary references to the dependency projects that must be built.
34+
> Your app's solution file may also be modified to ensure the dependency projects will be built.
35+
36+
1. The `AutolinkedNativeModules.g.(cpp|cs)` files contain a `RegisterAutolinkedNativeModulePackages` method which registers all of the specified `IReactPackageProvider`s from the dependencies.
37+
1. At build time, while `msbuild.exe` is running, but before compiling your app project, a check will verify that the autolinked files are up-to-date, and warn you if they aren't.
38+
> If you're using `run-windows` this check should always pass. However, if you've manually edited the generated files, or changed your npm dependencies and are building manually with Visual Studio, then the check might fail. See [manually run autolinking](#manually-run-autolinking).
39+
1. At runtime, when your app is starting up it will call `RegisterAutolinkedNativeModulePackages`, registering the native dependencies with React Native, making them available to JS code.
40+
41+
## Alternatives
42+
43+
### Manually run autolinking
44+
45+
If you would like to run the autolinking process outside of the build, you can run the [autolink-windows command](autolink-windows-cli.md) manually at any time.
46+
47+
### Skipping autolinking
48+
49+
If you would like to skip the autolinking process during [run-windows command](run-windows-cli.md) you can pass `--no-autolink` option:
50+
51+
```bat
52+
npx react-native run-windows --no-autolink
53+
```
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
id: version-0.78-native-modules-vs-turbo-modules
3+
title: Native Modules vs Turbo Modules
4+
original_id: native-modules-vs-turbo-modules
5+
---
6+
7+
If you've worked with React Native, you may be familiar with the concept of Native Modules, which allow JavaScript and platform-native code to communicate over the React Native "bridge", which handles cross-platform serialization via JSON.
8+
9+
TurboModules are the next iteration of Native Modules that provide a few extra benefits, in particular these modules use JSI, a JavaScript interface for native code, which allows for more efficient communication between native and JavaScript code than the bridge.
10+
11+
### How to migrate to TurboModules
12+
13+
Modules running as TurboModules will be available in the JS from `TurboModuleRegistry.get('<modulename>')` instead of `NativeModules.<modulename>`. So your JavaScript will have to be updated before switching. Ideally while you are at it, you should switch your modules to use [Spec files](https://reactnative.dev/docs/the-new-architecture/pillars-turbomodules#2-javascript-specification). This will make your modules compatible with codegen.
14+
15+
>**Note:** `TurboModuleRegistry` will fallback to returning a native module instead of a turbo module if there is a native module registered from the native code. So you can update your JavaScript before updating your native code.
16+
17+
Starting in version 0.71, JS/TS spec files can codegen C++ spec files that can verify that the native implementation matches the definition in JS. In addition modules can now be run as TurboModules instead of as a Native Module simply by using adding an additional parameter to your call to `AddAttributedModules`:
18+
19+
```cpp
20+
AddAttributedModules(packageBuilder, true);
21+
```
22+
23+
Alternatively if you are registering modules more manually by calling `IReactPackageBuilder.AddModule`, you can call `IReactPackageBuilder.AddTurboModule` instead.
24+
25+
### Additional differences running as Native Module vs TurboModule
26+
27+
After creating a spec in JS, you should see JS type errors showing that constants should be accessed using `MyModule.getConstants().myconst` instead of `MyModule.myconst`. If you fail to update you accesses of `myconst` the field will continue to work when the module is running as a Native Module, since Native Modules promote all the constants to fields on the module. This behavior does not happen with TurboModules, so the `myconst` field will be undefined. Calls using `getConstants().myconst` will work both for Native Modules and TurboModules.
28+
29+
### Web Debugging Behavior
30+
31+
TurboModules cannot run when using Remote Debugging / Web Debugging. React-Native-Windows will attempt to run a TurboModule as a native module when running in that mode, but if the module is using JSI directly, that fallback may not work.
32+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
id: version-0.78-rnm-getting-started
3+
title: Get Started with macOS
4+
original_id: rnm-getting-started
5+
---
6+
7+
This guide will help you get started on setting up your very first React Native for macOS app.
8+
9+
>** Latest stable version available for React Native for macOS is 0.76**
10+
11+
For information around how to set up:
12+
- React Native for iOS and Android: See [React Native Getting Started Guide](https://reactnative.dev/docs/getting-started)
13+
- React Native for Windows: See [React Native for Windows Getting Started Guide](https://microsoft.github.io/react-native-windows/docs/getting-started)
14+
15+
## Install React Native for macOS
16+
17+
Remember to call `react-native init` from the place you want your project directory to live. Be sure to use the same minor version between React Native and React Native macOS. We'll use `^0.71.0`
18+
19+
```
20+
npx react-native@latest init <projectName> --version 0.76.0
21+
```
22+
23+
### Navigate into this newly created directory
24+
25+
Once your project has been initialized, React Native will have created a new sub directory where all your generated files live.
26+
27+
```
28+
cd <projectName>
29+
```
30+
31+
### Install the macOS extension
32+
33+
Install the React Native for macOS packages.
34+
35+
```
36+
npx react-native-macos-init
37+
```
38+
39+
## Running a React Native macOS App
40+
41+
- **Without using Xcode**:
42+
In your React Native macOS project directory, run:
43+
44+
```
45+
npx react-native run-macos
46+
```
47+
48+
- **Using Xcode**:
49+
Open `macos\test.xcworkspace` in Xcode or run `xed -b macos`; `yarn start`. Hit the Run button.
50+
51+
A new Command Prompt window will open with the React packager as well as a `react-native-macos` app. This step may take a while during first run since it involves building the entire project and all dependencies. You can now start developing! 🎉

website/versions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[
2+
"0.78",
23
"0.77",
34
"0.76",
45
"0.75",

0 commit comments

Comments
 (0)