Skip to content

Commit

Permalink
Cut docs for 76 (#990)
Browse files Browse the repository at this point in the history
## Description
Cuts the docs for 76 release!
Also resolves #987

###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/react-native-windows-samples/pull/990)

---------

Co-authored-by: Jon Thysell <[email protected]>
  • Loading branch information
TatianaKapos and jonthysell authored Nov 12, 2024
1 parent c64d7f3 commit 286799b
Show file tree
Hide file tree
Showing 24 changed files with 1,505 additions and 9 deletions.
5 changes: 0 additions & 5 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ npx react-native init-windows --overwrite

> **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.
> **Note:** Previous versions of the RNW Getting Started steps recommend the use of the `react-native-windows-init` command, which is being phased out. For documentation of that command, see: [React Native Windows Init CLI](https://microsoft.github.io/react-native-windows/init-cli).
## Running a React Native Windows App

> Make sure a browser is launched and running before running a React Native Windows app.
Expand Down Expand Up @@ -134,6 +132,3 @@ Follow these steps to build a version of your app that you can install or publis
> 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.
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#

</body>
</html>
18 changes: 18 additions & 0 deletions docs/native-api/EmitEventSetterDelegate-api-windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
id: EmitEventSetterDelegate
title: EmitEventSetterDelegate
---

Kind: `delegate`

A delegate gets the arguments for an event emit on a EventEmitter.

## Invoke
void **`Invoke`**([`JSValueArgWriter`](JSValueArgWriter) argWriter)





## Referenced by
- [`EventEmitterInitializerDelegate`](EventEmitterInitializerDelegate)
18 changes: 18 additions & 0 deletions docs/native-api/EventEmitterInitializerDelegate-api-windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
id: EventEmitterInitializerDelegate
title: EventEmitterInitializerDelegate
---

Kind: `delegate`

A delegate to call a turbo module EventEmitter.

## Invoke
void **`Invoke`**([`EmitEventSetterDelegate`](EmitEventSetterDelegate) emitter)





## Referenced by
- [`IReactModuleBuilder`](IReactModuleBuilder)
7 changes: 7 additions & 0 deletions docs/native-api/IReactModuleBuilder-api-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ Adds a constant provider method to define constants for the native module. See [



### AddEventEmitter
void **`AddEventEmitter`**(string name, [`EventEmitterInitializerDelegate`](EventEmitterInitializerDelegate) emitter)

Adds an EventEmitter to the turbo module. See [`EventEmitterInitializerDelegate`](EventEmitterInitializerDelegate).



### AddInitializer
void **`AddInitializer`**([`InitializerDelegate`](InitializerDelegate) initializer)

Expand Down
1 change: 1 addition & 0 deletions docs/native-api/JSValueArgWriter-api-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ void **`Invoke`**([`IJSValueWriter`](IJSValueWriter) writer)


## Referenced by
- [`EmitEventSetterDelegate`](EmitEventSetterDelegate)
- [`IReactContext`](IReactContext)
- [`ReactRootView`](ReactRootView)
- [`ReactViewOptions`](ReactViewOptions)
Expand Down
2 changes: 2 additions & 0 deletions docs/native-api/index-api-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ sidebar_label: Full reference
- [`AccessibilityActionEventHandler`](AccessibilityActionEventHandler)
- [`AccessibilityInvokeEventHandler`](AccessibilityInvokeEventHandler)
- [`ConstantProviderDelegate`](ConstantProviderDelegate)
- [`EmitEventSetterDelegate`](EmitEventSetterDelegate)
- [`EventEmitterInitializerDelegate`](EventEmitterInitializerDelegate)
- [`InitializerDelegate`](InitializerDelegate)
- [`JSValueArgWriter`](JSValueArgWriter)
- [`JsiByteArrayUser`](JsiByteArrayUser)
Expand Down
17 changes: 17 additions & 0 deletions website/.unbroken_exclusions
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
!versioned_docs/version-0.73/native-api/*-api-windows*.md
!versioned_docs/version-0.74/native-api/*-api-windows*.md
!versioned_docs/version-0.75/native-api/*-api-windows*.md
!versioned_docs/version-0.76/native-api/*-api-windows*.md

# See Issue 410
File not found IReactContext while parsing versioned_docs/version-0.64/native-modules-advanced.md
Expand All @@ -25,8 +26,24 @@ File not found IViewManagerCreateWithProperties while parsing versioned_docs/ver
File not found native-api/IReactPackageProvider-api-windows.md while parsing versioned_docs/version-0.72/coreapp.md
File not found native-api/IReactContext-api-windows.md while parsing versioned_docs/version-0.72/native-modules-advanced.md
File not found native-api/ReactNativeHost-api-windows.md while parsing versioned_docs/version-0.72/native-modules-advanced.md
File not found IViewManagerCreateWithProperties while parsing versioned_docs/version-0.76/view-managers.md

#fix-unbroken.js auto-generated do not edit this line or below
File not found autolink-windows-cli.md while parsing versioned_docs/version-0.76/getting-started.md
File not found getting-started.md while parsing versioned_docs/version-0.76/getting-started.md
File not found init-windows-cli.md while parsing versioned_docs/version-0.76/getting-started.md
File not found run-windows-cli.md while parsing versioned_docs/version-0.76/getting-started.md
File not found native-modules.md while parsing versioned_docs/version-0.76/getting-started.md
File not found rnw-dependencies.md while parsing versioned_docs/version-0.76/getting-started.md
File not found getting-started.md while parsing versioned_docs/version-0.76/new-architecture.md
File not found init-windows-cli.md while parsing versioned_docs/version-0.76/new-architecture.md
File not found getting-started.md while parsing versioned_docs/version-0.76/nuget.md
File not found init-windows-cli.md while parsing versioned_docs/version-0.76/nuget.md
File not found supported-community-modules.md while parsing versioned_docs/version-0.76/nuget.md
File not found getting-started.md while parsing versioned_docs/version-0.76/view-managers.md
File not found init-windows-cli.md while parsing versioned_docs/version-0.76/view-managers.md
File not found native-modules-setup.md while parsing versioned_docs/version-0.76/view-managers.md
File not found native-modules.md while parsing versioned_docs/version-0.76/view-managers.md
File not found run-windows-cli.md while parsing versioned_docs/version-0.75/autolink-windows-cli.md
File not found run-windows-cli.md while parsing versioned_docs/version-0.75/debugging-javascript.md
File not found getting-started.md while parsing versioned_docs/version-0.75/getting-started.md
Expand Down
3 changes: 2 additions & 1 deletion website/pages/en/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ The React Native for Windows (RNW) Team strives to provide full support for the
| Version | Support Phase | Release Date | Active Support Start | Maintenance Support Start | End of Support |
| -- | -- | -- | -- | -- | -- |
| [main](https://www.npmjs.com/package/react-native-windows/v/canary) | [Canary](#canary-support) | *N/A* | *N/A* | *N/A* | *N/A* |
| [0.75](https://www.npmjs.com/package/react-native-windows/v/latest) | [Active](#active-support) | 8/19/2024 | 8/19/2024 | *TBD* | *TBD* |
| [0.76](https://www.npmjs.com/package/react-native-windows/v/latest) | [Active](#active-support) | 11/11/2024 | 11/11/2024 | *TBD* | *TBD* |
| [0.75](https://www.npmjs.com/package/react-native-windows/v/v0.75-stable) | [Active](#active-support) | 8/19/2024 | 8/19/2024 | 12/31/2024 | 02/28/2025 |
| [0.74](https://www.npmjs.com/package/react-native-windows/v/v0.74-stable) | [Maintenance](#maintenance-support) | 4/29/2024 | 4/29/2024 | 9/30/2024 | 11/30/2024 |
| [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 |
| [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 |
Expand Down
2 changes: 1 addition & 1 deletion website/siteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// See https://docusaurus.io/docs/site-config for all the possible
// site configuration options.

const defaultVersionShown = "0.75";
const defaultVersionShown = "0.76";
const repoUrl = "https://github.com/microsoft/react-native-windows";

const siteConfig = {
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-0.74/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Remember to call `@react-native-community/cli init` from the place you want your
<!-- See https://www.npmjs.com/package/react-native?activeTab=versions for the RN version tags. -->

```bat
npx --yes @react-native-community/cli@latest init <projectName> --version "latest"
npx --yes @react-native-community/cli@latest init <projectName> --version "0.74-stable"
```

### Navigate into this newly created directory
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-0.75/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Remember to call `@react-native-community/cli init` from the place you want your
<!-- See https://www.npmjs.com/package/react-native?activeTab=versions for the RN version tags. -->

```bat
npx --yes @react-native-community/cli@next init <projectName> --version "latest"
npx --yes @react-native-community/cli@latest init <projectName> --version "0.75-stable"
```

### Navigate into this newly created directory
Expand Down
136 changes: 136 additions & 0 deletions website/versioned_docs/version-0.76/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
---
id: version-0.76-getting-started
title: Get Started with Windows
original_id: getting-started
---

This guide will help you get started on setting up your very first React Native for Windows app.

Make sure you have installed all of the [development dependencies](rnw-dependencies.md).

For information around how to set up React Native, see the [React Native Getting Started Guide](https://reactnative.dev/docs/getting-started).

> **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).
## Create a new React Native project

Remember to call `@react-native-community/cli init` from the place you want your project directory to live.

<!-- Note, make sure both `@react-native-community/cli@ABC` and `--version "XYZ"` are pointing to the correct NPM tags in the command below. -->

<!-- 1. For the next version (i.e. in docs/getting-started.md) use "next" for the CLI and "nightly" for the RN version -->
<!-- 2. For the latest stable version in versioned_docs use "latest" for both the CLI and RN version -->
<!-- 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" -->

<!-- See https://www.npmjs.com/package/@react-native-community/cli?activeTab=versions for the CLI version tags. -->
<!-- See https://www.npmjs.com/package/react-native?activeTab=versions for the RN version tags. -->

```bat
npx --yes @react-native-community/cli@latest init <projectName> --version "latest"
```

### Navigate into this newly created directory

React Native will have created your project in a new sub-directory, which you must enter before continuing.

```bat
cd <projectName>
```

### Add React Native Windows to your project's dependencies

<!-- Note, make sure "version" is pointing to the correct react-native-windows NPM tag in the command below. -->

<!-- 1. For the next version (i.e. in docs/getting-started.md) use "canary" -->
<!-- 2. For other versions in versioned_docs use the version in the format "^0.XY.0" -->

<!--DOCUSAURUS_CODE_TABS-->

<!--Using Yarn (Recommended)-->

```bat
yarn add react-native-windows@^0.76.0
```

<!--Using NPM-->

```bat
npm install --save react-native-windows@^0.76.0
```

<!--END_DOCUSAURUS_CODE_TABS-->

### Initialize the React Native Windows native code and projects

Lastly, initialize the React Native for Windows application with the [init-windows command](init-windows-cli.md):

```bat
npx react-native init-windows --overwrite
```

> **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.
## Running a React Native Windows App

> Make sure a browser is launched and running before running a React Native Windows app.
> Also ensure your system meets all the [requirements](rnw-dependencies.md) to build a Windows app as well.
- Without Using Visual Studio

In your React Native Windows project directory, run the [run-windows command](run-windows-cli.md):

```bat
npx react-native run-windows
```

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:

- Using Visual Studio

- From the root of the project directory, run the [autolink-windows command](autolink-windows-cli.md), which will automatically link your app's dependencies:
```bat
npx react-native autolink-windows
```
- Open the solution file in the application folder in Visual Studio (e.g., `AwesomeProject/windows/AwesomeProject.sln` if you used `AwesomeProject` as `<projectName>`)
- 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.
- Run `yarn start` (or `npm start`) from your project directory, and wait for the React Native packager to report success.
- 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:
- With VS Code
- Open your applications folder in VS Code.
- Install the [React Native Tools](https://marketplace.visualstudio.com/items?itemName=msjsdiag.vscode-react-native) plugin for VS Code.
- Create a new file in the applications root directory, `.vscode/launch.json` and paste the following configuration:
```json
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Windows",
"cwd": "${workspaceFolder}",
"type": "reactnative",
"request": "launch",
"platform": "windows"
}
]
}
```
- 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.

## Authoring Native Modules

See [Native Modules and React Native Windows](native-modules.md).

## Building a standalone React Native Windows App

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.

- Open the solution in Visual Studio
- Select the Release configuration from the Configuration Manager drop-down.
- Build the solution. You can now launch without first launching Metro.
- If you want to build an APPX package to share or publish, use the **Project** > **Publish** > **Create App Packages...** option.

> The Debug configuration uses the Web Debugger by default, which means the application's JavaScript code runs in Chrome.<br>
> 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.
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#

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
id: version-0.76-EmitEventSetterDelegate
title: EmitEventSetterDelegate
original_id: EmitEventSetterDelegate
---

Kind: `delegate`

A delegate gets the arguments for an event emit on a EventEmitter.

## Invoke
void **`Invoke`**([`JSValueArgWriter`](JSValueArgWriter) argWriter)





## Referenced by
- [`EventEmitterInitializerDelegate`](EventEmitterInitializerDelegate)
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
id: version-0.76-EventEmitterInitializerDelegate
title: EventEmitterInitializerDelegate
original_id: EventEmitterInitializerDelegate
---

Kind: `delegate`

A delegate to call a turbo module EventEmitter.

## Invoke
void **`Invoke`**([`EmitEventSetterDelegate`](EmitEventSetterDelegate) emitter)





## Referenced by
- [`IReactModuleBuilder`](IReactModuleBuilder)
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
id: version-0.76-IReactModuleBuilder
title: IReactModuleBuilder
original_id: IReactModuleBuilder
---

Kind: `interface`



Builds native module inside of ReactNative code based on the provided meta-data.
See [Native Modules](native-modules) for more usage information.



## Methods
### AddConstantProvider
void **`AddConstantProvider`**([`ConstantProviderDelegate`](ConstantProviderDelegate) constantProvider)

Adds a constant provider method to define constants for the native module. See [`ConstantProviderDelegate`](ConstantProviderDelegate).



### AddEventEmitter
void **`AddEventEmitter`**(string name, [`EventEmitterInitializerDelegate`](EventEmitterInitializerDelegate) emitter)

Adds an EventEmitter to the turbo module. See [`EventEmitterInitializerDelegate`](EventEmitterInitializerDelegate).



### AddInitializer
void **`AddInitializer`**([`InitializerDelegate`](InitializerDelegate) initializer)

Adds an initializer method called on the native module initialization.
It provides the native module with the [`IReactContext`](IReactContext) for the running ReactNative instance. See [`InitializerDelegate`](InitializerDelegate).
There can be multiple initializer methods which are called in the order they were registered.



### AddMethod
void **`AddMethod`**(string name, [`MethodReturnType`](MethodReturnType) returnType, [`MethodDelegate`](MethodDelegate) method)

Adds an asynchronous method to the native module. See [`MethodDelegate`](MethodDelegate).



### AddSyncMethod
void **`AddSyncMethod`**(string name, [`SyncMethodDelegate`](SyncMethodDelegate) method)

Adds a synchronous method to the native module. See [`SyncMethodDelegate`](SyncMethodDelegate).






## Referenced by
- [`ReactModuleProvider`](ReactModuleProvider)
Loading

0 comments on commit 286799b

Please sign in to comment.