-
Notifications
You must be signed in to change notification settings - Fork 13
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
Design suggestion #3
Comments
Hey Morten, i am currently looking for a solution to do exactly what you already did. I stumbled upon some repos all with more or less exciting results i am almost ready to implement it myself. If you dont mind i would like to take a look at your working version we migth find a mutual agreement to further advance this dynamic rendering. Cheers! |
@severinkehding Thanks for your interest. The code is currently a part of a closed-source project but I can be persuaded to work on extracting it and releasing it as OS on github and npm if someone (you?) will commit to help with docs and maintenance. Otherwise I do not have time. The code is high-quality with tests but currently no docs apart from some comments. |
@mmc41 send me a PM in Gitter and we can discuss, although I am in Australia so being 1am I am off to sleep now so I will follow up tomorrow :) Frankly I have been looking at two half started implementations and haven't decided yet which way to go, so I am open to understanding more solutions further to try to find the best end solution for users. |
@Anthropic Will send you a msg tomorrow. What is your Gitter channel / username ? |
@severinkehding @Anthropic I took a little time to repackage the code for the proposal as a independent project which has been released on npm as "json-schema-js-gui-model". See the source on github. I am still interested in combining efforts, in particular on the json schema ui extensions. |
@mmc41 had a quick look on the weekend, I like what I see, I need to find more time to wrap my head around TypeScript. Can you export a TS lib and then still using TS es6 syntax import it into another lib? Ran into issues with the core and importing it into ASF in es6 format and everything breaking due to babel changes in v6, just wondering if you know how well TS would handle making a bundle you can bundle in another bundle :) |
Note sure about your particular use case, but yes you can export typescript from one module and import it in other modules. Generally, you just add an index.d.ts file in addition to the index.js file and an types entry to the package.json file. You can see how it is done in the json-schema-js-gui-model project. BTW: I am working on a v2.0 of my libraries that transpiles into es5 to work better in browsers. The prerelease code is committed to GitHub but not released as npm yet. P.S. The approach I suggest of compiling json schema to a gui model which in turn is used to construct a UI form, is similar to a Intermediate Language (IR) of a classic compiler and is a well-known way to decouple things. It makes it much easier to innovate and contribute. |
I import typescript left and right, and runtime-compiles in my solution, IMO, basically all ways work. @mmc41 One could call the XHTML representation of the DOM model the intermediate language. |
@nicklasb Yes, in fact there are many intermediate representations/languages at different abstraction levels. For instance, microcode, assembler, and java byte code are all representations of essentially "the same thing" at different abstraction levels. The point is that a good IR is well suited for a particular use at a particular abstraction level. The DOM is for a different use and for a different abstraction level, than the proposed IR for UI forms. |
@mmc41 if you run the ASF demo and in chrome dev tools search the source for |
@Anthropic Hi Anthropic
I just completed a schema based form editor for angular 2 for a future project and I would like to discuss my solution with you - if you are interested? - since I think some of my ideas might be useful for this project and I am interested in co-operation.
My proposed solution consist of:
This solution is very simple yet works fine for my yet-to-be announced OS project. See example of an Angular2 form below using this approach. The code could be extended to work with any web framework with modifications to step 3. The main idea, which I think could affect this core project is to introduce a gui model - or a IR (intermediate representation) in other words - as a translation target for the core AND to simplify things by not putting validations stuff into it but still requiring a fast schema validator to be used in the gui rather than standard validation api's for form elements.
Example of dynamic from produced from a json schema:
An example of how an instance of the corresponding gui model could look like is shown below:
And the corresponding source schema looks like is shown here:
Let me know if you think this sounds interesting?. If so, we could co-operate on a "standardised" gui model and a translator from json schema to that model. As noted, I have an initial version working.
/Morten
The text was updated successfully, but these errors were encountered: