Unfortunately this code needs to be written because od Emscripten limitations.
Good news is that only two stores needs it, Threads (this one, which is the biggest and most complicated) and Messages which are simple. This is a lot of code, but it's really easy, just converts null -> NullableString on JS and std::unique_ptr -> NullableString in C++.