Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expression AST builder #56748

Closed
6 tasks
streamich opened this issue Feb 4, 2020 · 3 comments · Fixed by #64395
Closed
6 tasks

Expression AST builder #56748

streamich opened this issue Feb 4, 2020 · 3 comments · Fixed by #64395
Assignees
Labels
Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) Feature:Visualizations Generic visualization features (in case no more specific feature label is available)

Comments

@streamich
Copy link
Contributor

Create utilities for building expression chain AST. visualizations plugin will use those utilities in build_pipeline.ts to construct expression chain AST for each visualization, instead of concatenating strings to construct raw expression pipline string.

  • AST builder utilities to construct all parts of expression AST:
    • Chain;
    • Expression function;
    • Arguments;
      • Sub-expressions in arguments;
  • Export builder statically for visualization plugin to consume.

Parent issue: #46909

@streamich streamich added Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) Feature:Visualizations Generic visualization features (in case no more specific feature label is available) Team:AppArch labels Feb 4, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

This was referenced Feb 4, 2020
@lukeelmers
Copy link
Member

We should get input from the Canvas team on the design of this to make sure it is something they could use too -- last time I had discussed with Joe, he had mentioned they considered writing something like this for manipulating the AST via the Canvas editor, but never ended up doing it and stuck with manually editing the AST. Things may have changed since then, but worth looking into.

@lukeelmers
Copy link
Member

lukeelmers commented Feb 4, 2020

For reference this was an exploration I did way back when about how to make it easier to manipulate the expression strings.

The thing we decided from this POC was that we definitely don't want to keep manipulating the string directly like this, but rather build something to work with the AST directly as you describe here. This has a bunch of obvious benefits including type safety.

I never got around to updating that POC to work with the AST, but thought I'd share here in case it is useful in any way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) Feature:Visualizations Generic visualization features (in case no more specific feature label is available)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants