-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Build examples with trunk #1559
Conversation
This will result in a lot of "changes" simply due to renaming and splitting of files. I'm keeping a log of all the notable changes to keep it manageable. |
I think this covers this issue too: #1016 Edit: It doesn't totally cover the styling aspect actually |
@jstarry Yeah, I noticed that issue too. Speaking of that issue though, @ZainlessBrombie has done some terrific styling work for some examples but it seems like it was never integrated. Perhaps we can try to salvage some of it? |
I thought it would be great to use `unimplemented!()` in case the component doesn't have any properties. This helps avoid the mistake of forgetting to update the change method when adding props later on. What I didn't consider is that just because the props are () that doesn't mean that Yew isn't going to call it... So yeah, it's still a good idea for update, but certainly not for change.
Okay, deep breaths.... The final item on my list is updating the newly added |
Awesome, feel free to remove |
Almost forgot about those, yeah. I'm pretty sure they can be removed - we have enough examples as is. |
Just ran the final test and everything is working... ...except for serving the sub-routes of the router example. So yet again GitHub has failed us... |
Let's finally merge this though. We can switch the hosting provider in a new PR, this one has grown way too big already. |
Description
Gone are the days of Bash scripts and thrown-together Python servers - trunk makes for a much better experience when it comes to building and serving Yew apps.
I'm also going through each example to bring them up to speed and add a helpful README which includes a list of potential improvements; hopefully encourage people to contribute to existing examples instead of creating new ones.
The new system will make it much easier to build all examples and I would like to use that chance to host them somewhere (Maybe GitHub Pages?). This will close #850 too.
Closes: #1568
Closes: #1534
Closes: #1368
Closes: #1289
Closes: #171 (oh man, that's an old one)
TODO
Somewhat related issues
List of examples that I deem satisfactory
Check them out!
Changes
OPEN
0. boids
Made some significant changes to this one.
The reason being that I wanted to have at least one more "finished" example.
1. counter
2. crm
Modified to make the example more modular.
What used to be a single component handling a lot of message spaghetti is now split into dedicated components.
3. custom_components
Should be updated or removedREMOVED
4. dashboard
5. file_upload
6. fragments
Should be updated or removedREMOVED
7. futures_wp
Renamed to just "futures" because we no longer need the ugly wasm-pack hack.
Make use of yewtil's
LinkFuture
trait.8. game_of_life
Split code across two files.
9. inner_html
10. js_callback
Make use of wasm-bindgen's ability to automatically load js files without having to include them in the HTML.
Split the bindings into a separate file for clarity.
Trunk Issue: trunk-rs/trunk#4011. keyed_list
Split into multiple files for clarity.
12. large_table
This example was removed because it's quite literally just a large table...
"game_of_life" offers a far superior but not quite as large table experience and "keyed_list" takes care of the large part.
13. minimal
Removed because this example is very similar to "counter" but it can only count to one.
A "minimal" example should either demonstrate every aspect of Yew's API in a small application or be a template.
14. minimal_wp
This example was removed because it's the same as "minimal" but for wasm-pack.
Different approaches to building apps should be explored through templates, not the examples.
15. mount_point
16. multi_thread
Trunk Issue: trunk-rs/trunk#46.
17. nested_list
18. node_refs
19. npm_and_rest
Renamed to "ccxt_and_gravatar" because it has nothing to do with NPM.Updated the services to be more ergonomic and added display for the Gravatar profile.Example should be updated or put out of its miseryREMOVED
20. pub_sub
Should be updated
20.5 router
Added this example to replace the old yew-router examples.
You know how it goes, it ended up becoming one of the most examples.
21. store
22. textarea
Removed because it's literally just a textarea.
Other examples like todomvc use similar concepts for something more useful.
23. timer
24. todomvc
Split
State
into a separate file to make it more manageable.Updated TodoMVC CSS to latest version.
25. two_apps
26. webgl