Skip to content

Commit

Permalink
4.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaGuarini committed Jun 5, 2020
1 parent d0aff44 commit cfb3138
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 481 deletions.
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": "4.12.4",
"version": "4.13.0",
"description": "Simple and elegant component-based UI library",
"homepage": "http://riot.js.org/",
"repository": "riot/riot",
Expand Down
477 changes: 48 additions & 429 deletions riot+compiler.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions riot+compiler.min.js

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions riot.esm.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Riot v4.12.4, @license MIT */
/* Riot v4.13.0, @license MIT */
/**
* Convert a string from camel case to dash-case
* @param {string} string - probably a component tag name
Expand Down Expand Up @@ -764,7 +764,7 @@ function create(node, _ref2) {
const root = node.cloneNode();
parent.insertBefore(placeholder, node);
removeNode(node);
return Object.assign(Object.assign({}, EachBinding), {}, {
return Object.assign({}, EachBinding, {
childrenMap: new Map(),
node,
root,
Expand Down Expand Up @@ -839,7 +839,7 @@ function create$1(node, _ref) {
const placeholder = document.createTextNode('');
parent.insertBefore(placeholder, node);
removeNode(node);
return Object.assign(Object.assign({}, IfBinding), {}, {
return Object.assign({}, IfBinding, {
node,
evaluate,
placeholder,
Expand Down Expand Up @@ -889,7 +889,7 @@ function evaluateAttributeExpressions(attributes) {
switch (true) {
// spread attribute
case !attribute.name && type === ATTRIBUTE:
return Object.assign(Object.assign({}, acc), value);
return Object.assign({}, acc, value);
// value attribute

case type === VALUE:
Expand Down Expand Up @@ -1168,7 +1168,7 @@ function apply(expression, value) {
}

function create$2(node, data) {
return Object.assign(Object.assign(Object.assign({}, Expression), data), {}, {
return Object.assign({}, Expression, data, {
node: data.type === TEXT ? getTextNode(node, data.childNodeIndex) : node
});
}
Expand All @@ -1183,7 +1183,7 @@ function create$2(node, data) {
*/
function flattenCollectionMethods(collection, methods, context) {
return methods.reduce((acc, method) => {
return Object.assign(Object.assign({}, acc), {}, {
return Object.assign({}, acc, {
[method]: scope => {
return collection.map(item => item[method](scope)) && context;
}
Expand Down Expand Up @@ -1252,7 +1252,7 @@ var globals = /*#__PURE__*/Object.freeze({

function extendParentScope(attributes, scope, parentScope) {
if (!attributes || !attributes.length) return parentScope;
const expressions = attributes.map(attr => Object.assign(Object.assign({}, attr), {}, {
const expressions = attributes.map(attr => Object.assign({}, attr, {
value: attr.evaluate(scope)
}));
return Object.assign(Object.create(parentScope || null), evaluateAttributeExpressions(expressions));
Expand Down Expand Up @@ -1348,7 +1348,7 @@ function createSlot(node, _ref2) {
name,
attributes
} = _ref2;
return Object.assign(Object.assign({}, SlotBinding), {}, {
return Object.assign({}, SlotBinding, {
attributes,
node,
name
Expand Down Expand Up @@ -1467,7 +1467,7 @@ function create$4(node, _ref2) {
slots,
attributes
} = _ref2;
return Object.assign(Object.assign({}, TagBinding), {}, {
return Object.assign({}, TagBinding, {
node,
evaluate,
slots,
Expand All @@ -1493,7 +1493,7 @@ var bindings = {
*/

function fixTextExpressionsOffset(expressions, textExpressionsOffset) {
return expressions.map(e => e.type === TEXT ? Object.assign(Object.assign({}, e), {}, {
return expressions.map(e => e.type === TEXT ? Object.assign({}, e, {
childNodeIndex: e.childNodeIndex + textExpressionsOffset
}) : e);
}
Expand All @@ -1519,7 +1519,7 @@ function create$5(root, binding, templateTagOffset) {
if (redundantAttribute) node.removeAttribute(redundantAttribute);
const bindingExpressions = expressions || []; // init the binding

return (bindings[type] || bindings[SIMPLE])(node, Object.assign(Object.assign({}, binding), {}, {
return (bindings[type] || bindings[SIMPLE])(node, Object.assign({}, binding, {
expressions: templateTagOffset && !selector ? fixTextExpressionsOffset(bindingExpressions, templateTagOffset) : bindingExpressions
}));
}
Expand Down Expand Up @@ -1715,7 +1715,7 @@ const TemplateChunk = Object.freeze({
* @returns {TemplateChunk} a clone of this object resetting the this.el property
*/
clone() {
return Object.assign(Object.assign({}, this), {}, {
return Object.assign({}, this, {
el: null
});
}
Expand All @@ -1733,7 +1733,7 @@ function create$6(html, bindings) {
bindings = [];
}

return Object.assign(Object.assign({}, TemplateChunk), {}, {
return Object.assign({}, TemplateChunk, {
html,
bindingsData: bindings
});
Expand Down Expand Up @@ -2124,7 +2124,7 @@ const COMPONENT_LIFECYCLE_METHODS = Object.freeze({
[ON_BEFORE_UNMOUNT_KEY]: noop,
[ON_UNMOUNTED_KEY]: noop
});
const MOCKED_TEMPLATE_INTERFACE = Object.assign(Object.assign({}, PURE_COMPONENT_API), {}, {
const MOCKED_TEMPLATE_INTERFACE = Object.assign({}, PURE_COMPONENT_API, {
clone: noop,
createDOM: noop
});
Expand All @@ -2140,7 +2140,7 @@ function evaluateInitialProps(element, initialProps) {
initialProps = {};
}

return Object.assign(Object.assign({}, DOMattributesToObject(element)), callOrAssign(initialProps));
return Object.assign({}, DOMattributesToObject(element), callOrAssign(initialProps));
}
/**
* Bind a DOM node to its component object
Expand Down Expand Up @@ -2300,13 +2300,13 @@ function defineComponent(_ref4) {
// add the component css into the DOM
if (css && name) cssManager.add(name, css);
return curry(enhanceComponentAPI)(defineProperties( // set the component defaults without overriding the original component API
defineDefaults(componentAPI, Object.assign(Object.assign({}, COMPONENT_LIFECYCLE_METHODS), {}, {
defineDefaults(componentAPI, Object.assign({}, COMPONENT_LIFECYCLE_METHODS, {
[STATE_KEY]: {}
})), Object.assign(Object.assign({
})), Object.assign({
// defined during the component creation
[SLOTS_KEY]: null,
[ROOT_KEY]: null
}, COMPONENT_CORE_HELPERS), {}, {
}, COMPONENT_CORE_HELPERS, {
name,
css,
template
Expand Down Expand Up @@ -2370,7 +2370,7 @@ function runPlugins(component) {


function computeState(oldState, newState) {
return Object.assign(Object.assign({}, oldState), callOrAssign(newState));
return Object.assign({}, oldState, callOrAssign(newState));
}
/**
* Add eventually the "is" attribute to link this DOM node to its css
Expand Down Expand Up @@ -2407,7 +2407,7 @@ function enhanceComponentAPI(component, _ref6) {
}

this[ATTRIBUTES_KEY_SYMBOL] = createAttributeBindings(element, attributes).mount(parentScope);
defineProperty(this, PROPS_KEY, Object.freeze(Object.assign(Object.assign({}, evaluateInitialProps(element, props)), evaluateAttributeExpressions(this[ATTRIBUTES_KEY_SYMBOL].expressions))));
defineProperty(this, PROPS_KEY, Object.freeze(Object.assign({}, evaluateInitialProps(element, props), evaluateAttributeExpressions(this[ATTRIBUTES_KEY_SYMBOL].expressions))));
this[STATE_KEY] = computeState(this[STATE_KEY], state);
this[TEMPLATE_KEY_SYMBOL] = this.template.createDOM(element).clone(); // link this object to the DOM node

Expand Down Expand Up @@ -2438,7 +2438,7 @@ function enhanceComponentAPI(component, _ref6) {

const newProps = evaluateAttributeExpressions(this[ATTRIBUTES_KEY_SYMBOL].expressions);
if (this[SHOULD_UPDATE_KEY](newProps, this[PROPS_KEY]) === false) return;
defineProperty(this, PROPS_KEY, Object.freeze(Object.assign(Object.assign({}, this[PROPS_KEY]), newProps)));
defineProperty(this, PROPS_KEY, Object.freeze(Object.assign({}, this[PROPS_KEY], newProps)));
this[STATE_KEY] = computeState(this[STATE_KEY], state);
this[ON_BEFORE_UPDATE_KEY](this[PROPS_KEY], this[STATE_KEY]);
this[TEMPLATE_KEY_SYMBOL].update(this, this[PARENT_KEY_SYMBOL]);
Expand Down Expand Up @@ -2626,7 +2626,7 @@ function pure(func) {
}
/** @type {string} current riot version */

const version = 'v4.12.4'; // expose some internal stuff that might be used from external tools
const version = 'v4.13.0'; // expose some internal stuff that might be used from external tools

const __ = {
cssManager,
Expand Down
44 changes: 22 additions & 22 deletions riot.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Riot v4.12.4, @license MIT */
/* Riot v4.13.0, @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 @@ -770,7 +770,7 @@
const root = node.cloneNode();
parent.insertBefore(placeholder, node);
removeNode(node);
return Object.assign(Object.assign({}, EachBinding), {}, {
return Object.assign({}, EachBinding, {
childrenMap: new Map(),
node,
root,
Expand Down Expand Up @@ -845,7 +845,7 @@
const placeholder = document.createTextNode('');
parent.insertBefore(placeholder, node);
removeNode(node);
return Object.assign(Object.assign({}, IfBinding), {}, {
return Object.assign({}, IfBinding, {
node,
evaluate,
placeholder,
Expand Down Expand Up @@ -895,7 +895,7 @@
switch (true) {
// spread attribute
case !attribute.name && type === ATTRIBUTE:
return Object.assign(Object.assign({}, acc), value);
return Object.assign({}, acc, value);
// value attribute

case type === VALUE:
Expand Down Expand Up @@ -1174,7 +1174,7 @@
}

function create$2(node, data) {
return Object.assign(Object.assign(Object.assign({}, Expression), data), {}, {
return Object.assign({}, Expression, data, {
node: data.type === TEXT ? getTextNode(node, data.childNodeIndex) : node
});
}
Expand All @@ -1189,7 +1189,7 @@
*/
function flattenCollectionMethods(collection, methods, context) {
return methods.reduce((acc, method) => {
return Object.assign(Object.assign({}, acc), {}, {
return Object.assign({}, acc, {
[method]: scope => {
return collection.map(item => item[method](scope)) && context;
}
Expand Down Expand Up @@ -1258,7 +1258,7 @@

function extendParentScope(attributes, scope, parentScope) {
if (!attributes || !attributes.length) return parentScope;
const expressions = attributes.map(attr => Object.assign(Object.assign({}, attr), {}, {
const expressions = attributes.map(attr => Object.assign({}, attr, {
value: attr.evaluate(scope)
}));
return Object.assign(Object.create(parentScope || null), evaluateAttributeExpressions(expressions));
Expand Down Expand Up @@ -1354,7 +1354,7 @@
name,
attributes
} = _ref2;
return Object.assign(Object.assign({}, SlotBinding), {}, {
return Object.assign({}, SlotBinding, {
attributes,
node,
name
Expand Down Expand Up @@ -1473,7 +1473,7 @@
slots,
attributes
} = _ref2;
return Object.assign(Object.assign({}, TagBinding), {}, {
return Object.assign({}, TagBinding, {
node,
evaluate,
slots,
Expand All @@ -1499,7 +1499,7 @@
*/

function fixTextExpressionsOffset(expressions, textExpressionsOffset) {
return expressions.map(e => e.type === TEXT ? Object.assign(Object.assign({}, e), {}, {
return expressions.map(e => e.type === TEXT ? Object.assign({}, e, {
childNodeIndex: e.childNodeIndex + textExpressionsOffset
}) : e);
}
Expand All @@ -1525,7 +1525,7 @@
if (redundantAttribute) node.removeAttribute(redundantAttribute);
const bindingExpressions = expressions || []; // init the binding

return (bindings[type] || bindings[SIMPLE])(node, Object.assign(Object.assign({}, binding), {}, {
return (bindings[type] || bindings[SIMPLE])(node, Object.assign({}, binding, {
expressions: templateTagOffset && !selector ? fixTextExpressionsOffset(bindingExpressions, templateTagOffset) : bindingExpressions
}));
}
Expand Down Expand Up @@ -1721,7 +1721,7 @@
* @returns {TemplateChunk} a clone of this object resetting the this.el property
*/
clone() {
return Object.assign(Object.assign({}, this), {}, {
return Object.assign({}, this, {
el: null
});
}
Expand All @@ -1739,7 +1739,7 @@
bindings = [];
}

return Object.assign(Object.assign({}, TemplateChunk), {}, {
return Object.assign({}, TemplateChunk, {
html,
bindingsData: bindings
});
Expand Down Expand Up @@ -2130,7 +2130,7 @@
[ON_BEFORE_UNMOUNT_KEY]: noop,
[ON_UNMOUNTED_KEY]: noop
});
const MOCKED_TEMPLATE_INTERFACE = Object.assign(Object.assign({}, PURE_COMPONENT_API), {}, {
const MOCKED_TEMPLATE_INTERFACE = Object.assign({}, PURE_COMPONENT_API, {
clone: noop,
createDOM: noop
});
Expand All @@ -2146,7 +2146,7 @@
initialProps = {};
}

return Object.assign(Object.assign({}, DOMattributesToObject(element)), callOrAssign(initialProps));
return Object.assign({}, DOMattributesToObject(element), callOrAssign(initialProps));
}
/**
* Bind a DOM node to its component object
Expand Down Expand Up @@ -2306,13 +2306,13 @@
// add the component css into the DOM
if (css && name) cssManager.add(name, css);
return curry(enhanceComponentAPI)(defineProperties( // set the component defaults without overriding the original component API
defineDefaults(componentAPI, Object.assign(Object.assign({}, COMPONENT_LIFECYCLE_METHODS), {}, {
defineDefaults(componentAPI, Object.assign({}, COMPONENT_LIFECYCLE_METHODS, {
[STATE_KEY]: {}
})), Object.assign(Object.assign({
})), Object.assign({
// defined during the component creation
[SLOTS_KEY]: null,
[ROOT_KEY]: null
}, COMPONENT_CORE_HELPERS), {}, {
}, COMPONENT_CORE_HELPERS, {
name,
css,
template
Expand Down Expand Up @@ -2376,7 +2376,7 @@


function computeState(oldState, newState) {
return Object.assign(Object.assign({}, oldState), callOrAssign(newState));
return Object.assign({}, oldState, callOrAssign(newState));
}
/**
* Add eventually the "is" attribute to link this DOM node to its css
Expand Down Expand Up @@ -2413,7 +2413,7 @@
}

this[ATTRIBUTES_KEY_SYMBOL] = createAttributeBindings(element, attributes).mount(parentScope);
defineProperty(this, PROPS_KEY, Object.freeze(Object.assign(Object.assign({}, evaluateInitialProps(element, props)), evaluateAttributeExpressions(this[ATTRIBUTES_KEY_SYMBOL].expressions))));
defineProperty(this, PROPS_KEY, Object.freeze(Object.assign({}, evaluateInitialProps(element, props), evaluateAttributeExpressions(this[ATTRIBUTES_KEY_SYMBOL].expressions))));
this[STATE_KEY] = computeState(this[STATE_KEY], state);
this[TEMPLATE_KEY_SYMBOL] = this.template.createDOM(element).clone(); // link this object to the DOM node

Expand Down Expand Up @@ -2444,7 +2444,7 @@

const newProps = evaluateAttributeExpressions(this[ATTRIBUTES_KEY_SYMBOL].expressions);
if (this[SHOULD_UPDATE_KEY](newProps, this[PROPS_KEY]) === false) return;
defineProperty(this, PROPS_KEY, Object.freeze(Object.assign(Object.assign({}, this[PROPS_KEY]), newProps)));
defineProperty(this, PROPS_KEY, Object.freeze(Object.assign({}, this[PROPS_KEY], newProps)));
this[STATE_KEY] = computeState(this[STATE_KEY], state);
this[ON_BEFORE_UPDATE_KEY](this[PROPS_KEY], this[STATE_KEY]);
this[TEMPLATE_KEY_SYMBOL].update(this, this[PARENT_KEY_SYMBOL]);
Expand Down Expand Up @@ -2632,7 +2632,7 @@
}
/** @type {string} current riot version */

const version = 'v4.12.4'; // expose some internal stuff that might be used from external tools
const version = 'v4.13.0'; // expose some internal stuff that might be used from external tools

const __ = {
cssManager,
Expand Down
Loading

0 comments on commit cfb3138

Please sign in to comment.