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
Nested type registries #1134
base: main
Are you sure you want to change the base?
Nested type registries #1134
Conversation
… create NestedTypeRegistry outside from Hive package
# Conflicts: # hive_generator/pubspec.yaml
…pasted code, better naming
NestedTypeRegistry: increase type limit with backward compatibility and id overriding
Because it's out of scope of this patch
It should not be encouraged
Please make this possible, we are struggling! |
The feature is ready, but there's some issues with web builds needs to be fixed. I will take a look when I have some free time, but can't promise any ETA. |
I will wait for it! |
The goal of this PR is to add nested registries to hive in order to increase typeId limit for the models.
The original implementation has been written by @xal with #804.
The final design adds the following api to the hive
TypeRegistry
interface (which is accessible throughHive
singleton value).Basically put the
registerNestedAdapters
method lets users to allocate a single typeId and use it for a nested type registry which can be used for registering multiple types with a single id. The nested type registry has similar characteristics as the global type registry like 256 typeId space for each nested registry, typeIds should be unique and should not be changed after being written to the disk.