Skip to content

Commit

Permalink
6.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaGuarini committed Jan 24, 2022
1 parent cad057f commit ca53665
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 185 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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "riot",
"version": "6.1.1",
"version": "6.1.2",
"description": "Simple and elegant component-based UI library",
"homepage": "http://riot.js.org/",
"repository": "riot/riot",
Expand Down
63 changes: 4 additions & 59 deletions riot+compiler.js

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

6 changes: 3 additions & 3 deletions riot+compiler.min.js

Large diffs are not rendered by default.

63 changes: 4 additions & 59 deletions riot.esm.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Riot v6.1.1, @license MIT */
/* Riot v6.1.2, @license MIT */
/**
* Convert a string from camel case to dash-case
* @param {string} string - probably a component tag name
Expand Down Expand Up @@ -257,46 +257,6 @@ function defineDefaults(source, defaults) {
return source;
}

/**
* Get the current <template> fragment children located in between the head and tail comments
* @param {Comment} head - head comment node
* @param {Comment} tail - tail comment node
* @return {Array[]} children list of the nodes found in this template fragment
*/

function getFragmentChildren(_ref) {
let {
head,
tail
} = _ref;
const nodes = walkNodes([head], head.nextSibling, n => n === tail, false);
nodes.push(tail);
return nodes;
}
/**
* Recursive function to walk all the <template> children nodes
* @param {Array[]} children - children nodes collection
* @param {ChildNode} node - current node
* @param {Function} check - exit function check
* @param {boolean} isFilterActive - filter flag to skip nodes managed by other bindings
* @returns {Array[]} children list of the nodes found in this template fragment
*/

function walkNodes(children, node, check, isFilterActive) {
const {
nextSibling
} = node; // filter tail and head nodes together with all the nodes in between
// this is needed only to fix a really ugly edge case https://github.com/riot/riot/issues/2892

if (!isFilterActive && !node[HEAD_SYMBOL] && !node[TAIL_SYMBOL]) {
children.push(node);
}

if (!nextSibling || check(node)) return children;
return walkNodes(children, nextSibling, check, // activate the filters to skip nodes between <template> fragments that will be managed by other bindings
isFilterActive && !node[TAIL_SYMBOL] || nextSibling[HEAD_SYMBOL]);
}

/**
* Quick type checking
* @param {*} element - anything
Expand Down Expand Up @@ -546,9 +506,7 @@ const EachBinding = {
batches.forEach(fn => fn()); // update the children map

this.childrenMap = newChildrenMap;
this.nodes = futureNodes; // make sure that the loop edge nodes are marked

markEdgeNodes(this.nodes);
this.nodes = futureNodes;
return this;
},

Expand Down Expand Up @@ -627,19 +585,6 @@ function extendScope(scope, _ref) {
if (indexName) defineProperty(scope, indexName, index);
return scope;
}
/**
* Mark the first and last nodes in order to ignore them in case we need to retrieve the <template> fragment nodes
* @param {Array[]} nodes - each binding nodes list
* @returns {undefined} void function
*/


function markEdgeNodes(nodes) {
const first = nodes[0];
const last = nodes[nodes.length - 1];
if (first) first[HEAD_SYMBOL] = true;
if (last) last[TAIL_SYMBOL] = true;
}
/**
* Loop the current template items
* @param {Array} items - expression collection value
Expand Down Expand Up @@ -696,7 +641,7 @@ function createPatch(items, scope, parentScope, binding) {


if (isTemplateTag) {
nodes.push(...(mustMount ? meta.children : getFragmentChildren(meta)));
nodes.push(...meta.children);
} else {
nodes.push(el);
} // delete the old item from the children map
Expand Down Expand Up @@ -2547,7 +2492,7 @@ function pure(func) {
const withTypes = component => component;
/** @type {string} current riot version */

const version = 'v6.1.1'; // expose some internal stuff that might be used from external tools
const version = 'v6.1.2'; // expose some internal stuff that might be used from external tools

const __ = {
cssManager,
Expand Down
63 changes: 4 additions & 59 deletions riot.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Riot v6.1.1, @license MIT */
/* Riot v6.1.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 @@ -263,46 +263,6 @@
return source;
}

/**
* Get the current <template> fragment children located in between the head and tail comments
* @param {Comment} head - head comment node
* @param {Comment} tail - tail comment node
* @return {Array[]} children list of the nodes found in this template fragment
*/

function getFragmentChildren(_ref) {
let {
head,
tail
} = _ref;
const nodes = walkNodes([head], head.nextSibling, n => n === tail, false);
nodes.push(tail);
return nodes;
}
/**
* Recursive function to walk all the <template> children nodes
* @param {Array[]} children - children nodes collection
* @param {ChildNode} node - current node
* @param {Function} check - exit function check
* @param {boolean} isFilterActive - filter flag to skip nodes managed by other bindings
* @returns {Array[]} children list of the nodes found in this template fragment
*/

function walkNodes(children, node, check, isFilterActive) {
const {
nextSibling
} = node; // filter tail and head nodes together with all the nodes in between
// this is needed only to fix a really ugly edge case https://github.com/riot/riot/issues/2892

if (!isFilterActive && !node[HEAD_SYMBOL] && !node[TAIL_SYMBOL]) {
children.push(node);
}

if (!nextSibling || check(node)) return children;
return walkNodes(children, nextSibling, check, // activate the filters to skip nodes between <template> fragments that will be managed by other bindings
isFilterActive && !node[TAIL_SYMBOL] || nextSibling[HEAD_SYMBOL]);
}

/**
* Quick type checking
* @param {*} element - anything
Expand Down Expand Up @@ -552,9 +512,7 @@
batches.forEach(fn => fn()); // update the children map

this.childrenMap = newChildrenMap;
this.nodes = futureNodes; // make sure that the loop edge nodes are marked

markEdgeNodes(this.nodes);
this.nodes = futureNodes;
return this;
},

Expand Down Expand Up @@ -633,19 +591,6 @@
if (indexName) defineProperty(scope, indexName, index);
return scope;
}
/**
* Mark the first and last nodes in order to ignore them in case we need to retrieve the <template> fragment nodes
* @param {Array[]} nodes - each binding nodes list
* @returns {undefined} void function
*/


function markEdgeNodes(nodes) {
const first = nodes[0];
const last = nodes[nodes.length - 1];
if (first) first[HEAD_SYMBOL] = true;
if (last) last[TAIL_SYMBOL] = true;
}
/**
* Loop the current template items
* @param {Array} items - expression collection value
Expand Down Expand Up @@ -702,7 +647,7 @@


if (isTemplateTag) {
nodes.push(...(mustMount ? meta.children : getFragmentChildren(meta)));
nodes.push(...meta.children);
} else {
nodes.push(el);
} // delete the old item from the children map
Expand Down Expand Up @@ -2553,7 +2498,7 @@
const withTypes = component => component;
/** @type {string} current riot version */

const version = 'v6.1.1'; // expose some internal stuff that might be used from external tools
const version = 'v6.1.2'; // expose some internal stuff that might be used from external tools

const __ = {
cssManager,
Expand Down
4 changes: 2 additions & 2 deletions riot.min.js

Large diffs are not rendered by default.

0 comments on commit ca53665

Please sign in to comment.