Skip to content

Commit 6a3be6e

Browse files
authored
Update out-of-tree-platforms.md (#639)
1 parent 75557cf commit 6a3be6e

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

cndocs/out-of-tree-platforms.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,31 @@ id: out-of-tree-platforms
33
title: 多平台支持
44
---
55

6-
React Native is not just for Android and iOS - there are community-supported projects that bring it to other platforms, such as:
6+
React Native不仅适用于 Android iOS - 还有社区支持的项目将其应用于其他平台,例如:
77

8-
- [React Native Windows](https://github.com/Microsoft/react-native-windows) - React Native support for Microsoft's Universal Windows Platform (UWP) and the Windows Presentation Foundation (WPF)
9-
- [React Native DOM](https://github.com/vincentriemer/react-native-dom) - An experimental, comprehensive port of React Native to the web. (Not to be confused with [React Native Web](https://github.com/necolas/react-native-web), which has different goals)
10-
- [React Native Desktop](https://github.com/status-im/react-native-desktop) - A project aiming to bring React Native to the Desktop with Qt's QML. A fork of [React Native Ubuntu](https://github.com/CanonicalLtd/react-native/), which is no longer maintained.
11-
- [React Native macOS](https://github.com/ptmt/react-native-macos) - An experimental React Native fork targeting macOS and Cocoa
12-
- [React Native tvOS](https://github.com/react-native-community/react-native-tvos) - adaptation of React Native for Apple tvOS
13-
- [alita](https://github.com/areslabs/alita) - An experimental, comprehensive port of React Native to mini-program(微信小程序).
14-
- [Proton Native](https://github.com/kusti8/proton-native) - A wrapper for React Native, using Qt to target Linux, MacOS, and Windows.
8+
- [React Native Windows](https://github.com/Microsoft/react-native-windows) - React Native 支持 Microsoft Universal Windows Platform (UWP) Windows Presentation Foundation (WPF)
9+
- [React Native DOM](https://github.com/vincentriemer/react-native-dom) - 一个实验性的、全面的 React Native web 的端口。(不要与[React Native Web](https://github.com/necolas/react-native-web)混淆,两者目标不同)
10+
- [React Native Desktop](https://github.com/status-im/react-native-desktop) - 一个旨在通过 Qt 的 QML 将 React Native 带到桌面的项目。[React Native Ubuntu](https://github.com/CanonicalLtd/react-native/)的一个分支,已不再维护。
11+
- [React Native macOS](https://github.com/ptmt/react-native-macos) - 针对 macOS 和 Cocoa 的实验性 React Native 分支
12+
- [React Native tvOS](https://github.com/react-native-community/react-native-tvos) - 为 Apple tvOS 适配 React Native
13+
- [alita](https://github.com/areslabs/alita) - 一个实验性的、综合性的 React Native 到微信小程序的端口
14+
- [Proton Native](https://github.com/kusti8/proton-native) - React Native 的封装器,使用 Qt 面向 LinuxMacOS Windows
1515

16-
## Creating your own React Native platform
16+
## 创建你自己的 React Native 平台
1717

18-
Right now the process of creating a React Native platform from scratch is not very well documented - one of the goals of the upcoming re-architecture ([Fabric](https://facebook.github.io/react-native/blog/2018/06/14/state-of-react-native-2018)) is to make maintaining a platform easier.
18+
目前,从头开始创建 React Native 平台的过程并没有很好的记录——即将到来的全新架构([Fabric](https://facebook.github.io/react-native/blog/2018/06/14/state-of-react-native-2018))的目标之一是使平台的维护更容易。
1919

20-
### Bundling
20+
### 打包
2121

22-
As of React Native 0.57 you can now register your React Native platform with React Native's JavaScript bundler, [Metro](https://facebook.github.io/metro/). This means you can pass `--platform example` to `npx react-native bundle`, and it will look for JavaScript files with the `.example.js` suffix.
22+
React Native 0.57 开始,你现在可以使用 React Native JavaScript 打包器[Metro](https://facebook.github.io/metro/)注册你的 React Native 平台。这意味着你可以将`--platform example`传递给`npx react-native bundle`,它会查找带有`.example.js`后缀的 JavaScript 文件。
2323

24-
To register your platform with RNPM, your module's name must match one of these patterns:
24+
要将你的平台注册到 RNPM,模块名称必须与以下模式之一匹配:
2525

26-
- `react-native-example` - It will search all top-level modules that start with `react-native-`
27-
- `@org/react-native-example` - It will search for modules that start with `react-native-` under any scope
28-
- `@react-native-example/module` - It will search in all modules under scopes with names starting with `@react-native-`
26+
- `react-native-example` - 它会搜索所有以`react-native-`开头的顶级模块
27+
- `@org/react-native-example` - 它会在所有范围内搜索以`react-native-`开头的模块
28+
- `@react-native-example/module` - 它会在名称以`@react-native-`开头的范围内搜索所有模块
2929

30-
You must also have an entry in your `package.json` like this:
30+
你还必须在`package.json`中设置一些内容,如下所示:
3131

3232
```json
3333
{
@@ -40,4 +40,4 @@ You must also have an entry in your `package.json` like this:
4040
}
4141
```
4242

43-
`"providesModuleNodeModules"` is an array of modules that will get added to the Haste module search path, and `"platforms"` is an array of platform suffixes that will be added as valid platforms.
43+
`"providesModuleNodeModules"`是一组将被添加到 Haste 模块搜索路径的模块,`"platforms"`则是一组将作为有效平台添加的平台后缀。

0 commit comments

Comments
 (0)