This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 14-21 August 2023 | |
// A signal method attached to nodes and text. | |
// Continuation of the debate in the "dom" tests at the end of the signal.js | |
// gist, at https://gist.github.com/dfkaye/fe7b210c62b82faf4bffd5092dd41653. | |
// If a signal change updates a node property, it turns out there are several | |
// co-dependencies to manage - meaning, we have to update other content | |
// properties manually. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 4 August 2023 | |
// control.target.js | |
// Control is a constructor with an EventTarget field that manages events and | |
// listeners of different types (so we don't have to). | |
// Compare with control.signal.js at https://gist.github.com/dfkaye/8701a2d416556aab68da7519b2c5429a | |
// Prototype adds decorator API for adding, removing, and dispatching events. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 4 August 2023 | |
// control.signal.js | |
// Control is a constructor with a 'signal' Map containing different 'types' of | |
// event callbacks. | |
// Similar to EventTarget, but that's coming in the next post at | |
// https://gist.github.com/dfkaye/f773b85fabf661108ed4ff7a2cdfc61d | |
// Prototype adds decorator API for adding, removing, and dispatching events. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 3 August 2023 | |
// Yes, EventTarget is available in Worker contexts, | |
// although not yet convinced that we need them there. | |
// Incidentally, in 2023, Google (and probably Microsoft) has | |
// decided to make Chrome The Most Hostile Environment for web | |
// development, particularly in the console both in regular and | |
// private/incognito windows with unpublicized Content Security | |
// Policy headers for "trusted HTML", "trusted src", etc. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 2 August 2023 | |
// set.toJSON | |
// when you absolutely must serialize a set | |
// using JSON.stringify() which normally | |
// returns set: {} | |
Set.prototype.toJSON = function toJSON() { | |
var set = {}; | |
for (var [k, v] of this.entries()) { | |
set[k] = v; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1 August 2023 | |
// map.toJSON | |
// when you absolutely must serialize a map | |
// using JSON.stringify() which normally | |
// returns map: {} | |
Map.prototype.toJSON = function toJSON() { | |
var map = {}; | |
for (var [k, v] of this.entries()) { | |
map[k] = v; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 22 July 2023 | |
// one line tweet | |
// https://twitter.com/dfkaye/status/1682924372775038979 | |
// response to @johanvinet | |
// "PROGRAMMERS you can only use one line of code to convince people to follow | |
// you" | |
// Of course no new followers... | |
console.log( | |
`%c${$('body').innerHTML = await (async v => v)( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 21 July 2023 | |
// A signal implementation as a "reactive-observable" value with listeners and | |
// dispatch-notify behavior. | |
// This is not equivalent to the ReactJS hooks pattern or SolidJS signals. | |
// We're looking for a way to make nested data reactive so we notify changes by | |
// paths in the structure... the usual pipedream... | |
//////////////////////////////////////////////////////////////////////////////// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 20 July 2023 | |
// In progress... may delete and start over... may just blog about the | |
// philosophical confusion that Signals have generated in the web | |
// development world, something easily sewn... | |
// Signal, an implementation that accepts a name for itself, | |
// and an optional `assign` method for binding the signal to | |
// a parent object (a feature which has little to do with the | |
// nature of Signals...) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 19 June 20 | |
// Terri passed away | |
// I got this to work | |
// XSLT in the browser | |
// 12 July 2023 | |
// replaced DOMParser and "trusted" policy with async xhr parser | |
// see https://gist.github.com/dfkaye/a83f89d7496bb669570a1de207b5b8d4 | |
// 13-14 July 2023 |