Closed gedw99 closed 1 year ago
https://github.com/ajstarks/deck/blob/master/deck.go is using struct tags and decksh imports and calls this for the generation. Also the utils package / repo also has xml related code
here is the IDE: https://github.com/zalify/easy-email Its react but shows the concept, as well as how a merge happens on a user changing something. But i am planning to build the equivalent with gioui, rather than react. You can try the live demo and its quickly apparent how it can be used for deck xml.
It can i think also be used for decksh. In this case the decksh is being parsed and the deck xml is rendered with giodeck, just like we od now with the pipeline. We just need to add the Design time edit gui to the GIO output. Then as the user ( via the Design time editor changes the decksh markup and it re-renders, but only the changes, which get merged. This is all explained in https://github.com/zalify/easy-email#how-does-it-work
This is using json, not xml though.
i got it down to less than 1 mb when stripped, wasm compressed and gzipped -rwxr-xr-x 1 apple staff 2.9M 9 Sep 10:27 decksh.wasm -rw-r--r-- 1 apple staff 862K 9 Sep 10:27 decksh.wasm.gz
@ajstarks If you are not at all interested in getting this working for WASM compilation, just let me know.
Note that decksh does it's own XML generation without using encoding/xml.
good point.. I thought i was going crazy initially cause there was no import of "encoding/xml" ....but the github.com/ajstarks/decksh go.mod imports bring in other things that do use the xml encoder from what i can see.
do you have any ideas on this ?
what i see are:
Hey @ajstarks this xml golang pkg can do xml encode / decode and get around the wasm tinygo issue perhaps. going to try it out.
The xml generation is blocking compilation to wasm and wasi.
Am playing around with building a basic editor and want to run decksh in the browser, so its easier for people to use. Doing compilation stages in the browser makes the editor experience much faster for the user.
This is compiling ./decksh/cmd/decksh/. to WASM using tinygo.
Its when the xml is saved. This is really common problem with tinygo. need to see if there is equivalent for xml :) Its a well known limitation https://tinygo.org/docs/reference/lang-support/stdlib/#encodingxml
everyone uses https://github.com/buger/jsonparser for json encoding and decoding with tinygo. Its much faster at runtime too due to not using reflect.