Skip to content
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

fix: examples with servers, tests and travis config #95

Merged
merged 1 commit into from Apr 28, 2019

Conversation

MartinKavik
Copy link
Member

Well, little bit bigger PR, but it mostly changes only examples and there are no api / breaking changes.
(It should be my last too big PR - build and test pipeline should be working now for every examples and CI.)

Summary of changes:

A) Rewritten server_integration example.
B) Rewritten websocket example.
C) Fixed tests.
D) Updated + created Makefile.tomls.
E) Updated + created README.mds.
F) Rewritten .travis.yml.
G) Deleted useless files.
H) Added body() into util.rs.


A) Rewritten server_integration example.

  • Old example was using Rocket, so it required nightly Rust - problematic compilation
  • Old example didn't show how to scale and manage project with workspaces
  • New example uses Actix and workspace - it should be a nice example of modern Rust application with Wasm, actors and stable Rust
  • Actix has websockets out of the box and with workspace it will be easy to add another websocket example in the future (WebSocket support & example #8)

B) Rewritten websocket example.

  • I think that old example was too complex - it was more like server-integration with websockets and some low-level operations
  • New example uses ws-rs (there are now 46 lines of code instead of 169 with the same logic in server.rs) - it will be useful when we will be testing new websocket crate / functions in the future (WebSocket support & example #8)
  • I've also refactored client, because there were compilation problems and I tried to make it more readable.

C) Fixed tests.

D) Updated + created Makefile.tomls.

  • Each example can be started from Seed's root (cargo make start counter) or from own root (cargo make start).
  • Main (root) Makefile.toml refactored, modified and added test tasks.
  • Fixed bugs that fail CI pipeline.

E) Updated + created README.mds.

  • Each example has own README. Old readmes updated.
  • Main (root) readme
    • Added badges for better "marketing" and as quick links to travis and cargo-make
    • Chapter Running included examples updated.
    • Added --force so people has current cargo-make and it doesn't fail when they use it in CI

F) Rewritten .travis.yml.

  • It uses cargo-make now
  • Switched to stable from nightly
  • Added basic cache configuration
  • Added chrome
  • It is a little bit slow (mainly on mac) due to unnecessary recompilations / bad caching and downloading - I've added useful links at the end of the file for future work => I think it makes sense to optimize it when the windows environment will be stable and some new features in cargo will be published ; https://travis-ci.org/MartinKavik/seed

G) Deleted useless files.

  • build.ps1, build.sh, serve.py ...

H) Added body() into util.rs.

  • I've had to mount App into something in DOM during tests.

@David-OConnor David-OConnor merged commit ef10c91 into seed-rs:master Apr 28, 2019
@David-OConnor
Copy link
Member

David-OConnor commented Apr 28, 2019

Excellent PR! Solid changes/fixes all around. Your cargo make system (this PR and previous) is a night-and-day improvement to usability/getting started.

@MartinKavik MartinKavik deleted the fix_examples branch April 29, 2019 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants