Skip to content

Releases: snojs/sno

Snocrystal v4.2

05 Jan 23:28
de171e3
Compare
Choose a tag to compare

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

01 Jan 04:26
fe902f4
Compare
Choose a tag to compare

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)

04 Dec 13:52
25794b1
Compare
Choose a tag to compare

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)

02 Dec 00:34
31983d8
Compare
Choose a tag to compare

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()