Skip to content

Commit

Permalink
docs: Complete description of the '@netless/appliance-plugin' install…
Browse files Browse the repository at this point in the history
…ation scenario
  • Loading branch information
hqer927 committed Nov 16, 2024
1 parent 72083e2 commit 26c26c4
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 13 deletions.
29 changes: 24 additions & 5 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<pre class="language-bash">
npm add <b>@netless/fastboard</b> @netless/window-manager white-web-sdk @netless/appliance-plugin
</pre>

> **注意:** `@netless/appliance-plugin` 是开启 [性能优化版本](#performance) 才需要安装。
#### 全打包方式引用
Expand Down Expand Up @@ -63,6 +64,8 @@ async function main() {
// [3] (可选)
managerConfig: {
cursor: true,
// (可选), 开启appliance-plugin, 从0.3.22开始
supportAppliancePlugin: true,
},
// [4] (可选)
netlessApps: [],
Expand Down Expand Up @@ -119,18 +122,25 @@ main().catch(console.error);

先安装 @netless/fastboard-react,再使用里面提供的 `<Fastboard />` 组件。

#### 全打包方式引用
#### 分包方式引用

<pre class="language-bash">
npm add <b>@netless/fastboard-react</b> react react-dom
npm add <b>@netless/fastboard-react</b> @netless/window-manager white-web-sdk react react-dom @netless/appliance-plugin
</pre>

#### 分包方式引用
> **注意:** `@netless/appliance-plugin` 是开启 [性能优化版本](#performance) 才需要安装。
#### 全打包方式引用

<pre class="language-bash">
npm add <b>@netless/fastboard-react</b> @netless/window-manager white-web-sdk react react-dom @netless/appliance-plugin
npm add <b>@netless/fastboard-react</b> react react-dom @netless/appliance-plugin
</pre>

> **注意:** 全打包方式引用,则 `@netless/window-manager``white-web-sdk` 可以不用安装。而 @netless/appliance-plugin 是开启[性能优化版本](#performance) 才需要安装。
>
> `@netless/window-manager``white-web-sdk``@netless/appliance-plugin``react``react-dom` 是 peerDependency,如果你不清楚 peerDependency 是什么意思,可以阅读 [《为什么使用 peerDependency ?》](./docs/zh/peer-dependency.md)

```jsx
// 全打包方式引用
import { useFastboard, Fastboard } from "@netless/fastboard-react/full";
Expand All @@ -152,6 +162,11 @@ function App() {
roomToken: "NETLESSROOM_...",
},
// 开启 appliance-plugin 插件
managerConfig: {
cursor: true,
supportAppliancePlugin: true,
}
// 开启 appliance-plugin 插件
enableAppliancePlugin: {
...
},
Expand Down Expand Up @@ -411,7 +426,7 @@ const appId = await fastboard.manager.addApp({

<h2 id="performance">使用性能优化版本</h2>

通过 ``enableAppliancePlugin`` 配置项开启 appliance-plugin 插件,以提升性能, 也可以参考文档:[appliance-plugin](./docs/zh/appliance-plugin.md)
通过 `enableAppliancePlugin``managerConfig.supportAppliancePlugin` 配置项开启 appliance-plugin 插件,以提升性能, 也可以参考文档:[appliance-plugin](./docs/zh/appliance-plugin.md)
> **注意:** 开启使用性能优化版本,需要安装 ``@netless/appliance-plugin``
### 示例代码
Expand All @@ -436,6 +451,10 @@ function App() {
joinRoom: {
...
},
// 开启 appliance-plugin 插件, 和windowManager 配置
managerConfig: {
supportAppliancePlugin: true
},
// 开启 appliance-plugin 插件
enableAppliancePlugin: {
cdn: {
Expand Down
40 changes: 32 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ async function main() {
// [3] (optional)
managerConfig: {
cursor: true,
// (Optional), turn on the appliance-plugin starting at 0.3.22
supportAppliancePlugin: true,
},
// [4] (optional)
netlessApps: [],
Expand Down Expand Up @@ -112,19 +114,25 @@ main().catch(console.error);

Install `@netless/fastboard-react`, use the `<Fastboard />` component.

#### Full package
#### Subcontracting package

<pre class="language-bash">
npm add <b>@netless/fastboard-react</b> react react-dom
npm add <b>@netless/fastboard-react</b> @netless/window-manager white-web-sdk react react-dom @netless/appliance-plugin
</pre>

> **注意:** The `@netless/appliance-plugin` needs to be installed only when [Use performance](#performance) is enabled.
#### Subcontracting package

#### Full package

<pre class="language-bash">
npm add <b>@netless/fastboard-react</b> @netless/window-manager white-web-sdk react react-dom @netless/appliance-plugin
npm add <b>@netless/fastboard-react</b> react react-dom @netless/appliance-plugin
</pre>

> **Note:** Full package reference, then `@netless/window-manager`, `white-web-sdk` can not be installed. The `@netless/appliance-plugin` needs to be installed only when [Use performance](#performance) is enabled.
>
> `@netless/window-manager`, `white-web-sdk`, `@netless/appliance-plugin` is peerDependency, if you're not sure what peerDependency means, You can read [Why Use peerDependency?](./docs/zh/peer-dependency.md)
```jsx
// Full package
import { useFastboard, Fastboard } from "@netless/fastboard-react/full";
Expand All @@ -145,7 +153,12 @@ function App() {
uuid: "room-uuid",
roomToken: "NETLESSROOM_...",
},
// 开启 appliance-plugin 插件
managerConfig: {
cursor: true,
// (Optional), turn on the appliance-plugin starting at 0.3.22
supportAppliancePlugin: true,
},
// (Optional), turn on the appliance-plugin starting at 0.3.22
enableAppliancePlugin: {
...
},
Expand Down Expand Up @@ -408,7 +421,7 @@ To develop your own app, see [Write you a Netless App](./docs/en/app.md).

## performance

Enable the `@netless/appliance-plugin` through the `enableAppliancePlugin` configuration item to improve performance.Also refer to the document [appliance-plugin](./docs/en/appliance-plugin.md).
Enable the `@netless/appliance-plugin` through the `enableAppliancePlugin` & `managerConfig.supportAppliancePlugin` configuration item to improve performance.Also refer to the document [appliance-plugin](./docs/en/appliance-plugin.md).

> **Note:** To enable the use of the performance optimized version, you need to install `@netless/appliance-plugin`.
Expand All @@ -433,6 +446,10 @@ function App() {
joinRoom: {
...
},
managerConfig: {
// (Optional), turn on the appliance-plugin
supportAppliancePlugin: true,
},
// use appliance-plugin
enableAppliancePlugin: {
cdn: {
Expand Down Expand Up @@ -553,8 +570,15 @@ try {
},
},
},
// 开启 appliance-plugin 插件
enableAppliancePlugin: true,
managerConfig: {
cursor: true,
// (Optional), turn on the appliance-plugin starting at 0.3.22
supportAppliancePlugin: true,
},
// (Optional), turn on the appliance-plugin starting at 0.3.22
enableAppliancePlugin: {
...
},
});
} catch (error) {
console.error("Failed to join whiteboard room", error);
Expand Down

0 comments on commit 26c26c4

Please sign in to comment.