#wordpress 2017-10-22

2017-10-22 UTC
EmreSoku_, tantek, sebsel, [tantek], [kevinmarks], tbbrown, doubleloop[m] and snarfed joined the channel
#
snarfed
GWG: which plugin is this class in?
#
GWG
I'm writing it in Post Kinds
#
GWG
I have been thinking about writing it for over a year.
#
GWG
I don't like moving things around too much
#
GWG
If there are functions to call, then it avoids the issue of fixing it
#
GWG
I might add it to multiple plugins to do the same, but dependency management in WordPress is nonexistent.
#
snarfed
honestly these kinds of abstraction classes aren't worth the effort nearly as often as people think
#
snarfed
you don't end up change underlying implementation as often as you expect, and you still have to implement the new one inside the abstraction each time
#
GWG
I don't intend to change it intentionally
#
GWG
I just keep writing the same functions over and over again
#
GWG
Either way, I've changed the underlying implementation three times.
#
GWG
From the original storage to mf2 prefixed storage.
#
GWG
And now again to match the Micropub implementation.
#
GWG
I intend to fix it so I don't change it again.
#
snarfed
but of course you may have to change it again, at some point
#
snarfed
and with an abstraction class, you'll still have to build the new implementation inside the class, even if not outside it
#
GWG
snarfed: I was storing in something similar to jf2, but Micropub stores in mf2 json
#
GWG
So, how do I reconcile that?
#
GWG
Except to build something that can read either and spit it out the same way
#
GWG
I didn't account for nested microformats, and now I may need them
#
GWG
It's my own fault
#
snarfed
eh it's not about fault
#
snarfed
things change. you can handle it either with migration code that migrates old formats to new formats, or with a layer that can read write all formats like you're proposing
#
snarfed
the former is usually more maintainable over time, but up to you
#
GWG
snarfed: I intend to see about migration. But I still want to make it so anyone who is trying to use my code doesn't have to worry about it, by having a mf2 get function.
#
snarfed
eh. if you want to build a library as well as an end user plugin, ok, i guess, but they're two different things
#
GWG
It's a library for use within the plugin.
#
GWG
I just might reuse the code in my other plugins.
#
GWG
I do that already.
#
GWG
The settings code in most of my plugins is the same.
#
GWG
There, again, annoyed at a lack of easy way to do so without bundling it all.
tbbrown joined the channel
#
GWG
snarfed: Any advice you can give is always appreciated.
#
snarfed
sure! my advice is that this sounds like a halfway measure toward https://github.com/indieweb/wordpress-uf2/issues/30
#
Loqi
[dshanske] #30 Microformats 2 Rendering
#
snarfed
...which is ok, but we should probably just tackle that and implement it directly
#
snarfed
i think the main missing piece is picking someone who will own and drive it to completion
#
snarfed
whether you, pfefferle, kraftbj, or someone else. (i demur. :P)
#
GWG
Haven't heard from kraftbj
#
snarfed
sure, we don't need to block on him though
#
GWG
No one seems to want to own it
#
snarfed
exactly, which is why it hasn't happened yet
#
GWG
I'm afraid to.
#
GWG
I keep changing things.
#
snarfed
change is the way of the world!
#
snarfed
change is the only constant
#
GWG
I know
#
snarfed
embrace it
#
GWG
But I'd feel better if I felt more confident about an implementation
#
GWG
There are still too many variables.
#
snarfed
owning it doesn't mean you have to choose all the design details yourself. lots of us will give feedback and help!
#
snarfed
owning it just means you nag everyone until you have enough feedback that you think it's ready for a first pass
#
GWG
How do I start building something without designing it?
#
GWG
Also, where do I build it?
#
snarfed
you only have to design a small MVP sketch to start building it
#
snarfed
we have a few designs in that issue, we just need to agree on one - or at least propose one and give people time to disagree, and if they don't, we run with it
#
GWG
I've never done an MVP sketch
#
snarfed
sure you have! plenty of times. every time you've built something
#
snarfed
if you want to, you can totally drive this. nothing's perfect at the beginning (or ever) anyway, you ship something that's halfway decent, and iterate
#
GWG
I'll think about it.
#
GWG
I still want to get checkins working first.
#
GWG
Even if I have to change.
#
snarfed
sure! sgtm
#
GWG
I may be able to come up with something as I refine my individual implementation
#
GWG
I edited the wiki page of WordPress Data storage and should update it again to outline a consistent storage method, which will solve my immediate problem
#
Loqi
gwg has 16 karma in this channel (264 overall)
snarfed joined the channel
#
GWG
snarfed: Got time for one more idea bounce?
#
GWG
mf2_content vs post content
#
snarfed
GWG: yup! don't ask just ask
#
GWG
I didn't wait for an answer.
#
snarfed
:P what's the question?
#
GWG
mf2_content vs post content
#
GWG
The Micropub plugin stores the content property in meta.
#
GWG
WordPress stores it in the post_content field
#
GWG
How does one decide what takes precedence?
#
GWG
It sort of creates a post editor issue
#
snarfed
what are you doing with it?
#
GWG
Just retrieving it right now
#
GWG
One of the things I wanted to do was detect if it was rendered statically or dynamically.
#
GWG
And be able to convert between the two.
#
snarfed
ok! the mf2 data is intended to be exactly what we received via micropub
#
snarfed
post content is what's rendered
#
snarfed
so...choose based on that?
#
GWG
So, basically, ignore mf2_content and mf2_summary if post_content and post_summary are set.
#
snarfed
again, depends on your use case
#
snarfed
but for this, probably yes
#
GWG
And optionally parse post_content using PHP-MF2 if I ever decide to go to convert
#
snarfed
eh maybe but for that i'd probably use post meta
#
snarfed
unless you really know you really want mf2 that the micropub plugin generated, instead of source mf2
#
GWG
I want to get the design right.
#
GWG
Even if I don't implement all the ideas I have
#
snarfed
just get it good enough to start! then ship it and iterate
#
GWG
Which is what I'm doing
#
GWG
I just want to put in the 'bones'.
#
GWG
I spent 4 hours over the weekend refactoring code and setting up PHPCS tests for PHP compatibility and WordPress standards. It found a lot of things I missed.
#
GWG
It also means if I ever write unit tests, they'll work
#
GWG
Fixed the Travis CI files.
#
GWG
I may finally write some
#
snarfed
GWG++ for testing!!!
#
GWG
snarfed: I will dedicate the first test I actually write if I do it to you.
#
snarfed
❤️
[miklb] joined the channel
#
[miklb]
GWG post-kinds travis file is your most recent work on that?
#
GWG
[miklb]: Yes. I played with a lot of options before settling.
#
GWG
[miklb]: Why do you ask?
#
GWG
I had hundreds of minor fixes to go through
#
[miklb]
I have done a little in that area myself and would like to see what you came up with
#
GWG
[miklb]: Any suggestions are welcome?