#microformats 2018-03-19
2018-03-19 UTC
[cleverdevil] and KartikPrabhu joined the channel
# KartikPrabhu gRegorLove++ for going through hreview in the wild
# KartikPrabhu is working on hreview backcompat in mf2py
# KartikPrabhu hreview is weird enough that it breaks all rules about simple class subsitution!
nitot, tantek, [jeremycherfas], barpthewire, [pfefferle] and [kevinmarks] joined the channel
# [kevinmarks] Did gregorlove find examples that were that weird?
Adrian1, [kevinmarks], echarlie, [eddie], petermolnar_web_, jeremycherfas1, nitot, velope, Garbee, [cleverdevil] and [gerwitz] joined the channel
# jribbens edited /existing-rel-values (+241) "Undo revision 66678 by [[Special:Contributions/Tantek|Tantek]] ([[User talk:Tantek|Talk]]) - archived is in use and is not the same as 'archives'" (view diff)
# Loqi [masteragen] edited /rel-author (-49)
[kevinmarks], tantek and [jeremycherfas] joined the channel
# KartikPrabhu gRegorLove: does php-mf2 not distinguish between " item" and "item vevent" rules in hreview backcompat?
# gRegorLove It does
# KartikPrabhu how doe it do that?
# KartikPrabhu mf2py at the moment cannot because it applies all the class-substitution rules in order
# gRegorLove Replaces with p-item h-event: https://github.com/indieweb/php-mf2/blob/master/Mf2/Parser.php#L1528
# KartikPrabhu it does not seem to have "item" to "p-item h-item" though
# gRegorLove s/Replaces/Adds/
# gRegorLove That's in the base rules: https://github.com/indieweb/php-mf2/blob/master/Mf2/Parser.php#L1948
# KartikPrabhu hmmm so these other are some special cased ones?
# gRegorLove The `item x` variants are treated as special cases
# gRegorLove They get processed first, then the base rules.
# KartikPrabhu hmm ok I was hoping to avoid something like that in the JSON rules
# gRegorLove Ah, right. I'm seeing the issue now.
# KartikPrabhu JSON does not have any "ordering"
# KartikPrabhu or atleast not the format I have now
# gRegorLove I though I recently saw that JSON arrays are ordered (and was surprised by that), but maybe I misread.
# KartikPrabhu arrays are. but currently all rules are JSON objects aka dictionaries just like mf2 parsed results
# gRegorLove Ah
# KartikPrabhu I was thinking of keeping it simple and close to mf2 results format
# KartikPrabhu ok atleast python dictionaries are not, which is what JSON dicitonaries map to
# [kevinmarks] different languages treat them differently
# [kevinmarks] Python they're in hash order (so consistent by unpredictable) PHP they're in creation order and Go they're randomized
# KartikPrabhu right so language agnostic approach would be treat them as unordered
# KartikPrabhu yeah I thought so
tantek joined the channel
# KartikPrabhu :|
# KartikPrabhu Zegnat: I think mf2 ouput currently does not have duplicate object names due to parsing algorithm
# KartikPrabhu I guess I should check for that in my JSON rules tests
# KartikPrabhu yeah I think mf2 parsing algo at the moment treats objects as unordered (this seems right) and does not have duplicate keys. So I am good with adding these somewhere in the spec in a language agnostic way
# Zegnat Tim Bray worked together with the ECMA guys to get RFC 8259/STD 90 published, the “final” version of JSON. But in his release announcement he still says he recommends I-JSON because it “explicitly rules out some legal-bug-dumbass things”: https://www.tbray.org/ongoing/When/201x/2017/12/14/RFC-8259-STD-90
# KartikPrabhu lol
# KartikPrabhu makes mental note to use "legal-bug-dumbass" somewhere
# KartikPrabhu right those are arrays which are ordered
# KartikPrabhu but objects/dictionaries i.e. "{}" things are not
# gRegorLove That might have changed recently in php-mf2. I haven't been paying attention to ordering and latest version had some big changes to parsing recursively.
# Zegnat Not every array will keep source order though, e.g. PHP sorts the contents of "type" as seen here: https://github.com/microformats/microformats2-parsing/issues/22
# KartikPrabhu hmm
# KartikPrabhu Zegnat: mf2py does the same thing as Go so you can add that too
# Zegnat specifically https://github.com/microformats/microformats2-parsing/issues/22#issuecomment-372942396 where I talk about classList
nitot, nitot_ and tantek joined the channel
# KartikPrabhu so the only actual ordered thing in mf2 is the "items" array?
# KartikPrabhu sorry "items" and "children" arrays
# KartikPrabhu right. so "items" and "children" are document order all other arrays are random ("alphabetical") ordered ?
# KartikPrabhu objects are unordered
# KartikPrabhu not sure this is a problem in practical consumption, but some mf2py tests do treat property arrays as ordered in source order
# KartikPrabhu yes
# KartikPrabhu in python ["url1", "url2"] ! = [ "url2", "url1" ]
# KartikPrabhu but maybe that is also doc order (?)
# KartikPrabhu hmm yeah so only "type" is unordered then
# KartikPrabhu yeah not sure. I can fix the python tests. this seems to be an issue only for tests afaik
# KartikPrabhu right that was my bad
# KartikPrabhu yup. like using first "photo" as a fallback for "featured" or maybe also for authorship
# KartikPrabhu I don't see why all arrays can't be doc ordered. Just the tests need to account for those
# KartikPrabhu aah maybe I have not been doing this long enough :P
# KartikPrabhu tantek: currently the only unordered ones seem to be "type" and "rel-urls > rels "
# KartikPrabhu yup so update spec to specify "alphabetical" ?
# Zegnat If we want to make a clear distinction between explicitly ordered arrays (where there is a meaning to being first) and arrays that just happen to have an order because of the JSON format (but should be treated as order not having any meaning), we shouldn’t order both in the same way. So if the first group of arrays uses source order, the second is better of with a different ordering. Alphabetically is as good as any.
# KartikPrabhu tantek: I can add this to experimental mf2py
# KartikPrabhu hmm in python sets also means unique elements so maybe avoid "sets"
# gRegorLove I'm looking forward to a summary of this because I'm thoroughly confused :)
# KartikPrabhu oh in mf2 we don't remove duplicates
# KartikPrabhu so "h-entry h-entry" would give type = ['h-entry', 'h-entry']
# gRegorLove I'm just having a hard time following the whole discussion, what should/shouldn't be ordered. Could just be tiredness on my end. I'm not 100% today.
# KartikPrabhu tantek: yes
# KartikPrabhu gRegorLove: no worries. Zegnat will make an issue ;)
# gRegorLove I'll follow up with any specific questions if I can formulate them.
# gRegorLove sleep++
# KartikPrabhu Zegnat: sleep++
# KartikPrabhu ha!
# gRegorLove hahah
# KartikPrabhu Zegnat: night! might update mf2py anyway :P
# Zegnat No problem, leave a note in here if you update the version on https://kartikprabhu.com/connection/mfparser so I know I can use that as a bleeding edge example tomorrow morning
# KartikPrabhu :thumsup:
# KartikPrabhu actually python sets do both de-duplication and ordering so this should be easy
# KartikPrabhu aah another case for class = "u-url u-url" should the url proprty have repeated entries?
# KartikPrabhu tantek ^
# KartikPrabhu oh! so this change is in parsing the HTML not in mf2 per se
# KartikPrabhu got it!
tantek and chrisaldrich joined the channel