I'm Matt - You're here for my blog!

Month: October 2022

Exploring Denoland – Home of the Deno JavaScript Runtime

With some of my newly found ‘free time’ while Funemployed, I really wanted to start playing around with some of the newer projects that I’ve simply not had the time or energy for.

At the top of this list has been Deno, the new-ish JavaScript, TypeScript and WebAssembly runtime based on V8, co-created by Ryan Dahl (Node.js creator).

Why Deno? Well, for starters I love new and shiny things. But also, I have a special place in my heart for JavaScript runtimes – having been an early adopter of Node.js, at a time when serverside JavaScript was a controversial topic in the dev world (Thanks, Whiteboard IT! It’s because of my time with this company that I was exposed to a lot of really cool things, including Node.js and CouchDB/NoSQL). “How early?”, one might ask… Early enough that I’m listed as contributor #306 in the Node.js AUTHORS file – as a result of contributing a slash to the first official Windows installer.

I began my journey with Deno as I normally do – essentially iterating on some basic Hello World types of projects to get familiar with the dev flow, tooling and capabilities. Pretty quickly, I encountered something in my codebase that confused me – a warning notifying me that the deno window typings didn’t have everything supported by window exposed. Surprisingly, it wasn’t just me randomly plugging in code that landed me here – it was in following along with the Deno lifecycle docs that brought me to this error.

“Element implicitly has an ‘any’ type because type ‘typeof globalThis’ has no index signature.deno-ts(7017)”

At this point in my journey, not only was I getting the warning in VSCode, but I was also unable to get beforeunload or onbeforeunload to fire… Hmm… So off to Google I go – which lead me to this thread discussing a related matter.

In digging a bit deeper, I came to realize that beforeunload/onbeforeunload weren’t firing due to my Deno version – with support for these not being added to window in Deno until v1.24.0 (and me currently running v1.23.0). “Alright”, I thought – “I just need to upgrade and this will all be solved.”

Sure enough, once on 1.24.0 I was able to play with beforeunload/onbeforeunload – but the “Element implicitly has an ‘any’ type because type ‘typeof globalThis’ has no index signature.deno-ts(7017)” warning remained…

Having wished I had more time to contribute to open source over the last several years, I saw this as an opportunity to make my wish a reality – and so I did what any developer would do, created a fork and started to work on a new branch in the hopes I could become a Deno contributor!

As most experienced devs know, stepping into a large and complex codebase isn’t always the easiest thing to do – especially if you’ve never worked with some of the core tooling. With this being my first real exposure to Rust, I was completely unfamiliar with Cargo and how to go about building and testing my changes in an efficient manner… Fortunately, after a handful of web searches, I learned the basics of working in Rust and with Cargo, how to run specific tests by name, and I was off to the races to become a real life Deno contributor.

My commit is simple enough – really just a few lines to add beforeunload and onbeforeunload to the type definition for Deno window, and some updated integration tests to ensure everything is working as expected – you can see the pull request / merge here. While a small contribution by pretty much all standards of measurement, it felt good to see an issue, fix the issue and contribute that fix back to the community – and I hope to be doing more of this in the near future.

So, what’s next? Well, I guess I can actually begin with what I set out to do – learn Deno (rather than Deno’s codebase) and start playing with Fresh! 😁

Happy Coding!
-Matt

Site Migration Update

Good day, fine reader.

Just a quick post – if for not other reason than I’ve not made a post in a while. As you may know if you follow me on social media elsewhere, I was laid off from my job of ~12yrs middle of September – so, as of today, I’ve been FUNemployed 25 days (It’s okay. I was offered the option to relocate, but that unfortunately was not really possible as my wife and I are somewhat rooted where we are at). One random observation about being unemployed – non-work time passes by twice as quickly as work time.

Anywhos… One of my goals for my newly found free time was to move all of my personal sites to a new VPS instance since I’d been on the previous underpowered instance for about 6 years. I’m happy to say that I was able to get the new server set up, and all sites+content migrated with next to no downtime (aside from intentional reboots for OS/package updates). If you see something not quite right, please reach out and let me know – but in my testing and spot checking, nothing significant is standing out.

So, aside from a new server setup, what’s to come? I can’t really say. I plan on spending some of my free time picking up some new skills (Nunchaku?), so tune back in from time to time to see what I’m doing on that front if you’re interested.

I am currently seeking a new gig, though not particularly aggressively – so if you know of something that would be a good fit for an experienced full stack developer with a wealth of Angular experience, please don’t hesitate to reach out to me. In the meantime, I’m going to do a bit of learning, experimenting, playing and honey-dos 🙂

Take care!
-Matt

© 2024 blog.immatt

Theme by Anders NorenUp ↑