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

Feature: Variable Binding #37

Open
billyrrr opened this issue Jan 31, 2022 · 3 comments
Open

Feature: Variable Binding #37

billyrrr opened this issue Jan 31, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@billyrrr
Copy link

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 billyrrr added the enhancement New feature or request label Jan 31, 2022
@imcuttle
Copy link
Owner

imcuttle commented Jan 31, 2022

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.

@billyrrr
Copy link
Author

billyrrr commented Feb 1, 2022

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} /> ]

@imcuttle
Copy link
Owner

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

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

No branches or pull requests

2 participants