Taeluf Devlog, Feb 19, 2021

11:19 am I'm starting late because I couldn't get to sleep last night, but I did work on Phad a little bit at 2am. I skipped devlog yesterday. I had therapy @ 2pm, so I just stayed super focused on code, with the limited time available.

Cats should not wear pajamas

A cat in pajamas, looking a little grumpy Source page for cat in pajamas

Goals today

  • 1-2 hours work on Phad (name will likely change), an html-powered view/router/orm app for Liaison, to build database-connected views in pure html (php controllers available)
  • no more than 90 minutes work on Code Scrawl
  • 3-4 hours work on Liaison documentation (UGHUGHUGHUGHUGHUGH)

Issues today

  • I'm tired
  • Liaison documentation relies upon a feature in Code Scrawl that is incomplete.
  • Code Scrawl has autoloading issues when using the PHPApiScraper extension (that I need for LIaison)
  • Many decisions are not yet made with Phad, so I'm prototyping & figuring those things out
  • I only code til about 6pm & its already almost 11:30am

Start the devlog files & write my goals.

Phad development

  • separate a big file of pseudo-code into multiple purpoose-specific files.
  • Took a 45 min breakfast break. Feeling VERY uninspired/unmotivated, and foggy.
  • Good 90 minutes or so on Phad. Deleted a lot of old files / code / notes & organized my ideas in the form of psuedo-code.

Here is a REALLY simple example:

<section item="Blog" table="blog_posts" where="Blog.id = :id" url="/blog/{id}/">
    <h1 prop="title"></h1>
    <!-- commonmark would be the namespace... I think?-->
    <div prop="description" filter="commonmark:toHtml"></div>
</section>

But there's also <x-access> tags that further define how the item can be accessed. This would go INSIDE <section item="Blog"></section>

<x-access name="view" role="human" method="GET" 
            url="/blog/{category}/{slug}/" 
            where="Blog.category LIKE :category AND Blog.slug LIKE :slug"
            sitemap="SELECT category, slug FROM blog_posts AS Blog"
></x-access>

And you can define a node to automatically call upon an Api (view/form, etc). Something like:

<button 
    api="namespace:Blog.Form:edit" 
    api-on="click, touch"
    api-style="dialog | page"
    role="creator | admin"
>Edit Blog Post</div>
<!-- style="page" means it would act as a link. style="dialog" would open a modal -->
<!-- role="creator | admin" <- a lot of undecided things in this line

Clicking or touching the node here would allow you to edit the blog post. This button would be right in the blogpost view. You could:

<form item="Blog" table="blog_posts" access="BlogEdit">...</form>

and your controller's methods accessBlogEditQuery and accessBlogEditRow would be invoked, instead of using the more automatic role="..." based access

Also, you can:

  • Use a custom query builder
  • Use a custom user object
  • Basically override whatever methods you want and completely redo any of the hard work I've done lol

In conclusion

There's a lot more to it, too. So... Yeah, it'll be exciting when its done! There's still a few decision yet-to-make. I haven't written any of the internals. Though, I have made (a version of) this library before. It was just REALLY bad the first time. Like. Just the most awful thing. I could never figure out how it worked & I was the one who wrote it lol.

What's next?

Just had a pretty good sprint. I'm tired. I'm unmotivated. My lower back feels not great. Seems like a time for a walk. Hopefully I get back to it pretty quickly afterward. If not, that's ok. Pushing myself too hard leads to burnout & flare up of depression / anxiety (or whatever's wrong with me lol)

Probably Liaison docs afterward. I am SO not thrilled. They're VERY needed, but its just so boring.

Walk was good. Helped my neighbor get her van unstuck from my driveway (as she was trying to pull into hers). Maybe pulled a muscle :O

Coffee... Code.

Added the cat image to this devlog. Set an img {max-width:100%;} to prevent overflow. Hecked around with my system-wide autoloader for a bit. Yesterday, I was moving some files around, reorganizing, so I had things to fix.

Uhh. Goofed off. Checked github & twitter & StackoverFlow & looked at programming language called Nim, an open-source product-management self-hosted software called logchimp. Couple other little things.

Liaison Docs

Begin the ugh. I don't like to smoke cannabis during the day, but I might for this. Lets see how bored I am.

  • Delete some old branches (& create archive/branch_name tags)
  • Clean up & review DocComments in Liaison, Package, & Compo & take notes
  • More distraction (twitter, mostly). Lil bit a weed. Let's go
  • Documented quite a few classes
  • Took some really good notes for later
  • Wrote some important TODOs for later

Conclusion

I'm done! Push this devlog, tweet it, then bath time. Then yummy (vegan) frozen pizza time.

I met 2 of my goals! I slacked off a bit, but ended up getting a good amount done in both Phad & Liaison's docs. I made good notes for Code Scrawl. So even though I didn't get to Code Scrawl today, I feel like it was a successful day! Especially if you count the 2 hours I worked on Phad from 2am-4am.

Minor additions done. Uploading. Tweeting (with a screenshot). Then on with my life!

Stuff I thought of throughout the day

  • Cats should NOT wear pajamas (but i bet its so cute!) (its not that cute. I looked up photos. They look VERY unhappy)
  • My system-wide autoloader is... awful. As is my ~/.bashrc. Some of the pieces are just... scattered thoughout. It could all just be structured a little better.
  • Having my libraries point to my system-wide autoloader is yucky. I want the feature in my libs, since I use it, but I don't like how its setup.
  • I really wanna delete all the tags on Liaison... but... I wanna wait til all my sites are converted to the new Liaison
  • bent switch
    • Git Bent really needs some filtering? bent switch branch lists tags as well as branches. Idk if it even works. Probably? But i just want it to switch branch.
    • Adding a checkout command to Git Bent would be cool. It might just be a switch alias.
    • switch could allow other things: branch, tag, commit hash, host(like to point at production instead of origin) or host to change the url that origin(or another) uses.
      • bent checkout would not have switch host, I don't think. Idk
  • Liaison could add a trait that lets any object act as the liaison object. $compo->view() would be the same as $compo->lia->view()
  • Each package could use its own custom instance of Liaison, so internal method mappings can be relied upon, instead of calling api(blah blah)
    • This is a neat idea, but I think it would add a lot of overhead &... really just make the architecture more complex & confusing.
  • Code Scrawl
    • Code Scrawl should output automatic @tag files that list every single thing that uses @tag(whatever_tag), as a sort of automatic API reference
    • What if Code Scrawl could auto-test code written inside triple backtick codeblocks found in markdown? And if there were a way to hide certain code from the MD output...
    • What if Code Scrawl would just execute inline PHP?
  • I really need twitter cards on my site.