-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Rust for the front-end too #374
Conversation
Rust is transpiled to WASM and loaded with a JS file from Cargo web
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
static/plume-front.js
Outdated
@@ -0,0 +1,572 @@ | |||
"use strict"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
You can now just use |
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 |
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 . |
Codecov Report
@@ Coverage Diff @@
## master #374 +/- ##
=======================================
Coverage 27.86% 27.86%
=======================================
Files 63 63
Lines 6280 6280
=======================================
Hits 1750 1750
Misses 4530 4530 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also update documentation, something like add "run cargo web deploy -p plume-front
"
Rust can compile to WASM, so let's use it for front-end code as well.
To compile the front-end: