Skip to content

Conversation

@codders
Copy link
Contributor

@codders codders commented Jun 26, 2025

Until now the Javascript expression handling has been limited to simple expressions and has used regexps to process the strings of Javascript code. As we move to support more advanced Vue features, we need to be able to process more complex Javascript expressions and need to move away from regexps.

Peast is a library that is already used in Mediawiki that converts Javascript expressions into an abstract syntax tree representation. Using Peast we can more reliably parse Javascript and implement more complex expression handling.

Refactor the existing BasicJsExpressionParser to use Peast, and add handling of Object expressions ({ test: 'value' }).

Bug: T396855

@codders codders requested a review from lucaswerkmeister June 26, 2025 07:59
@codders codders force-pushed the feat/peast-complex-expression-support-20250625 branch from a51db66 to 9fb9cb6 Compare June 27, 2025 06:48
Until now the Javascript expression handling has been limited to
simple expressions and has used regexps to process the strings of
Javascript code. As we move to support more advanced Vue features,
we need to be able to process more complex Javascript expressions
and need to move away from regexps.

Peast is a library that is already used in Mediawiki that converts
Javascript expressions into an abstract syntax tree representation.
Using Peast we can more reliably parse Javascript and implement
more complex expression handling.

Refactor the existing BasicJsExpressionParser to use Peast, and
add handling of Object expressions (`{ test: 'value' }`).

Bug: T396855
@codders codders force-pushed the feat/peast-complex-expression-support-20250625 branch from 9fb9cb6 to 2ed9ddd Compare June 27, 2025 07:00
@lucaswerkmeister lucaswerkmeister merged commit ba6b825 into master Jun 27, 2025
8 checks passed
@lucaswerkmeister lucaswerkmeister deleted the feat/peast-complex-expression-support-20250625 branch June 27, 2025 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants