Skip to content

Commit

Permalink
9.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaGuarini committed Jul 30, 2023
1 parent 581715a commit 42358cf
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "riot",
"version": "9.0.1",
"version": "9.0.2",
"description": "Simple and elegant component-based UI library",
"license": "MIT",
"engines": {
Expand Down
12 changes: 8 additions & 4 deletions riot+compiler.js
@@ -1,4 +1,4 @@
/* Riot v9.0.1, @license MIT */
/* Riot v9.0.2, @license MIT */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
Expand Down Expand Up @@ -24630,9 +24630,13 @@
/**
* Check whether the attribute should be removed
* @param {*} value - expression value
* @param {boolean} isBoolean - flag to handle boolean attributes
* @returns {boolean} boolean - true if the attribute can be removed}
*/
function shouldRemoveAttribute(value) {
function shouldRemoveAttribute(value, isBoolean) {
// boolean attributes should be removed if the value is falsy
if (isBoolean) return !value && value !== 0
// otherwise we can try to render it
return typeof value === 'undefined' || value === null
}

Expand Down Expand Up @@ -24675,7 +24679,7 @@
node[name] = value;
}

if (shouldRemoveAttribute(value)) {
if (shouldRemoveAttribute(value, isBoolean$1)) {
node.removeAttribute(name);
} else if (canRenderAttribute(value)) {
node.setAttribute(name, normalizeValue(name, value, isBoolean$1));
Expand Down Expand Up @@ -26136,7 +26140,7 @@
const withTypes = (component) => component;

/** @type {string} current riot version */
const version = 'v9.0.1';
const version = 'v9.0.2';

// expose some internal stuff that might be used from external tools
const __ = {
Expand Down
2 changes: 1 addition & 1 deletion riot+compiler.min.js

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions riot.js
@@ -1,4 +1,4 @@
/* Riot v9.0.1, @license MIT */
/* Riot v9.0.2, @license MIT */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
Expand Down Expand Up @@ -885,9 +885,13 @@
/**
* Check whether the attribute should be removed
* @param {*} value - expression value
* @param {boolean} isBoolean - flag to handle boolean attributes
* @returns {boolean} boolean - true if the attribute can be removed}
*/
function shouldRemoveAttribute(value) {
function shouldRemoveAttribute(value, isBoolean) {
// boolean attributes should be removed if the value is falsy
if (isBoolean) return !value && value !== 0
// otherwise we can try to render it
return typeof value === 'undefined' || value === null
}

Expand Down Expand Up @@ -930,7 +934,7 @@
node[name] = value;
}

if (shouldRemoveAttribute(value)) {
if (shouldRemoveAttribute(value, isBoolean$1)) {
node.removeAttribute(name);
} else if (canRenderAttribute(value)) {
node.setAttribute(name, normalizeValue(name, value, isBoolean$1));
Expand Down Expand Up @@ -2458,7 +2462,7 @@
const withTypes = (component) => component;

/** @type {string} current riot version */
const version = 'v9.0.1';
const version = 'v9.0.2';

// expose some internal stuff that might be used from external tools
const __ = {
Expand Down
2 changes: 1 addition & 1 deletion riot.min.js

Large diffs are not rendered by default.

0 comments on commit 42358cf

Please sign in to comment.