A Weird Week

Well, that was a weird week, wasn’t it? In addition to the election, I was supposed to go back into the office last week, on Thursday. The plan was for normal employees to start coming back one day a week. But we had a couple of COVID cases at the office, plus with New Jersey’s increasing number of cases overall, that plan got altered, so now I can continue working from home for the foreseeable future. So that’s good, I guess. (I mean, it would better if we didn’t have any cases at the office, and if NJ overall was doing better, but given the circumstances, I’m glad the company adjusted the plan.)

The big news this week of course is Biden being declared the winner over Trump, finally, yesterday. A lot of people were very happy about that, judging by my Twitter and Facebook feeds, and also judging by some of the activity out on Main St yesterday. I’m glad, and relieved, but only just barely optimistic. (I could probably write at length about that, but I probably shouldn’t. Let’s just say that a lot can still go wrong, and that a lot needs to be done before we can get back to anything resembling normal.)

It was a beautiful day yesterday, which probably helped everyone’s mood. A lot of people were out on Main St., and there was a lot of music and noise on and off throughout the day. (The annoying guy who plays saxophone outside my apartment was back yesterday, and played until after 10 PM, so that kind of sucked, but I guess I can’t blame him for trying to make some money while the weather was nice and everyone was happy.)

My friend Paul stopped by yesterday, and we went out for dinner, eating outside at a Korean restaurant on Main St. That was the first time I’ve eaten at a restaurant since the pandemic began. It was pretty weird, but it felt really good to do it.

I also ordered a new Apple Watch this week, and picked it up at the Apple Store at the local mall yesterday. I’d been thinking about getting one, and finally talked myself into it. I bought a new Series 6, to replace my Series 3. I got the Series 3 a little less than two years ago, for Christmas in 2018. So I feel a little bad about replacing it when it’s less than two years old. But, still, I’ve skipped the 4 and 5, so it’s a big enough jump that I don’t feel too bad about it. I’ll probably post more about the Watch later, after I’ve had it on my wrist for long enough to form some opinions.

Overall, yesterday turned out to be a fairly hectic day, with much more time spent outside the apartment than usual, and a lot more human contact than usual. I’m hoping that doesn’t result in me getting another cold, or even worse. We’ll see. My plans for today are not terribly ambitious. It looks like it’ll be another nice day, so I will probably go for a walk after I’m done with this blog post. Then maybe I’ll just relax and do some reading, and maybe watch a movie.

Stuck In The Mud With SPFx

I’ve been trying to make some progress with SharePoint Framework (SPFx) lately, but I keep getting stuck in the mud, so to speak. I started working on learning SPFx some time ago, but I had to put it aside due to other projects. But now, I have a little spare time to get back to it.

I set aside a few hours one day last week to work on it. But since I last worked on it, I’ve moved most of my work to a new dev VM. So step one was moving all of my SPFx projects over to the new VM. That shouldn’t have been a big deal. But of course each SPFx project has a node_modules folder of about 725 MB, across more than 100,000 files. So just copying everything over wasn’t going to work. So step 0.1 (let’s say) would be to delete the node_modules folders. Since I had less than a dozen work projects, I thought I’d use brute force for that, and just click each node_modules folder in Explorer and hit the delete key on my keyboard. Of course I then realized that asking Windows Explorer to move 100,000+ files to the recycle bin is a bad idea. So I started looking into writing a script to do it.

I found something called npkill that looked like it would do the trick without me even having to write a script, but I couldn’t get it working in Windows. (It’s probably possible to get it working in Windows, but I hit a snag and decided not to spend too much time on it.)

So I was back to writing a script. I started putting something together in PowerShell, but then I found rimraf, which looked promising and (according to at least one blog post I read) would be faster than doing the equivalent recursive delete natively in PowerShell. So I wrote a PowerShell script using rimraf. I wound up with this simple one-liner:

gci -name | % { echo "cleaning $_\node_modules..."; rimraf $_\node_modules }

I’m not sure if rimraf was actually faster than just using a native PowerShell command, but it worked. So that got me down to a manageable set of files that I could zip up and move to the new VM. (There was actually some trouble with that too, but I won’t get into that.) And that pretty much killed the time I’d put aside to work on SPFx for day one. Sigh.

For day two, I wanted to get back to a simple project that would just call a web service and return the result. I’d previously stubbed out the project with the Yeoman generator on my old VM, so now I just had to do “npm install” to get the node_modules folder back. Long story short, I got some unexpected errors on that which led me down some rabbit holes, chasing after some missing dependencies. That got me messing around with using yarn instead of npm, which someone had recommended to me. That didn’t really help, but after a bunch of messing around, I think I figured out that the missing dependencies weren’t really a problem. So just messing around with npm and yarn, and getting the project into a git repo, killed the time I’d set aside on day two.

For day three, I actually went into the project and added a web service call, to a local service I wrote, but immediately hit an error with the SPFx HttpClient not liking the SSL certificate on that web service. So that got me trying to figure out if you can bypass SSL certificate checking in the JavaScript HttpClient the same way you can in the .NET HttpClient. I got nowhere with that, but it did set me down the path of looking into that SSL cert, and realizing that it’s due to expire in January, but I didn’t have a reminder to renew it in Outlook. Which got me going through all of my SSL certs and Outlook reminders and trying to make sure I had everything covered for anything that might expire soon. And that sent me down a couple of other administrative side-paths that used up all the time I’d set aside on day three.

So after three days, I basically just had a sample SPFx project that makes one simple web service call, which fails. Sigh. I picked it back up today, trying to fix the call. I got past the SSL issue. But that led me down a couple of more rabbit holes, mostly regarding CORS. So, good news: I now understand CORS a lot better than I did this morning. Bad news: I spent most of the morning on this and can’t really spend most of the afternoon on it.

At some point, I’ll get over all these initial speed bumps and actually start doing productive work with SPFx. Maybe.

The Morning After

I tried to be careful about how I was following election news last night. I watched the regular NJ Spotlight newscast at 5:30 PM, then some of their later election coverage, from about 9 to 9:30 PM. And I listened to a bit of WNYC, and checked Twitter a few times. I check Twitter only via Twitterrific, and I’m careful about who I follow, so my Twitter feed is relatively sane. So I managed to get a pretty good night’s sleep last night. (A little Yo-Yo Ma helped out too.)

This morning’s news is… pretty much what I expected. No conclusive winner in the presidential race. Cory Booker reelected to the Senate, and Tom Malinowski reelected to the House. The legal weed question passed, by a 2 to 1 margin. Overall, the Democrats will likely keep their House majority and probably won’t win a Senate majority.

The mainstream media (at least the sources I follow) seem to be dealing well with Trump’s FUD. The Washington Post has a headline that reads “Trump falsely asserts election fraud, claims a victory” and the NY Times has one that says “As America Awaits a Winner, Trump Falsely Claims He Prevailed.” So we’re getting that word “false” in there, at least.

I haven’t looked at Twitter or Facebook yet this morning, but I inevitably will at some point. I’m sure that a lot of people will have opinions about all this. Either way, I need to try to get through the rest of the work week without getting distracted by all this stuff too much. Hopefully, I can find some interesting work to occupy my mind.