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
[RFC] Deprecating custom MapperContainers #159
Comments
Thanks for considering me! I believe that at this time, all my projects use the global container. I can't recall having had to scope any mappers so far. A bigger pain point for me at the moment is what happens when one package depends on another and both depend on dart_mappable. Specifically as it relates to version mismatches and mapper discovery. Can go into more detail on this later. |
Thanks for the heads up! I do not use |
I think that there's needed a better mechanism to make it easier to work with modules that uses dart_mappable internally. I think that idea of mapper Container on itself is a good, but it needs a better consideration (to make implementation less constrained and allow for performance shortcuts) and to make it easier to share or to exclude mappers for dependency chains I think that mapper containers just need to be remade into a better protocol, here are some bullets that really needed in my opinion:
While it may sounds like a huge effort, I think in a long term it would make package easy and safe to use in supply chains: package maintainers will receive flexible tool that would support extensible data without additional efforts (generics would be able to utilize other packages mappers) and users receive a neat API with multiple packages magically works with themselves with no additional efforts, at the same time if needed stuff can be configured for a more tight requirements. Hope this idea/s will help you |
I'm looking into deprecating the feature to create custom
MapperContainer
s and trying to understand how that would affect current users of the package.What would be deprecated and removed in a future version.
Creating custom instances of
MapperContainer
s and container linking.The following would not be possible anymore:
What would not be deprecated or removed.
Using the global instance of
MapperContainer.globals
or a similar static construct will continue to work.The following would still be supported (but maybe have a different syntax):
Why the change?
Removing MapperContainers could potentially greatly improve performance of this package while also reducing complexity of the implementation.
Who is affected?
Its unclear how many users (if any) actually use this feature but I recon quite few. The main feature custom containers are used for is scoping mappers to only a part of your application, or having different mappers for the same type.
Its debatable if these cases even are desirable for serialization, but If needed could potentially also be implemented without custom mappers through manual setup.
@nblum37 @point-source @caseycrogers Tagging you since you have been involved in this package before. Kindly let me know if or how you use this or if you have any comments.
The text was updated successfully, but these errors were encountered: