hadronized / warmy

Hot-reloading loadable and reloadable resources
Other
215 stars 14 forks source link

Another attempt at adding a context type #11

Closed icefoxen closed 6 years ago

icefoxen commented 6 years ago

Basically experimenting with redoing #4 with the current warmy. You end up with whatever your context generic type is propagating everywhere, which is a little nasty... but it actually ends up no more complicated to use, so.

Don't really expect you to merge, just wanted to show you this experiment.

hadronized commented 6 years ago

Thanks, I’m having a look!

hadronized commented 6 years ago

Hm, I find it a bit hard to get what’s going on because of the diff with rustfmt… I need to look closer.

hadronized commented 6 years ago

I like the overall direction where this thing is heading. However, I’m still confused about the fact keys get impacted. I’ll try to see whether I can scratch another design so that they don’t.

icefoxen commented 6 years ago

Yeah like I said, the generic type for the context gets everywhere. Key<T> need it because the T needs to implement load() methods that take the right Context type. I haven't really come up with a good way around it yet.

hadronized commented 6 years ago

I think it’s going to be a bit hard to merge this like that – I don’t really feel comfortable with the rustfmt changes, and I prefer to have separate commits for formatting vs. real changes. However, if there’s a way to setup rustfmt so that it has capitilized symbols first in the import list, I might consider using it as well.

hadronized commented 6 years ago

With the current master, you don’t have to type keys anymore, so that C type doesn’t leak everywhere anymore.

hadronized commented 6 years ago

Thanks for your PR! I’ve integrated your ideas in the the current HEAD. I’ll release a new version soon.