mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
Update translation of 'more' part (#1797)
* Translate testing.md via GitLocalize * Translate roadmap.md via GitLocalize * Translate external-libs.md via GitLocalize * Translate debugging.md via GitLocalize Co-authored-by: sansx <646924078@qq.com>
This commit is contained in:
parent
7900630805
commit
164d5546b4
@ -1,51 +1,54 @@
|
||||
# Debugging
|
||||
---
|
||||
title: 调试
|
||||
id: version-0.17.3-debugging
|
||||
original_id: debugging
|
||||
---
|
||||
|
||||
## Panics
|
||||
|
||||
Please use the [`console_error_panic`](https://github.com/rustwasm/console_error_panic_hook) crate for nicer stacktraces with Rust symbols. Note, that it is not compatible with apps built with `cargo-web`.
|
||||
请使用 [`console_error_panic`](https://github.com/rustwasm/console_error_panic_hook) crate 以获得带有 Rust 符号的堆栈跟踪。请注意,它与使用 `cargo-web` 构建的应用程序不兼容。
|
||||
|
||||
## Console Logging
|
||||
|
||||
In general, Wasm web apps are able to interact with Browser APIs, and the `console.log` api is no exception. There are a few options available:
|
||||
通常,Wasm Web 应用程序能够与浏览器 API 进行交互, `console.log` api也不例外。以下是一些可用的选项:
|
||||
|
||||
### [`wasm-logger`](https://crates.io/crates/wasm-logger)
|
||||
|
||||
This crate integrates with the familiar Rust `log` crate:
|
||||
这个 crate 集成了我们熟悉的Rust `log` crate:
|
||||
|
||||
```rust
|
||||
// setup
|
||||
// 初始化
|
||||
fn main() {
|
||||
wasm_logger::init(wasm_logger::Config::default());
|
||||
}
|
||||
|
||||
// usage
|
||||
// 用法
|
||||
log::info!("Update: {:?}", msg);
|
||||
```
|
||||
|
||||
### **\`\`**[**`ConsoleService`**](https://docs.rs/yew/0.13.2/yew/services/console/struct.ConsoleService.html)**\`\`**
|
||||
### [`ConsoleService`](https://docs.rs/yew/latest/yew/services/console/struct.ConsoleService.html)
|
||||
|
||||
This service is included within yew and is available when the `"services"` feature is enabled:
|
||||
该服务包含在 yew 之中,并且在 `"services"` feature 开启后可用:
|
||||
|
||||
```rust
|
||||
// usage
|
||||
// 使用
|
||||
ConsoleService::new()::info(format!("Update: {:?}", msg));
|
||||
```
|
||||
|
||||
## Source Maps
|
||||
|
||||
There is currently no first-class support for source maps for Rust / Wasm web apps. This, of course, is subject to change. If this is no longer true or if progress is made, please suggest a change!
|
||||
目前,Rust / Wasm Web 应用程序的 Source Map 还没有一流支持。当然,这是会改变的。如果在这方面取得了进展,请提出更改建议!
|
||||
|
||||
### Latest Info
|
||||
### 近期相关资讯
|
||||
|
||||
\[Dec 2019\] [Chrome DevTools update](https://developers.google.com/web/updates/2019/12/webassembly#the_future)
|
||||
[Dec 2019] [Chrome DevTools更新](https://developers.google.com/web/updates/2019/12/webassembly#the_future)
|
||||
|
||||
> There is still quite a bit of work to do though. For example, on the tooling side, Emscripten \(Binaryen\) and wasm-pack \(wasm-bindgen\) don’t support updating DWARF information on transformations they perform yet.
|
||||
> There is still quite a bit of work to do though. For example, on the tooling side, Emscripten (Binaryen) and wasm-pack (wasm-bindgen) don’t support updating DWARF information on transformations they perform yet.
|
||||
|
||||
\[2020\] [Rust Wasm debugging guide](https://rustwasm.github.io/book/reference/debugging.html#using-a-debugger)
|
||||
[2020] [ Rust Wasm 调试指南](https://rustwasm.github.io/book/reference/debugging.html#using-a-debugger)
|
||||
|
||||
> Unfortunately, the debugging story for WebAssembly is still immature. On most Unix systems, [DWARF](http://dwarfstd.org/) is used to encode the information that a debugger needs to provide source-level inspection of a running program. There is an alternative format that encodes similar information on Windows. Currently, there is no equivalent for WebAssembly.
|
||||
|
||||
\[2019\] [Rust Wasm roadmap](https://rustwasm.github.io/rfcs/007-2019-roadmap.html#debugging)
|
||||
[2019] [ Rust Wasm 路线图 ](https://rustwasm.github.io/rfcs/007-2019-roadmap.html#debugging)
|
||||
|
||||
> Debugging is tricky because much of the story is out of this working group's hands, and depends on both the WebAssembly standardization bodies and the folks implementing browser developer tools instead.
|
||||
|
||||
|
||||
@ -1,24 +1,36 @@
|
||||
---
|
||||
description: 可以帮助 Yew 开发的库
|
||||
title: 外部库
|
||||
description: 有助于 Yew 开发的库
|
||||
id: version-0.17.3-external-libs
|
||||
original_id: external-libs
|
||||
---
|
||||
|
||||
# 外部库
|
||||
|
||||
### Yewtil
|
||||
|
||||
Yewtil 是一个帮助你编写 Yew 程序的通用工具集合。它包括:
|
||||
|
||||
* NeqAssign - 如前所述,这是给 props 赋值以保证最小化重新渲染的最佳方式。
|
||||
* PureComponents - 不更新任何状态的组件。它们在内部使用 NeqAssign,表现得像记忆化函数并像普通组件一样在 `html!` 宏内部被调用。
|
||||
* Lrc - 链表引用计数智能指针,功能类似于 `Rc`,但是允许新颖的数据更新模式。
|
||||
* Mrc/Irc - 可变/不可变引用计数智能指针,功能类似于 `Rc`,但由于为 `Mrc` 实现了 `DerefMut` 和 `BorrowMut`,因此在 Yew 中对用户更友好。这允许 `Mrc` 与 `NeqAssign` 一起使用。`Irc` 充当数据的不可变视图,这使其成为保存仅用于显示的数据的理想选择。
|
||||
* History - 历史记录追踪包装器,它使用 `VecDeque` 来保存其展示过的历史值。
|
||||
* Futures - 支持运行将消息发送到组件更新循环的 futures。
|
||||
* Fetch - 用于处理使用 `web-sys` 和前面提到的 Futures 功能发请求的抽象。
|
||||
- NeqAssign - 如前所述,这是给 props 赋值以保证最小化重新渲染的最佳方式。
|
||||
|
||||
- PureComponents - 不更新任何状态的组件。它们在内部使用 NeqAssign,
|
||||
|
||||
表现得像记忆化函数并像普通组件一样在 `html!` 宏内部被调用。
|
||||
|
||||
- Lrc - 链表引用计数智能指针,功能类似于 `Rc`,但是允许新颖的数据更新模式。
|
||||
|
||||
- Mrc/Irc - 可变/不可变引用计数智能指针,功能类似于 `Rc`,但
|
||||
|
||||
由于为 `Mrc` 实现了 `DerefMut` 和 `BorrowMut`,因此在 Yew 中对用户更友好。这允许 `Mrc` 与 <code>NeqAssign</code> 一起使用。
|
||||
|
||||
<code>Irc</code> 充当数据的不可变视图,这使其成为保存仅用于显示的数据的理想选择。
|
||||
|
||||
- History - 历史记录追踪包装器,它使用 `VecDeque` 来保存其展示过的历史值。
|
||||
|
||||
- Futures - 支持运行将消息发送到组件更新循环的 futures。
|
||||
|
||||
- Fetch - 用于处理使用 `web-sys` 和前面提到的 Futures 功能发请求的抽象。
|
||||
|
||||
## 寻求
|
||||
|
||||
生态需要但目前还没有的库。
|
||||
|
||||
Bootstrap/MaterialUi/任意 css 框架的组件封装。
|
||||
|
||||
|
||||
@ -1,40 +1,43 @@
|
||||
---
|
||||
title: 路线图
|
||||
description: Yew 框架规划功能的路线图
|
||||
id: version-0.17.3-roadmap
|
||||
original_id: roadmap
|
||||
---
|
||||
|
||||
# 路线图
|
||||
## 优先次序
|
||||
|
||||
## `v1.0.0`
|
||||
由社区决定将来特性的开发优先度以及需要侧重的关注点。 在2020年春季,发起过开发者调查问卷,收集有关项目发展方向的反馈。您可以在[Yew Wiki中](https://github.com/yewstack/yew/wiki/Dev-Survey-%5BSpring-2020%5D)找到摘要。
|
||||
|
||||
### 规划中的功能
|
||||
::: note 可以在[Yew Github项目 ](https://github.com/yewstack/yew/projects)中跟踪所有主要计划的状态 ::::
|
||||
|
||||
* 标记 key 的列表项:[https://github.com/yewstack/yew/issues/479](https://github.com/yewstack/yew/issues/479)
|
||||
* 路由:[https://github.com/yewstack/yew\_router](https://github.com/yewstack/yew_router)
|
||||
## 关注点
|
||||
|
||||
1. 高优先级的功能
|
||||
2. 生产环境准备
|
||||
3. 文档
|
||||
4. 痛点
|
||||
|
||||
### 高优先级的功能
|
||||
|
||||
1. [函数式组件](https://github.com/yewstack/yew/projects/3)
|
||||
2. [组件库](https://github.com/yewstack/yew/projects/4)
|
||||
3. 更好的状态管理
|
||||
4. [服务端渲染](https://github.com/yewstack/yew/projects/5)
|
||||
|
||||
### 生产环境准备
|
||||
|
||||
* 浏览器兼容性
|
||||
* 提高 Yew 框架的测试覆盖率
|
||||
* 增加性能基准测试:[https://github.com/yewstack/yew/issues/5](https://github.com/yewstack/yew/issues/5)
|
||||
- 提高 Yew 测试覆盖率
|
||||
- 缩减二进制文件的大小
|
||||
- [基准表现](https://github.com/yewstack/yew/issues/5)
|
||||
|
||||
### 指南
|
||||
### 文档
|
||||
|
||||
* 最佳实践:[https://yew.rs/docs/optimizations](https://yew.rs/docs/optimizations)
|
||||
* 端到端教程
|
||||
* Futures / 并发
|
||||
* CSS / 样式
|
||||
* 测试
|
||||
* 状态管理
|
||||
- 创建教程
|
||||
- 简化项目设置
|
||||
|
||||
## 未来
|
||||
|
||||
### 潜在功能
|
||||
|
||||
* 服务端渲染:[https://github.com/yewstack/yew/issues/41](https://github.com/yewstack/yew/issues/41)
|
||||
* 组件库:[https://github.com/yewstrap/yewstrap](https://github.com/yewstrap/yewstrap)
|
||||
* 代码分割:[https://github.com/yewstack/yew/issues/599](https://github.com/yewstack/yew/issues/599)
|
||||
* 允许不同的虚拟 DOM 后端:[https://github.com/yewstack/yew/issues/482](https://github.com/yewstack/yew/issues/482)
|
||||
* 反思 Services:[https://github.com/yewstack/yew/issues/364](https://github.com/yewstack/yew/issues/364)
|
||||
* 成熟的工具包:[https://github.com/yewstack/yewtil](https://github.com/yewstack/yewtil)
|
||||
* HTML 模板备选方案:[https://github.com/yewstack/yew/issues/438](https://github.com/yewstack/yew/issues/438)
|
||||
### 痛点
|
||||
|
||||
- [组件样板](https://github.com/yewstack/yew/issues/830)
|
||||
- Fetch API
|
||||
- [代理](https://github.com/yewstack/yew/projects/6)
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
---
|
||||
description: 测试你的应用程序
|
||||
title: 测试应用
|
||||
description: 测试你的应用
|
||||
id: version-0.17.3-testing
|
||||
original_id: testing
|
||||
---
|
||||
|
||||
# 测试
|
||||
<todo></todo>
|
||||
|
||||
<TODO>
|
||||
|
||||
## Rust WebDriving
|
||||
|
||||
使用 Rust 以编程方式驱动 UI 集成测试,[fantoccini](https://crates.io/crates/fantoccini) 是一个推荐的选择。它允许你通过使用 CSS 选择器来查找特定的元素,然后对它们执行特定的操作,例如输入文本,点击按钮,或等待特定时间以使客户端代码执行(例如等待一个网络请求完成并导致 UI 改变),来测试你的网站。
|
||||
## wasm_bindgen_test
|
||||
|
||||
Rust Wasm 工作组维护着一个名为 [`wasm_bindgen_test`](https://rustwasm.github.io/docs/wasm-bindgen/wasm-bindgen-test/index.html) 的 crate ,该 crate 使您可以以类似于内置 `#[test]` 过程宏的方式在浏览器中运行测试。 [Rust Wasm工作组的文档](https://rustwasm.github.io/docs/wasm-bindgen/wasm-bindgen-test/index.html)中提供了有关此模块的更多信息。
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user