avatar image - a green paisley swirl bits all the way down

More for the ClojureScript SVG Toolbox

Nundrum
January 5, 2024

》New Goals

The fool that I am decided to fork the startpage project from the previous post into two projects: one that’s static content suitable for sharing with the rest of the world, and one that’s more dynamic and relies on sources of data that are only available on my home network.

That meant really pinning down the features required for the simplified page before moving on to the fully-featured one.

The main features were limited by what could be served off of a local filesystem. That narrowed the options down to:

  • A calendar widget

  • Sets of page links

  • Configurable color

Continue reading →

Building A ClojureScript SVG Toolbox

Nundrum
December 30, 2023

》Laments and Goals

Why do I do this to myself? The idea, so easy. The implementation, such pain.

I wanted to build a custom startpage (aka "new tab page") in my usual cyberpunk style. There are dozens and dozens of startpages out there to choose from, many of which were very stylish. But none were the phosphor green-drenched (retro?) future-styled UI my heart desired.

Well, I’ve been on this ClojureScript journey, so why not continue it?

There were a few must-haves:

  • An "ambient calendar" showing a year progression

  • A per-Firefox-instance set of URLs

  • Current temperature and daily high/low forecast

  • Today’s allergen levels

  • Style that would make a movie studio jealous

  • No ongoing animation after the page loads

Then some stretch goals:

  • Weather radar

  • Disk usage of certain systems that I need to keep an eye on

  • Traffic conditions and alerts

  • Calendar entries

And two not-haves: a search bar and a clock. CTRL-k to search is a habit. And I friggin' hate clocks on my desktop. Long ago I learned they distract me.

Oh, this is going to be painful.

Continue reading →

Stumbling Through Interop

Nundrum
December 18, 2023

》Surely I can just cargo cult this

After making so much process building a progressive web app, I decided to take a detour into making some "simpler" pages, without re-frame. To pull in some EDN data to work with, I quickly needed to figure out how to use fetch. JavaScript interop looks like Java interop, right? Objects, members, methods. What works in one place should work in the other. Right?

》Enter promises and consternation

I started playing around just by seeing what fetch returns:

(js/fetch edn-url ) ; => #object[Promise [object Promise]]

Getting a promise object in return was not a surprise. Previous work taught me that JS uses async code and promises heavily. Which makes sense — any blocking of a page’s JS thread leads to a frozen page. Treating the promise like a magic bottlecap, I reach for the handy old tools realized? and deref:

(realized? (js/fetch edn-url )); => :repl/exception!
(deref (js/fetch edn-url )); => :repl/exception!

Oh, no! This isn’t the same at all.

Continue reading →

From Clojure to ClojureScript

Nundrum
December 7, 2023

》A Journey

How do you get from Clojure to ClojureScript? Though I have had much practice with Clojure and understand the ecosystem around it, understanding the environment of ClojureScript has remained elusive. Surely it is possible to use ClojureScript without having a deep understanding of JavaScript, just like most Clojure code can be written with minimal Java knowledge?

I had dabbled in some JavaScript before — enough to know that I would rather be writing ClojureScript if at all possible. But most of the advice given to me was along the lines of: "go learn JavaScript React and come back later." Almost as if the only people coming to ClojureScript were JavaScript developers!

Here is what I’ve learned as I struggled to put a web app together. I hope it helps other developers who might be coming from a similar background.

Continue reading →
« Prev

A blog by Nundrum

Links

  • @Nundrum on Mastodon
  • Archives
  • RSS
  • Clojurians Slack
  • Contacting Nundrum
  • P.E.P.R. Jacket Project

Recent Posts

  • The System Wayfinder
  • Fountainvoid
  • Introducing XScreenBane

Tags

  • re-frame
  • clojure
  • svg
  • async
  • interop
  • jna
  • cli
  • screensaver
  • platformio
  • font
  • utility
  • pepr jacket project
  • cyberpunk
  • clojurescript

Copyright © 2025 Nundrum

Powered by Cryogen