Finding beautiful 🧬 capabilities hidden in plain sight is thrilling 🚀 Realizing they've existed for decades is humbling 🙇🏾♂️ Sharing them is enlightening 🤲🏾
This is the story of ⚛️ ion: invoked object notation, one such capability's journey through time.
One to discover, another to embrace.
1997
{✨:javascript}'s first language-specification is published 👏🏾
2007
Michael Lee is 🙇🏾♂️inspired🤲🏾 to share a capability within JavaScript he discovers & names jsonXD: json cross-domain 👨🏾💻
2017
Michael names & shares jsonXD's core concept & capabilities, ion: invoked object notation, and ionify: ion implemented for you 🎉
In 2003, Michael created ajile ♻️ asynchronous javascript importing & loading extension; a java-like module system for the web that enabled fetching javascript across different domains 🤓
Namespace ('my.space')
Import ('needed.Thing')
ImportAs ('useful.Thing', 'Thing2')
my.space.Module
= function Module ()
{ var thing1 = new Thing ()
, thing2 = new Thing2() /*
| my module's remaining code goes here */
}
By 2007, JSON: javascript object notation, a javascript-compatible data-interchange alternative to XML, was rising in popularity. Michael recognized this, and was 🙇🏾♂️inspired🤲🏾 to enable cross-domain JSON acquisition & interaction via ajile 👨🏾💻
Unfortunately, ajile-fetched JSON was programmatically inaccessible, and its object-literal form generated syntax errors 😓
Load ('http://remo.te/data.json')
// JSON response
{ "remote" : "request"
, "responds" : "with this"
, "inaccessible" : "JSON which"
, "generates" : "a Syntax Error"
, "when loaded" : "as JavaScript"
}
At the time, cross-domain acquisition wasn’t possible via the popular but
same-origin-policy-limited
XMLHttpRequest
resource-fetching web API 😔
JSONP offered an alternative, but
required wrapping JSON in a function
call, or padding it with a variable or
property assignment:
Load ('http://remo.te/data.jsonp?callback=on')
// JSONP response: function-wrapped
on ({ "remote" : "request"
, "responds" : "with this"
, "evaluated" : "JSON"
, "passed as a" : "JavaScript Object"
, "to a possibly" : "invalid on() function"
})
Load ('http://remo.te/data.jsonp')
// JSONP response: variable-assignment-padded
var jsonp
= { "remote" : "request"
, "responds" : "with this"
, "evaluated" : "JSON"
, "passed as a" : "JavaScript Object"
, "stored as a" : "server-defined variable"
}
This was close, but still invalid JSON syntax 🤔
Success came in 2007, when through diligent 👨🏾🏫 study of the JavaScript Language Specification, and object-literal syntax 👨🏾🔬 experimentation, Michael 👨🏾💻 discovered it was possible to interact with anonymous objects, like JSON, by invoking & observing numeric object-type conversion! 👌🏾
Object.prototype.valueOf // 1: observe
= function onObject ()
{ this.json == "data" // 3: interact
}
~ {"json":"data"} // 2: invoke & notify
~ ({"json":"data"}) // 2: invoke & notify via jsonp
A single-character prefix of ~
, +
, or -
was key 🎉 and as close to observable &
syntactically-correct JSON as we could get 👏🏾
This capability
- obsoletes JSONP,
- complements existing JSONP implementations with
~
and-
as compatible, dependable & unobtrusive callbacks, - introduces a universe of applications beyond cross-domain JSON acquisition & interaction,
- and exists within all JavaScript environments 🤓
After an additional two years of experimentation & implementation, Michael 🙋🏾♂️ publicly introduced this capability, at the 2009 Ajax Experience web developer conference, as a cross-domain JSON-fetching solution he named jsonXD: json cross-domain.
Over the next decade he continued to develop, explore, explain, present, extend & name
- 💎 jems: json-expressed modules,
- ⚛️ ion: invoked object notation,
- 🧬 ionify: ion implemented for you,
- 🎁 ionified: ions indexed for internet-enabled discovery,
- 📖 stories: stated text of recognition expressions &
- 📝 captions: code-as-prose terminology ions,
in 2015, 2016, 2017 @ /dev/color/ in motion, and 2020 @ devopsdays medellín 👨🏾💻
Today 💎 jems, ⚛︎ ion, 🧬 ionify, 🎁 ionified, 📖 stories & 📝 captions are jsonXD's progeny & the foundation of the many kinds of ions now available for implementation, discovery, extension, and study.
🙇🏾♂️ through * יהוה * impossible -is- nothing || 🇬🇾👨🏾💻🇺🇸 mike lee & team 🤲🏾