Use Rust for the front-end too #374

Yhdistetty
elegaanz yhdistetty 11 committia lähteestä wasm kohteeseen master 5 vuotta sitten
elegaanz kommentoi 5 vuotta sitten (Migrated from 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 reviewed 5 vuotta sitten
trinity-1686a jätti kommentin
Omistaja

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`
Omistaja

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 kommentoi 5 vuotta sitten (Migrated from 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 kommentoi 5 vuotta sitten (Migrated from 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?
Omistaja

@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 kommentoi 5 vuotta sitten (Migrated from 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.
Omistaja

@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] kommentoi 5 vuotta sitten (Migrated from 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 reviewed 5 vuotta sitten
trinity-1686a jätti kommentin
Omistaja

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`"
Omistaja

this line is no longer required

this line is no longer required
trinity-1686a hyväksyi nämä muutokset 5 vuotta sitten

Reviewers

trinity-1686a hyväksyi nämä muutokset 5 vuotta sitten
The pull request has been merged as 3fce5d6a14.
You can also view command line instructions.

Vaihe 1:

From your project repository, check out a new branch and test the changes.
git checkout -b wasm master
git pull origin wasm

Vaihe 2:

Merge the changes and update on Forgejo.
git checkout master
git merge --no-ff wasm
git push origin master
Sign in to join this conversation.
No reviewers
Ei merkkipaalua
Ei käsittelijää
2 osallistujaa
Ilmoitukset
Määräpäivä
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

Määräpäivää ei asetettu.

Riippuvuudet

Riippuvuuksia ei asetettu.

Reference: Plume/Plume#374
Ladataan…
Sisältöä ei vielä ole.