Convert all XML artifacts to JSON

I have come to the conclusion that we need to convert Moqui to a JSON-centric platform or die on the vine. The main reason for doing this is to make it AI friendly. I have spent the last couple of months investigating how difficult it would be to go from a natural language requirements specification to a working Moqui app. I focused almost entirely on the UI aspects of this task. I got to the point that I had the server generate JSON UI data and it was sent to the client which quickly converted it to Vue/Quasar macros - which is pretty much in line with what Moqui 4.0 is doing (except the JSON part).

When I started looking into the “natural language to a working app” task, I figured it would have to start with a markdown description of what is desired. Then, in order to keep the context window as small as possible, I had AI convert the description to Groovy DSL which matched the Moqui screen macro - like form-single, form-list, etc (but I added a bunch of new macros). Then I would validate the Groovy DSL and convert it to a screen XML file. Then the runtime would convert the XML to JSON and send it to the client to be rendered. That is a lot of conversions.

The obvious evolution was to make the “source of truth” to be JSON. There is some validation to do, but, basically I could just send the screen definition file directly to the browser and have it converted there. I think that is just the beginning of the advantages to using JSON.

The big advantage is the ease with which Moqui can interface with AI. Three days ago I started asking Gemini to build a browser-based, agentic Moqui-generating IDE. It looks like a typical IDE, but it has an AI Chat window in the corner that uses WebMCP to connect to Gemini (but it could be any LLM) and Moqui. I think what I am doing is very similar to what Ean is doing, but the truth is that I haven’t looked at a bit of the code that Gemini has been writing. I do see that if all XML artifacts were converted to JSON there would be about a 50% reduction in Moqui code. But the main takeaway is that I have created an agentic IDE in three days without writing any code myself, and I could not have done that without working in JSON. JSON is the modern way to talk to AI and if we resist going in that direction we will keep paying an “XML tax” and we won’t be able to keep up.

This has already reached the TL;DR length, but I can demo my IDE on the Friday collaboration call ( https://meet.google.com/ues-nsnr-jom - is this call even publicized anywhere?).