mometa icon indicating copy to clipboard operation
mometa copied to clipboard

Feature: Variable Binding

Open billyrrr opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe. I did not find a way to adjust code by injecting variables.

Describe the solution you'd like image

Describe alternatives you've considered Directly modify code.

I will implement/expose an interface to inject a variable into code. This allows more advanced usage to be developed. I hope that the pull request implementing this feature can be accepted.

billyrrr avatar Jan 31 '22 05:01 billyrrr

The feature may requires the UX design? eg. It should show a dialog for user custom variables code?

And use json schema to describe the variables, the json schema could be rendered as form in right panel.

The feature is a huge change which needs a lots of exact description(PRD) for it.

imcuttle avatar Jan 31 '22 09:01 imcuttle

I was thinking of something more plain and simple. At UX-level, it can be variable name + textfield, and material implementation can opt to hide the textfield and offer its own component used to tweak/input the variable to be bound.

My original intention was to introduce (as a material library) Antd pro component playground: proform. The demo site offers a complete implementation of the control panel. What I hope to do is to bind the output of proform playground panel to the code. Since sometimes procomponent “column” variable can contain a reference to itself, the variable cannot be inlined. (See below for an example; I hope to use customized widget to generate the value of “columns” and let it be injected as a constant in the component definition) const columns; columns = [ { 'name': 'action', 'render': () => <ProDescription columns={columns} /> ]

billyrrr avatar Feb 01 '22 12:02 billyrrr

I was thinking of something more plain and simple. At UX-level, it can be variable name + textfield, and material implementation can opt to hide the textfield and offer its own component used to tweak/input the variable to be bound.

My original intention was to introduce (as a material library) Antd pro component playground: proform. The demo site offers a complete implementation of the control panel. What I hope to do is to bind the output of proform playground panel to the code. Since sometimes procomponent “column” variable can contain a reference to itself, the variable cannot be inlined. (See below for an example; I hope to use customized widget to generate the value of “columns” and let it be injected as a constant in the component definition)

`

const columns;

columns = [

{

'name': 'action',

'render': () => <ProDescription columns={columns} />

]

`

you can implements it in your component's inner. and import it by mometa

imcuttle avatar Feb 12 '22 04:02 imcuttle