4th of June, 2026
Hello folks đź‘‹
I’ve been on “long weekends” recently but kept working on a few things that might interest you, so here’s my recap:
- what started as a JSONRegistry proposal shifted into a StructuredCloneRegistry and, while there are reasonable caveats or gotchas to discuss, I feel like all problems can be tackled in one way or another. The TL;DR around this topic is that we, PyScript, but also we, Web Developers, need non-standard 3rd party libraries to allow more types to travel across workers or realms. That conversation is about finding the best way to standardize on an API that helps all of us in the (hopefully) near future, with polyfills potentially landing if anyone from standards bodies or browser vendors chimes in as interested.
- because I’m trying to propose a new primitive/standard, I went ahead and created at least the most basic bricks to play around with it. The most important one is @webreflection/utils/registry, which is a basic utility to validate expected keys and values out of a regular Map. As with all other utilities, that one is minimal in size, best in performance and usable both as a whole package or stand-alone via CDN.
- @webreflection/signals is a minimalistic implementation of Preact Signals and it’s just as fast, but it fits into 0.5K. Most importantly, there is a Python port that I will eventually bring into PyScript or any library that would like to add reactivity in a signals-like fashion. That port works on MicroPython, Pyodide and C-Python, but it hasn’t been published yet and I still haven’t created a
config.tomlto allow playing around with it in PyScript … soon though !!! - json-storage is another utils of mine and it’s the easiest way to store JSON-compatible data to and from
localStorageorsessionStorage. Differently from other libraries, this one is by all means a Map and it exposes all Map methods, including the latestgetOrInsertandgetOrInsertComputedones. Everything else, including iterating over all keys/values, is borrowed exactly from the Map API. This utility will soon be used in PyScript too.
PyEditor related
Some extra work done on PyEditor:
- it’s not published yet, we need to be sure it can do all the use cases we want it to handle
- things are getting very customizable but work on better documentation around it is not there yet, however it’s now possible to:
- define a max height for the area
- define custom buttons (Start/Stop) UI
- when a max-height is defined there is at least a 3-rows min-height too, simply to leave space for the inner buttons so these are always reachable
- updated CSS to avoid the output container overflowing its parent …
white-space: pre-wrapis now the default for the output so that code and text should be visualized nicely. It’s true that this might break some ASCII-like layout, but remember you can always override styles on your own; here we just want sane defaults to work for most desired use cases (show content, transformed Markdown, layouts as HTML and so on).
Unrelated fun fact
There is still 3rd party analytics software that uses a 1 pixel GIF strategy to land requests, in a world where everyone else moved to the fetch API, which is more powerful and reliable.
… and what’s the issue in there?
Well, fetch is more aware of its context and surroundings, while img.src = '...' easily breaks on websites where crossOriginIsolation is true (COI, COOP, COEP, CORP).
The bummer with this image-based approach is that most analytics projects are not really reachable with ease, so patching those broken expectations on their end (so they know whether an Image can load or not at all) becomes inevitable.
Luckily enough, anyone can patch globals in JS (the best part and the most cursed one), so I’ve played around with the idea that an Image src accessor can be overridden: if crossOriginIsolation is true you can override that accessor to attach img.crossOrigin = 'anonymous' when the target URL is one of those “from the 90s”.
I am not sharing code because I don’t want to push anyone to override Image out there, yet it’s been an interesting discovery that in 2026 old “hacks” are still used in production, sold as “best practice”, yet they all fail at the safety level the moment their scripts land on any page after any other possible synchronous global pollution.
I guess my good ol’ days as a Web hacker keep coming up and help me fix, or work around, bad practices sold as “that’s what experts do”.
And that’s all folks, see you soon around 👋