Releases: snojs/sno
Releases · snojs/sno
Snocrystal v4.2
Building the web your way.
This update syncs with older versions.*
v4.2 introduces a new way of script tag variable manipulation, however the original method continues to function.
<div data="{count:0}">
<!-- Show count variable and call ad function onclick -->
<p react>{{count}}</p>
<button onclick="add()">+</button>
<script>
// Sno now automatically re-renders the reactive variables when they are modified with data.varName
function add(){
data.count++;
}
</script>
</div>
Snocrystal v4.1
Building the web your way.
This update syncs with older versions.
Reactive elements can now contain multiple elements.
<div data="{count:0}">
<button onclick="$('count++')" react>
Count = {{count}}, Doubled = {{count*2}}
</button>
</div>
This code would only render the second variable in version 4.
Sno has been modified to use regex to swap out any amount of curly braces.
Snocrystal (v4)
Building the web your way.
~ This update contains breaking changes ~
Variables within the data tag no longer require the name as a string.
exc attribute changed to eval (same function)
Old code
<div data='{"pi":""}'>
<p exc="pi=Math.PI"></p>
<p react>{{pi}}</p>
</div>
New code
<div data='{pi:Math.PI}'>
<p react>{{pi}}</p>
</div>
Snoflake (v3.1)
Minor bug fixing update
Changelog
inside $()
function code
// Now replaces all instances of variables
update = update.replaceAll(Object.keys(data)[i],`data.${Object.keys(data)[i]}`);
replace()
=> replaceAll()