From 6b4575ff8bbbea9bdd25b63acb57dd7f5366569f Mon Sep 17 00:00:00 2001 From: Robert Krahn Date: Wed, 10 Jan 2024 09:47:51 +0100 Subject: [PATCH] note related to the #34 TypeId issue --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a398b3f..c677f33 100644 --- a/README.md +++ b/README.md @@ -250,6 +250,8 @@ Since `#[no_mangle]` does not support generics, generic functions can't be named If your hot-reload library contains global state (or depends on a library that does), you will need to re-initialize it after reload. This can be a problem with libraries that hide the global state from the user. If you need to use global state, keep it inside the executable and pass it into the reloadable functions if possible. +Note also that "global state" is more than just global variables. As noted in [this issue](https://github.com/rksm/hot-lib-reloader-rs/issues/34), crates relying on the [TypeId](https://doc.rust-lang.org/std/any/struct.TypeId.html) of a type (like most ECS systems do) will expect the type/id mapping to be constant. After reloading, types will have different ids, however, which makes (de)serialization more challenging. + ### Use feature flags to switch between hot-reload and static code