Conversation
... since there are never multiple readers.
Contributor
|
This update is more than awesome. Thanks a lot! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introducing Comet
I never properly introduced
comet, so please let me.cometis a new companion debugging tool that can be summoned by pressing F12 when thedebugfeature is enabled—replacing the old (and hideous) debug overlay.comet_1080.mp4
When the
debugfeature is enabled, anicedapplication will send performance metrics through a socket to any server implementing theiced_beaconprotocol.cometis one of such servers. It is built with iced itself and you can find the code over here: https://github.com/iced-rs/cometOf course, this all means you could build your own custom debugger if you wanted to! It should all be reusable enough.
Custom Performance Metrics
As I introduced in #2891, you can decorate any piece of code with
debug::timeanddebug::time_withto time and visualize different parts of your app.comet-custom_timings-720p.mp4
Time Traveling
As you know, iced uses the Elm Architecture. One of the advantages of this architecture is that application state can only be mutated in a single place:
update—and only in response of aMessage. Furthermore, impure side effects are encouraged to happen insideTaskandSubscriptionwhich are run indirectly by the runtime.Effectively, this means that if we have an initial state and a list of messages, then we should be able to replicate any state the application has been at any point in time. In other words, we can time travel.
comet-time_travel.mp4
comet-time_travel-02.mp4
comet-time_travel-03.mp4
Pretty cool, huh? Time traveling can be enabled with the new
time-travelfeature. Activating it will force aClonebound on yourMessagetype.It goes without saying but... the feature is very experimental! It will only work well if your
updatelogic is pure; meaning it does not rely on external state (e.g. callingInstant::now).Use it carefully, it may eat your laundry!