littlelogs

Keep a social journal of your work progress as you make and learn things.

#javascript

May 2017

josh
josh

Deployed my #larder updates today, to support dragging of bookmarks into folders (plus nicer looking bookmarks). I didn’t use anything except the html5 drag and drop #javascript api, which is actually pretty simple — not really any need for a library to handle it! I’ll probably do the exact same thing for #changemap sometime soon to support moving tasks between lists.

April 2017

January 2017

rhitakorrr
rhitakorrr

Let’s see if I can get back to daily (or at least near daily) logging again. Today, I:

  • Closed two #GitHub issues for #MidnightMurderParty. Both were small aesthetic things related to the user resizing the book, but because of some race conditions that could occur between #Elm and #JavaScript (and did occur last time I tried this), I’d been putting the issues off for a while.
  • Got some #writing done on my current #shortstory—about 700 words on the manual typewriter, which I’m enjoying quite a bit so far.

Now, I’ll probably read for a little bit and maybe play some Osu! or Overwatch. Something that starts with an ‘O’ anyway.

September 2016

rhitakorrr
rhitakorrr

I’m terrified right now. I finally wrote the major part of the #midnightmurderparty enhancement, which involved refactoring huge portions of navigation logic. It was the kind of refactor where you really can’t compile and test until it’s basically done.

When I finally compiled it, the compiler found two mistaken type signatures, and then it worked. But surely it couldn’t be that easy, I thought. There will definitely be errors in the runtime since I didn’t change the #JavaScript to work with it yet.

Except there weren’t. As far as I can tell, everything still works fine immediately after this massive refactor. I know this is #Elm, but this is too smooth even still. There must be a sneaky logic error somewhere, but I haven’t found it yet.

It works, and that’s terrifying.

rhitakorrr
rhitakorrr

Tonight I made more progress on #midnightmurderparty. I’m working on a pretty big enhancement at the moment. In the #reader, there is a lot of collision detection regarding which headings are currently within the viewport of the book. The enhancement, instead of checking all headings against the viewport every page turn, just does so once–when it renders–and stores that data in a map from page number to list of elements.

The idea is to cut the slow DOM querying out of the process and to search through less elements each page turn, but there’s another benefit I just realized yesterday. If I pass this map of page num -> element list to #Elm after the render, the Elm side of the program can perform a lot more logic without having to continuously ask the #JavaScript side to check things for it. This will cut out a ton of complexity!

Aside from that, I spent most of the day with a friend. We went to a diner, made cookies, and watched a Twitch stream of Super Mario RPG.

August 2016

rhitakorrr
rhitakorrr

Did some more work on my #hakyll_portfolio_blog tonight. Initially intended to work on actually designing the site, but got caught up prettying up my routes so they would look like /posts/my-blog-post/ instead of /posts/2016-12-08-my-blog-post.html. Between learning a new library and figuring out how to do #regex in #Haskell, it was more challenging than expected. And that’s before I realized I was modifying external URLs as well as my own. Woops!

But all in all, I don’t really mind the extra time spent. It’s nice to be venturing into the world of #Haskell again… especially after the nightmare that was cross-browser #JavaScript (shudders).

rhitakorrr
rhitakorrr

Tonight turned out to be more of a cleanup night than a dev night.

Also made a repository to publicly track my #midnightmurderparty writing progress!

rhitakorrr
rhitakorrr

After pushing a little further with the #JavaScript config file for the #midnightmurderparty #frontend, I decided it would be better to store the config as a #yaml file and inject it during the build process. This led to a massive build script upgrade.

  • Config is now a #yaml file parsed in the build step instead of bundled #JavaScript used at runtime. This circumvents issues such as:
    • Needing to dynamically create script tags on the page based on config (which leads to all sorts of script loading order mayhem)
    • Needing to pass static data around in the #Elm model
  • Build system upgrade
    • Now injects values from config file directly into the source
    • Appends unique number to #JavaScript and #CSS sources to force bypassing the cache after a code update
    • Allows specifying --dev in terminal to run in dev mode, prod otherwise
      • Dev and prod mode both have their own values in the config file
      • If running in prod, the build script will remove console logs, debuggers, alerts, etc.
rhitakorrr
rhitakorrr

Tonight’s been pretty fun. Went out with some friends and didn’t get home until after midnight. Instead of going to bed like a reasonable person, I decided to implement another feature in the #midnightmurderparty #reader.

Honestly, the base feature was pretty easy to implement – just better repositioning of the user within the #reader when they resize the book and cause a text reflow – but, of course, I decided to get fancy and wanted to show the reader with a blinking paragraph approximately where they were before the text moved around. That added a ton of unexpected complexity which took me an extra two hours to get working in a way I liked.

I’d still like to test my book collision checking more; it seems to be acting a little wonky sometimes. Plus, I found a bug I thought I fixed a long time ago. Gotta look into that again too. Can’t wait to get out of #JavaScript land and back to the #Elm half of my code base. Things are nicer in there.

May 2016

josh
josh

Deployed the #larder folder changes today and spent hours ticking off all my support emails.

Helped a friend learning #javascript in the evening. I think it’s a terrible language to learn as your first, and triply hard in this case as she has to understand how it interacts with HTML and CSS. But we fixed her bugs in the end, and it was a good feeling to be able to help her learn 😊

josh
josh

Almost got #larder’s new folder management page completed tonight. Just need to iron out some issues where various separate #javascript libraries (drag and drop, custom dropdowns, etc) are interacting in unexpected ways. But it’s finally mostly functional, which is good, because I’m ready to move on and build some new stuff, like public folder feeds.

March 2016

January 2016

josh
josh

After sleeping on it I decided to give up on #elm for #larder. I do like it a lot, despite not yet being proficient in it, because it allows me to do some cool stuff in a very functional way (the alternative being icky javascript). However, the community just isn’t there yet (and may never be) and I’m not comfortable supporting it forever in a serious product. I might blog a bit about my experience with it sometime to explain the pros and cons I see.

For now, I made some really quick progress moving all my views back into #Django templates. My new approach will be progressive enhancement with minimal #javascript — just enough to avoid some page reloads and make core parts of the interface snappy.

josh
josh

Wrote off most of the day, but managed to make some progress tonight to make up for it. Got #mithril loading data from my #django #api for #larder! I can now view links within a folder and switch folders in the UI to trigger new requests. Mithril’s suggestions of how to write your architecture are a bit foreign to me (maybe exacerbated because it’s #javascript), so there’s a learning curve here and I feel a bit out of my depth. Happy to have made progress.

josh
josh

This afternoon I got a lot done on #larder and setting up its #api. I’ve got the lists of folders, tags and links being serialised out to json, which is just enough done to start building the #javascript client. I’ll probably keep building them together, adding a new endpoint (like creating a folder) and then making that work in the client too.

September 2015

August 2015

April 2015

March 2015

February 2015