Open jvican opened 8 years ago
So, I have a few thoughts here:
staticOnly
is meant to be about the generated picklers themesleves. i.e. DO NOT use any reflection in the code generated for the picklers. (These should be scala-js friendly).So basically, I'm ok adding a RuntimeLookup
flag with NoRuntimeLookup
as something that can be imported in-tandem with StaticOnly
. I can also update the docs to reflect this if you think it's a good idea.
Right now, we force the user to both select the runtime strategy and import
StaticOnly
so that only static picklers are used. However, the importStaticOnly
should already decide to use one the runtime strategy that doesn't fallback to runtime generation when looking up tags. We may also want to add another implicitStaticOnlyWithLookup
that will use the only-lookup runtime strategy.Current limitation: the runtime strategy is defined in the package internal, that is initialized at boot time. As it's a top-level member, it can't depend on a user-imported implicit.