XaiJu
Tom Chapman
Tom Chapman

patreon


Green Witch

I have a real clunker of a thought that I often struggle to express with finesse. Braytech used to be 3 pages–checklists and some triumph titles. It was easy for me to envision, in my mind, its value and the effort I had so far invested into it. I'm a "do everything in my head" kind of guy (as opposed to writing things down and using other physical aids) and I often run into a metaphorical RAM limit. This has led to the use of paper and pencil for understanding Braytech, especially when building something new.

Like most people, I'm emotionally crippled and often wonder if I'm enough, so I look to Braytech and try to assess its value as a function of my own value (this is, to a degree, exaggerated for the sake of humour). This has grown to be a problematic practice because Braytech is now (and has been for a long time) far more than 3 pages.

What I've realised is that while some of Braytech's features are not unique to Braytech, they're refined, and that's the point of this section: some of Braytech's recent updates are about the polish that distinguish Braytech from others.

This Month's Polish

Compatibility

Braytech has had eras. I won't try to name them, I'm not that creative, and certainly not when the room I'm sitting in is 30° (86 in freedom units) at 80% humidity.

I'd say this is its last ultimate era in that it fails gracefully and fallbacks where it can. Once upon a time, if Braytech has an Indexed DB issue, it'd explode. Instead, it expresses its discomfort and allows you to continue on. This is good!

It's been a long time coming, but I've massaged the relevant code and Firefox finally works with Braytech.

Indexed DB is a bit of a mess and Firefox, in all its wisdom, has a habit of implementing limits arbitrarily rather than in step with WebKit and Chromium. This means I can build for most people reliably and in accordance with the standards and developer-friendly documentation of the MDN (Mozilla Developer Network) but still find Firefox behaving as if it's Internet Explorer 6 (Firefox users in my comments section would be carving their mechanical keyboard keys right now).

To make developing products with Indexed DB (and other web features) easier, developers build libraries. I use Dexie.js–it's very popular.

After some exploration, I found that Firefox specially doesn't like Collection.toArrary(). Why? It doesn't say. That's part of the fun of Indexed DB. It doesn't throw many useful errors (and this is part of why Dexie.js exists–to try and make the developer experience more consistent and tolerable).

In any case, I needed to iterate over the collection, the table stored in Indexed DB, altering the structure and assigning its parts to another place.

So, I altered my approach and tried Collection.each(). This worked. Firefox only makes up 10% of users, but they're passionate and informed, and I'm sure that they'll appreciate that Braytech no longer wants to download the definitions data every time you launch the app anymore.

This is the developer experience sometimes. Sometimes, you get a useful error which can inform you of how to resolve the issue, while at other times, you get nothing. Your only fallback is to try a different approach to achieve the same effect (and that's if it tells you where in the code it had a problem).

In a similar vein, I noticed low-memory Android devices, regardless of browser have started to fail to store the definitions data.

I was using Table.bulkPut() to store all data at once as few operations is more efficient and therefore faster (less app load time). Using the singular Table.put() in a loop resolved this. It's a measurable change in speed but most people won't notice.

These fixes are really satisfying!

Bluesky

Braytech has joined Bluesky, because like, everyone is doing it. I really wanted Threads to happen...

Final Notes

Critically, some final notes: join the Discord server and scream you desires for Braytech (into the appropriate channels) and subscribe! I'm only asking you to subscribe, you don't need to click the bell or like, just subscribe!

Tom 🎃

 


More Creators