-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
@NavTypeSerializer is not visible when defined in another module #265
Comments
Okay, this is getting more complex by the minute... UUID obviously implements java.io.Serializable. Documentation says custom serializers shouldn't be needed for these types, ok, but I get
Defining a duplicate of the serializer as
now leads to the following:
This is because I'm using a multiplatform uuid where Uuid is defined as
If I explicitly change the serializer to java.util.UUID it does not produce any error. |
Hi @Nek-12! Thanks for pushing the boundaries with this library ahah 😄 I get the second error, and it's an easy fix. As for the initial request, I'll have to check, but the proposed solution does sound like something I could do 👍 Regarding the error, you're getting with serializable. This is basically here because since your screen has deep links which must be able to take this argument type, you need to specify how exactly your UUID will be represented in the route, otherwise, if we use the default serializable nav type, it will look like base64 random string and on deep links, we need to have more visibility I believe. So if you weren't using deep links with mandatory nav arguments of these types (Serializable/Parcelable) then you wouldn't need any NavTypeSerializer. |
@Nek-12 the second error should be fixed with newest version of the library. |
This also seems to be a duplicate of #173 |
Correct! Thanks @Nek-12 👍 closing this one |
I'm struggling with the architecture of passing an UUID as a destination parameter.
I'm using an UUID as an argument, and the compiler wants to see a serializer for that type, but I've defined it in my common-navigation module which I include into my current module, and it still does not compile.
I'm now forced to copy and paste the serializer into each of these modules. The implementation of the serializer object simply delegates to an actual
UUIDSerializer
, which I obviously already have in my project, but it's defined in another module.Desired behavior:
I want to annotate a destination parameter with something like
@SerializeWith(UUIDSerializer::class)
just like it's done in the kotlinx.serialization library.That would solve the visibility problem (which I assume you won't be able to fix), the duplication problem, architecture, and also allow for different serializers for each composable / parameter, unlike it's done now (what if I want to serialize something in different ways in 1 module?)
The text was updated successfully, but these errors were encountered: