Parceler support is too strong
Closed this issue · 5 comments
After merging : https://github.com/f2prateek/dart/pull/76/files
@johncarl81 @iainconnor
we see a problem : devs need Parceler to serialize something like an ArrayList. It would even try to use Parceler if it is not available, making the intentfactory and extrainjector fail.
Good catch @dlemures !
So, we would like to make things a bit more subtile :
- for collections whose elements use Parceler, use Parceler
- for collections that are serializable whose elements don't use Parceler, use serializable
- for collections that are not serializable whose elements don't use Parceler, they are not accepted
- for types that use Parceler, use it (e.g. @Parceler class House)
Parceler serialization should be a fallback. If you can serialize using a native technique then you should opt for that.
Yeah, that's exactly our problem right now. We are patching in #93
This may be relavent if you're looking for a different approach to support Parceler: #36
I think our current problem are not really solvable via adapters. But tomorrow we should get something stable on #93
Fixed #93
Final strategy:
- If Parcelable is available, and the collection can be handled by it (elements are Serializable, Parcelable or use @parcel), use Parceler.
- If Parcelable is not available, but the collection is serializable, we accept them.
- If Parcelable is not available, but the collection is not serializable, we don't accept them (we cannot).