Use Rust for the front-end too #374

已合并
elegaanz 5 年前 将 11 次代码提交从 wasm 合并至 master
elegaanz 评论于 5 年前 (从 github.com 迁移)

Rust can compile to WASM, so let's use it for front-end code as well.

To compile the front-end:

cargo install cargo-web
cd plume-front
cargo web deploy -o ../static
Rust can compile to WASM, so let's use it for front-end code as well. To compile the front-end: ``` cargo install cargo-web cd plume-front cargo web deploy -o ../static ```
trinity-1686a 评审于 5 年前
trinity-1686a 留下了一条评论
所有者

I've had a hard time testing this. I think it would be better to cargo web deploy without location, and do some processing (adding static/ to path so the new route is not required) and copying by ourselves in build.rs. Currently the instructions are polluting static/ with an index.html

I've had a hard time testing this. I think it would be better to `cargo web deploy` without location, and do some processing (adding `static/` to path so the new route is not required) and copying by ourselves in build.rs. Currently the instructions are polluting `static/` with an `index.html`
所有者

I think this file souldn't be committed, it's auto generated and things like __cargo_web_snippet_199d5eb25dfe761687bcd487578eb7e636bd9650 are probably not reproducible between builds

I think this file souldn't be committed, it's auto generated and things like `__cargo_web_snippet_199d5eb25dfe761687bcd487578eb7e636bd9650` are probably not reproducible between builds
elegaanz 评论于 5 年前 (从 github.com 迁移)

You can now just use cargo web deploy, build.rs will do the rest.

You can now just use `cargo web deploy`, build.rs will do the rest.
igalic 评论于 5 年前 (从 github.com 迁移)

how much faster is the resulting wasm compared to the previous Javascript?

how much faster is the resulting wasm compared to the previous Javascript?
所有者

@igalic considering our use-case, probably not much. The main advantage is the whole team being able to debug it I think

@igalic considering our use-case, probably not much. The main advantage is the whole team being able to debug it I think
elegaanz 评论于 5 年前 (从 github.com 迁移)

There may be better performances once with the future editor, especially when writing big articles. Another advantage is that we will be able to share code between backend and frontend if we need it.

There may be better performances once with the future editor, especially when writing big articles. Another advantage is that we will be able to share code between backend and frontend if we need it.
所有者

@BaptisteGelez I see Travis failed because of cargo-web installation, you might be interested into this https://github.com/koute/cargo-web#using-cargo-web-on-travis .

@BaptisteGelez I see Travis failed because of cargo-web installation, you might be interested into this https://github.com/koute/cargo-web#using-cargo-web-on-travis .
codecov[bot] 评论于 5 年前 (从 github.com 迁移)

Codecov Report

Merging #374 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #374   +/-   ##
=======================================
  Coverage   27.86%   27.86%           
=======================================
  Files          63       63           
  Lines        6280     6280           
=======================================
  Hits         1750     1750           
  Misses       4530     4530
# [Codecov](https://codecov.io/gh/Plume-org/Plume/pull/374?src=pr&el=h1) Report > Merging [#374](https://codecov.io/gh/Plume-org/Plume/pull/374?src=pr&el=desc) into [master](https://codecov.io/gh/Plume-org/Plume/commit/22bc8c1d407cd4c3844aaa1161afd2a86f6d349a?src=pr&el=desc) will **not change** coverage. > The diff coverage is `n/a`. ```diff @@ Coverage Diff @@ ## master #374 +/- ## ======================================= Coverage 27.86% 27.86% ======================================= Files 63 63 Lines 6280 6280 ======================================= Hits 1750 1750 Misses 4530 4530 ```
trinity-1686a 评审于 5 年前
trinity-1686a 留下了一条评论
所有者

You should also update documentation, something like add "run cargo web deploy -p plume-front"

You should also update documentation, something like add "run `cargo web deploy -p plume-front`"
所有者

this line is no longer required

this line is no longer required
trinity-1686a5 年前 批准此合并请求

评审人

trinity-1686a5 年前 批准此合并请求
该合并请求已作为 3fce5d6a14 被合并。
你也可以查看 命令行指令

第一步:

从你的仓库中签出一个新的分支并测试变更。
git checkout -b wasm master
git pull origin wasm

第二步:

合并变更并更新到 Forgejo 上
git checkout master
git merge --no-ff wasm
git push origin master
登录 并参与到对话中。
无审核者
未选择里程碑
未指派成员
2 名参与者
通知
到期时间
到期日期无效或超出范围。请使用 'yyyy-mm-dd' 格式。

未设置到期时间。

依赖工单

没有设置依赖项。

参考:Plume/Plume#374
正在加载...
这个人很懒,什么都没留下。