I just noticed the release notes for @gotink’s #JavaScript #KDL parser and it has this new tool for defining KDL<->JS mappings in a more complex way than just JiK. This is AMAZING. It lets you really harness the power of KDL’s node-based system but still work easily with JS objects, in a well-defined and structured way!
Cause sometimes what you really really want is a tree structure, not just objects and arrays. And you never want yaml, even if you think you do :P
@zkat I'm glad you like it! I want to iterate over it a little before publishing it as stable API though.
I've already had to make a few changes when I tried to use it for the first time for the `.config/prettier.kdl` file
I want to add one extra API, one that's a bit more high-level and rigid but that takes care of both serialization and deserialization in one go and that could later gain support for applying modifications to a KDL file by making changes to the mapped JS data.
@gotink it would be super interesting to have this API AND also make it format-preserving btw
@zkat I want to give it a shot but I want to try format preserving changes in the more limited API first because I'm more confident I can get that to work
@zkat Ok never mind, I had an epiphany on how to tackle this during NYE dinner—no one at the table noticed, thankfully—and I've been able to implement it!
It requires a small extra step during deserialization and serialization in order to link the serialization with the deserialization so the serialization code can access the original KDL structure, but that should be easy enough in most scenarios.