#microformats 2021-08-09

2021-08-09 UTC
hendursaga, ur5us__, Seirdy, [chrisaldrich], [Sam_Butler], klez, Kaja_, aaronpk, GWG, sknebel, corenominal[d], Zegnat, strugee, P[m], DavidWeekes[m], hala-bala[m] and jacky joined the channel
#
jacky
back back
#
jacky
random question: is there a special need to sort (or to avoid sorting) the children in a mf2 item?
#
jacky
well it's not random - I'm working on a patch for the rust microformats parser and I'm curious if this is a breaker
#
jacky
hmm okay it's saying "document order"
[fluffy] joined the channel
#
[KevinMarks]1
The children are a list so have an implied order, which is document order, The place where there is ambiguity is for properties, as different languages have different default orders for their dictionary types - PHP and JS are creation order, Python is hash order, Go is random order (to stop you assuming order) so iterating the properties needs care. I don't know what Rust does.
jeremycherfas, hendursa1, neceve, theshawe, ur5us__, [Rose], [grantcodes], Ramon[d], hendursaga, charukiewicz and [jacky] joined the channel
#
[jacky]
Rust allows for any of the above with specification so I'm leaning on document order
#
[KevinMarks]1
another option is sorting keys alphabetically when writing json to make diffing clearer - I have seen this specified in some contexts (as well as normalising keys and values to utf8 rather then escaped unicode )
#
[tantek]1
yes the "document order" aspects of the parsing spec are essential. nothing "optional" there
jacky, kimberlyhirsh[d], jeremycherfas and gRegor joined the channel
#
[jacky]
Is there a particular reason for it? Tbh the inclusion of this (re: keeping it document order) would make it actually easier to implement signed forms of Microformats JSON (though that's not necessary - just something I've noticed now as a possibility)
#
sknebel
[jacky]: particular reason for what? child order: see e.g. any feed for why you might want document order
#
[jacky]
that's true
#
[jacky]
and I guess to keep it 'simple', enforcing across the board works
#
[jacky]
and it's simpler than having to figure out what to sort them against (id vs url vs etc) when none are guaranteed
#
Loqi
sknebel has 1 karma in this channel over the last year (32 in all channels)
#
[tantek]1
sknebel++ exactly
[max], jacky, Seirdy, ur5us__ and KartikPrabhu joined the channel