be careful of library versions and old code with deno

I have always been impressed with Deno ( https://deno.land ). It was designed and implemented as a secure server-side JavaScript and Typescript runtime by the same developer who create Node.js, Ryan Dahl ( https://en.wikipedia.org/wiki/Ryan_Dahl ). I’ve always been impressed by Deno because Deno is written in Rust.

Unfortunately that doesn’t mean I’ve been using Deno. After my initial infatuation with Deno I left my work with Deno to rest idle. I had lots of grand ideas, but right now I’ve not got much to show for it except a bunch of small to medium sized incomplete (and I’m being charitable by calling them incomplete) projects. Because I’m building a head of steam around Micro Python and Circuit Python embedded work, I thought I’d create a local HTTPS server to handle all of them. A tiny cloud, if you will.

So I dusted off one of the promising incomplete projects and began to work with it again. That’s when I ran into errors all over the place with code that did work when I stopped. As usual I whittled one of the problems down to a few lines of example code that would produce one of the errors. Here’s what it looks like.

import { serve } from "https://deno.land/std/http/server.ts";
const server = serve({ port : 8000 });
for await (const server_request of server) {
    server_request.respond({ body: "Deno server instance created\n" });
}

Running it produces the following:

opos@fedora:~/Develop/DenoWork$ deno run --allow-net my-server-bad.js 
Listening on http://localhost:8000/
error: Uncaught TypeError: server is not async iterable
for await (const server_request of server) {
                                   ^
    at file:///home/popos/Develop/DenoWork/my-server-bad.js:3:36

So code that once worked no longer does. Line 3 in the source is the culprit. So I go googling and rapidly find the solution on Stack Overflow ( https://stackoverflow.com/questions/70963882/deno-serve-imported-from-std-http-server-ts-is-not-async-iterable ). Sure enough, when I follow the advice in that post and make one change, it works like it did when I put it aside.

import { serve } from "https://deno.land/std@0.106.0/http/server.ts";
const server = serve({ port : 8000 });
for await (const server_request of server) {
    server_request.respond({ body: "Deno server instance created\n" });
}

The correction was to add the “@0.106.0” version to the import statement in line 1. Just lovely. So, do I go through my code and start locking down versions on everything? Or do I do the right thing and learn the new way of doing things? I’m retired and things like this are my hobby, not a paying job. There’s a part of me that wants to be lazy and just lock everything down and live with that. But there’s the other part that is yelling about being a lazy bum and a hypocrite for wanting the easy way out. I think what I’ll do is sit back for a bit and rethink how I want all of this to be. Maybe if I learn the New Ways, then I should rewrite from the ground up. And this time don’t let it go for over a year.

they paved paradise and put up a fake cellular tree tower

That big fake artificial Christmas tree

My wife and I drove to Jacksonville on Sunday to check on family. On the way up we saw this huge structure near the Costco on west 295. On the way back down that same section of expressway we stopped to fill up with gas at that same Costco. As I drove out to finally head back to Orlando I stopped briefly and grabbed a few “snaps” of this structure. It is indeed a cellular tower, decked out with some of the biggest artificial Christmas tree limbs I’ve ever seen. Somebody must have thought that was a good idea. I don’t know why as the area around the tower is expressway and businesses, in this instance an emergency care center. I guess somebody thought an unadorned cellular tower would upset the critically ill patients coming into the emergency care center.

I mean, it looks like they ran out of money for fake tree limbs and stopped about a third of the way down from the top.

Closeup of the top showing the individual cellular antennas, and all those fake tree limbs