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

Add a WASM example #16

Open
Aaltuj opened this issue Jan 7, 2021 · 5 comments
Open

Add a WASM example #16

Aaltuj opened this issue Jan 7, 2021 · 5 comments
Assignees
Labels
documentation Improvements or additions to documentation
Projects
Milestone

Comments

@Aaltuj
Copy link
Owner

Aaltuj commented Jan 7, 2021

By popular rquest add a WASM example.

VxFormgenerator should support WASM.

@Aaltuj Aaltuj added the documentation Improvements or additions to documentation label Jan 7, 2021
@Aaltuj Aaltuj added this to the Improve documentation milestone Jan 7, 2021
@Aaltuj Aaltuj self-assigned this Jan 7, 2021
@Aaltuj Aaltuj changed the title Adding a WASM example Add a WASM example Jan 7, 2021
@Aaltuj Aaltuj added this to Backlog in Roadmap via automation Jan 7, 2021
@Aaltuj Aaltuj moved this from Backlog to To do in Roadmap Jan 7, 2021
Aaltuj pushed a commit that referenced this issue Jan 8, 2021
Aaltuj pushed a commit that referenced this issue Jan 8, 2021
Aaltuj pushed a commit that referenced this issue Jan 9, 2021
@Aaltuj Aaltuj moved this from To do to Done in Roadmap Jan 17, 2021
@Aaltuj Aaltuj modified the milestones: Improve documentation, 0.6.0 Jan 21, 2021
@mserey
Copy link

mserey commented Jan 24, 2021

Hi, I need implement this feature but in my WASM project.
but through a configurator that saves this configuration in the database. What do you recommend me. is this library available in nuget?

@Aaltuj
Copy link
Owner Author

Aaltuj commented Jan 26, 2021

hi @mserey,
You can find the nugets here.
The readme in the develop branch contains the WASM Setup, no release yet, but 0.4.0 should work with those instructions.

Not sure what you mean with 'but through a configurator that saves this configuration in the database'

@mserey
Copy link

mserey commented Jan 26, 2021

Hi
Instead of drawing the form through a poc, we must do it dynamically through a form builder whose configuration will be saved in the database. We thought to use expandobject generating the object at runtime obtaining the parameters from the database

@Aaltuj
Copy link
Owner Author

Aaltuj commented Jan 27, 2021

Aah I see what you are trying to accomplish. That is indeed the usecase for the expando object. However #5 is on the roadmap, here the idea is that the ExpandoObject will be deprecated, in favour for a JSON based schema. (this should be more a less a serialized object containing Built-in classes. Like the VxFormElementLayoutAttribute and the ValidationAttributes)

{
   "nameOfProperty": { // name of the property
     "attributes": 
                    {"MinLength": { "Length": 5  }, 
                     "Required":{}, 
                     "VxFormElementLayout": {  // VxFormElementLayoutAttribute  
                                          "label": "",
                                          "order": 0
                                          }",
                                           
                     }, // Attributes
     "type": "String", // Or a custom type
     "value": "The value of the property" // could be a complex type
    }
}

// Following this approach it is easier to parse and we could create nested objects as well, supporting VxGroup etc..

Under the hood there is a converter that use a 'empty' base class, where the properties would be added dynamicly via reflection.
This converter is can be built separately from the generator and create an object that is usable with the form generator.

This also allows to construct an object with reflection added attributes, so no need for the component to handle the expandoobjects anymore. It is just an annotated object this way, removing complexity in the component and easier external definition storage.

so... to make a long story short: I recommend you try the described approach up here. Otherwise use the expando object way, but that doesn't support validations...

Feel free to add an concept of your solution in the issue #5 so we can discuss your proposed implementation . It would be nice if you could take issue #5 some steps further.

@mserey
Copy link

mserey commented Jan 28, 2021

ok I'll take your recommendation and try to dynamically build an object through reflection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Development

No branches or pull requests

2 participants