Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

named variants #38

Open
pi0 opened this issue Aug 25, 2020 · 0 comments
Open

named variants #38

pi0 opened this issue Aug 25, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@pi0
Copy link
Member

pi0 commented Aug 25, 2020

Originally mentioned by @hecktarzuli (#34 (comment))

I'm also toying with the idea of revamping the MVT support. Currently it's just 'sections:#' and weights but in practice I would find it very hard to code an experiment against a variant index and an intVal vs a named obj with values. For example.
As a user, I'd prefer something like this
if($exp.$activeVariants.buttonColor == 'red') ..
if($exp.$activeVariants.headerText == 'excited') ..
vs
An array of variant objects ($exp.$activeVariants)
[ {weight: 25 }, { weight: 25}, {weight: 25 }, { weight: 25}]..
This idea is pretty new and not totally flushed out, but if we do decide to go in this direction, then we'd want a new major version for sure.

As a non breaking change, we may support new flattened $exp.variants[name || index] computed property which is an object from itentifier to variant object.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant