Page MenuHomePhabricator

[MEX] Add support for Javascript object-type expressions to php-vuejs-templating
Closed, ResolvedPublic

Description

The following:

<span v-if="hasReferences" :class="{ 'wikibase-mex-icon-expand-x-small': !showReferences, 'wikibase-mex-icon-collapse-x-small': showReferences }"></span>

is a somewhat reasonable conditional class expression that we might want to include in our Vue code. In order for this to work, and for other cases where we want to handle Javascript objects as expressions in our Vue code, we would need to add support for such statements to php-vuejs-templating.

Add support for these kind of expressions to php-vuejs-templating

Acceptance Criteria

  • php-vuejs-templating can handle complex Javascript expressions
  • the example statement is correctly translated to a html class attribute

Event Timeline

Might be interesting to look at https://github.com/mck89/peast here, since that is already used in Mediawiki - for example in https://github.com/wikimedia/mediawiki-libs-Minify .