Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@glimmer/runtime

Package Overview
Dependencies
Maintainers
12
Versions
289
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@glimmer/runtime - npm Package Compare versions

Comparing version 0.62.3 to 0.62.4

45

dist/commonjs/es2017/lib/vm/rehydrate-builder.js

@@ -45,3 +45,3 @@ "use strict";

while (node !== null) {
if (isComment(node) && isSerializationFirstNode(node)) {
if (isOpenBlock(node)) {
break;

@@ -53,4 +53,31 @@ }

false && (0, _util.assert)(node, `Must have opening comment <!--${SERIALIZATION_FIRST_NODE_STRING}--> for rehydration.`);
false && (0, _util.assert)(node, 'Must have opening comment for rehydration.');
this.candidate = node;
const startingBlockOffset = getBlockDepth(node);
if (startingBlockOffset !== 0) {
// We are rehydrating from a partial tree and not the root component
// We need to add an extra block before the first block to rehydrate correctly
// The extra block is needed since the renderComponent API creates a synthetic component invocation which generates the extra block
const newBlockDepth = startingBlockOffset - 1;
const newCandidate = this.dom.createComment(`%+b:${newBlockDepth}%`);
node.parentNode.insertBefore(newCandidate, this.candidate);
let closingNode = node.nextSibling;
while (closingNode !== null) {
if (isCloseBlock(closingNode) && getBlockDepth(closingNode) === startingBlockOffset) {
break;
}
closingNode = closingNode.nextSibling;
}
false && (0, _util.assert)(closingNode, 'Must have closing comment for starting block comment');
const newClosingBlock = this.dom.createComment(`%-b:${newBlockDepth}%`);
node.parentNode.insertBefore(newClosingBlock, closingNode.nextSibling);
this.candidate = newCandidate;
this.startingBlockOffset = newBlockDepth;
} else {
this.startingBlockOffset = 0;
}
}

@@ -124,3 +151,3 @@

if (isCloseBlock(current)) {
let closeBlockDepth = getBlockDepth(current);
let closeBlockDepth = getBlockDepthWithOffset(current, this.startingBlockOffset);

@@ -161,3 +188,3 @@ if (openBlockDepth >= closeBlockDepth) {

if (isOpenBlock(candidate) && getBlockDepth(candidate) === blockDepth) {
if (isOpenBlock(candidate) && getBlockDepthWithOffset(candidate, this.startingBlockOffset) === blockDepth) {
this.candidate = this.remove(candidate);

@@ -190,3 +217,3 @@ currentCursor.openBlockDepth = blockDepth;

if (isCloseBlock(candidate) && getBlockDepth(candidate) === openBlockDepth) {
if (isCloseBlock(candidate) && getBlockDepthWithOffset(candidate, this.startingBlockOffset) === openBlockDepth) {
let nextSibling = this.remove(candidate);

@@ -210,3 +237,3 @@ this.candidate = nextSibling;

if (nextSibling !== null && isCloseBlock(nextSibling) && getBlockDepth(nextSibling) === this.blockDepth) {
if (nextSibling !== null && isCloseBlock(nextSibling) && getBlockDepthWithOffset(nextSibling, this.startingBlockOffset) === this.blockDepth) {
// restore rehydration state

@@ -492,2 +519,6 @@ let candidate = this.remove(nextSibling);

function getBlockDepthWithOffset(node, offset) {
return getBlockDepth(node) - offset;
}
function isElement(node) {

@@ -531,2 +562,2 @@ return node.nodeType === 1;

}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL0BnbGltbWVyL3J1bnRpbWUvbGliL3ZtL3JlaHlkcmF0ZS1idWlsZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUNBOztBQVdBOztBQUNBOztBQUVPLE1BQU0sK0JBQStCLEdBQXJDLFFBQUE7OztBQUVELFNBQUEsd0JBQUEsQ0FBQSxJQUFBLEVBQW1EO0FBQ3ZELFNBQU8sSUFBSSxDQUFKLFNBQUEsS0FBUCwrQkFBQTtBQUNEOztBQUVLLE1BQUEsaUJBQUEsU0FBQSxrQkFBQSxDQUEyQztBQUkvQyxFQUFBLFdBQUEsQ0FBQSxPQUFBLEVBQUEsV0FBQSxFQUFBLGtCQUFBLEVBRzRDO0FBRTFDLFVBQUEsT0FBQSxFQUFBLFdBQUE7QUFGZ0IsU0FBQSxrQkFBQSxHQUFBLGtCQUFBO0FBTmxCLFN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KGFycmF5OiBTaW1wbGVBdHRyW10sIG5hbWU6IHN0cmluZyk6IFNpbXBsZUF0dHIgfCB1bmRlZmluZWQge1xuICBmb3IgKGxldCBpID0gMDsgaSA8IGFycmF5Lmxlbmd0aDsgaSsrKSB7XG4gICAgbGV0IGF0dHIgPSBhcnJheVtpXTtcbiAgICBpZiAoYXR0ci5uYW1lID09PSBuYW1lKSByZXR1cm4gYXR0cjtcbiAgfVxuXG4gIHJldHVybiB1bmRlZmluZWQ7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiByZWh5ZHJhdGlvbkJ1aWxkZXIoZW52OiBFbnZpcm9ubWVudCwgY3Vyc29yOiBDdXJzb3JJbXBsKTogRWxlbWVudEJ1aWxkZXIge1xuICByZXR1cm4gUmVoeWRyYXRlQnVpbGRlci5mb3JJbml0aWFsUmVuZGVyKGVudiwgY3Vyc29yKTtcbn1cbiJdLCJzb3VyY2VSb290IjoiIn0=

@@ -77,3 +77,3 @@ "use strict";

while (node !== null) {
if (isComment(node) && isSerializationFirstNode(node)) {
if (isOpenBlock(node)) {
break;

@@ -85,4 +85,36 @@ }

false && (0, _util.assert)(node, "Must have opening comment <!--" + SERIALIZATION_FIRST_NODE_STRING + "--> for rehydration.");
false && (0, _util.assert)(node, 'Must have opening comment for rehydration.');
_this2.candidate = node;
var startingBlockOffset = getBlockDepth(node);
if (startingBlockOffset !== 0) {
// We are rehydrating from a partial tree and not the root component
// We need to add an extra block before the first block to rehydrate correctly
// The extra block is needed since the renderComponent API creates a synthetic component invocation which generates the extra block
var newBlockDepth = startingBlockOffset - 1;
var newCandidate = _this2.dom.createComment("%+b:" + newBlockDepth + "%");
node.parentNode.insertBefore(newCandidate, _this2.candidate);
var closingNode = node.nextSibling;
while (closingNode !== null) {
if (isCloseBlock(closingNode) && getBlockDepth(closingNode) === startingBlockOffset) {
break;
}
closingNode = closingNode.nextSibling;
}
false && (0, _util.assert)(closingNode, 'Must have closing comment for starting block comment');
var newClosingBlock = _this2.dom.createComment("%-b:" + newBlockDepth + "%");
node.parentNode.insertBefore(newClosingBlock, closingNode.nextSibling);
_this2.candidate = newCandidate;
_this2.startingBlockOffset = newBlockDepth;
} else {
_this2.startingBlockOffset = 0;
}
return _this2;

@@ -146,3 +178,3 @@ }

if (isCloseBlock(current)) {
var closeBlockDepth = getBlockDepth(current);
var closeBlockDepth = getBlockDepthWithOffset(current, this.startingBlockOffset);

@@ -177,3 +209,3 @@ if (openBlockDepth >= closeBlockDepth) {

if (isOpenBlock(candidate) && getBlockDepth(candidate) === blockDepth) {
if (isOpenBlock(candidate) && getBlockDepthWithOffset(candidate, this.startingBlockOffset) === blockDepth) {
this.candidate = this.remove(candidate);

@@ -202,3 +234,3 @@ currentCursor.openBlockDepth = blockDepth;

if (isCloseBlock(candidate) && getBlockDepth(candidate) === openBlockDepth) {
if (isCloseBlock(candidate) && getBlockDepthWithOffset(candidate, this.startingBlockOffset) === openBlockDepth) {
var nextSibling = this.remove(candidate);

@@ -222,3 +254,3 @@ this.candidate = nextSibling;

if (_nextSibling !== null && isCloseBlock(_nextSibling) && getBlockDepth(_nextSibling) === this.blockDepth) {
if (_nextSibling !== null && isCloseBlock(_nextSibling) && getBlockDepthWithOffset(_nextSibling, this.startingBlockOffset) === this.blockDepth) {
// restore rehydration state

@@ -518,2 +550,6 @@ var _candidate2 = this.remove(_nextSibling);

function getBlockDepthWithOffset(node, offset) {
return getBlockDepth(node) - offset;
}
function isElement(node) {

@@ -557,2 +593,2 @@ return node.nodeType === 1;

}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL0BnbGltbWVyL3J1bnRpbWUvbGliL3ZtL3JlaHlkcmF0ZS1idWlsZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUNBOztBQVdBOztBQUNBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs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KyspIHtcbiAgICBsZXQgYXR0ciA9IGFycmF5W2ldO1xuICAgIGlmIChhdHRyLm5hbWUgPT09IG5hbWUpIHJldHVybiBhdHRyO1xuICB9XG5cbiAgcmV0dXJuIHVuZGVmaW5lZDtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHJlaHlkcmF0aW9uQnVpbGRlcihlbnY6IEVudmlyb25tZW50LCBjdXJzb3I6IEN1cnNvckltcGwpOiBFbGVtZW50QnVpbGRlciB7XG4gIHJldHVybiBSZWh5ZHJhdGVCdWlsZGVyLmZvckluaXRpYWxSZW5kZXIoZW52LCBjdXJzb3IpO1xufVxuIl0sInNvdXJjZVJvb3QiOiIifQ==

@@ -27,3 +27,3 @@ import { assert } from '@glimmer/util';

while (node !== null) {
if (isComment(node) && isSerializationFirstNode(node)) {
if (isOpenBlock(node)) {
break;

@@ -35,4 +35,31 @@ }

(false && assert(node, `Must have opening comment <!--${SERIALIZATION_FIRST_NODE_STRING}--> for rehydration.`));
(false && assert(node, 'Must have opening comment for rehydration.'));
this.candidate = node;
const startingBlockOffset = getBlockDepth(node);
if (startingBlockOffset !== 0) {
// We are rehydrating from a partial tree and not the root component
// We need to add an extra block before the first block to rehydrate correctly
// The extra block is needed since the renderComponent API creates a synthetic component invocation which generates the extra block
const newBlockDepth = startingBlockOffset - 1;
const newCandidate = this.dom.createComment(`%+b:${newBlockDepth}%`);
node.parentNode.insertBefore(newCandidate, this.candidate);
let closingNode = node.nextSibling;
while (closingNode !== null) {
if (isCloseBlock(closingNode) && getBlockDepth(closingNode) === startingBlockOffset) {
break;
}
closingNode = closingNode.nextSibling;
}
(false && assert(closingNode, 'Must have closing comment for starting block comment'));
const newClosingBlock = this.dom.createComment(`%-b:${newBlockDepth}%`);
node.parentNode.insertBefore(newClosingBlock, closingNode.nextSibling);
this.candidate = newCandidate;
this.startingBlockOffset = newBlockDepth;
} else {
this.startingBlockOffset = 0;
}
}

@@ -106,3 +133,3 @@

if (isCloseBlock(current)) {
let closeBlockDepth = getBlockDepth(current);
let closeBlockDepth = getBlockDepthWithOffset(current, this.startingBlockOffset);

@@ -143,3 +170,3 @@ if (openBlockDepth >= closeBlockDepth) {

if (isOpenBlock(candidate) && getBlockDepth(candidate) === blockDepth) {
if (isOpenBlock(candidate) && getBlockDepthWithOffset(candidate, this.startingBlockOffset) === blockDepth) {
this.candidate = this.remove(candidate);

@@ -172,3 +199,3 @@ currentCursor.openBlockDepth = blockDepth;

if (isCloseBlock(candidate) && getBlockDepth(candidate) === openBlockDepth) {
if (isCloseBlock(candidate) && getBlockDepthWithOffset(candidate, this.startingBlockOffset) === openBlockDepth) {
let nextSibling = this.remove(candidate);

@@ -192,3 +219,3 @@ this.candidate = nextSibling;

if (nextSibling !== null && isCloseBlock(nextSibling) && getBlockDepth(nextSibling) === this.blockDepth) {
if (nextSibling !== null && isCloseBlock(nextSibling) && getBlockDepthWithOffset(nextSibling, this.startingBlockOffset) === this.blockDepth) {
// restore rehydration state

@@ -471,2 +498,6 @@ let candidate = this.remove(nextSibling);

function getBlockDepthWithOffset(node, offset) {
return getBlockDepth(node) - offset;
}
function isElement(node) {

@@ -510,2 +541,2 @@ return node.nodeType === 1;

}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL0BnbGltbWVyL3J1bnRpbWUvbGliL3ZtL3JlaHlkcmF0ZS1idWlsZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLFNBQVMsTUFBVCxRQUEwRSxlQUExRTtBQVdBLFNBQVMsY0FBVCxFQUF5QixVQUF6QixRQUEyQyxXQUEzQztBQUNBLFNBQVMsWUFBVCxFQUF1QixpQkFBdkIsRUFBMEMsZUFBMUMsUUFBaUUsbUJBQWpFO0FBRUEsT0FBTyxNQUFNLCtCQUErQixHQUFHLFFBQXhDO0FBRVAsT0FBTSxTQUFVLHdCQUFWLENBQW1DLEl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yYXlbaV07XG4gICAgaWYgKGF0dHIubmFtZSA9PT0gbmFtZSkgcmV0dXJuIGF0dHI7XG4gIH1cblxuICByZXR1cm4gdW5kZWZpbmVkO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gcmVoeWRyYXRpb25CdWlsZGVyKGVudjogRW52aXJvbm1lbnQsIGN1cnNvcjogQ3Vyc29ySW1wbCk6IEVsZW1lbnRCdWlsZGVyIHtcbiAgcmV0dXJuIFJlaHlkcmF0ZUJ1aWxkZXIuZm9ySW5pdGlhbFJlbmRlcihlbnYsIGN1cnNvcik7XG59XG4iXSwic291cmNlUm9vdCI6IiJ9

@@ -43,3 +43,3 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

while (node !== null) {
if (isComment(node) && isSerializationFirstNode(node)) {
if (isOpenBlock(node)) {
break;

@@ -51,4 +51,36 @@ }

false && assert(node, "Must have opening comment <!--" + SERIALIZATION_FIRST_NODE_STRING + "--> for rehydration.");
false && assert(node, 'Must have opening comment for rehydration.');
_this2.candidate = node;
var startingBlockOffset = getBlockDepth(node);
if (startingBlockOffset !== 0) {
// We are rehydrating from a partial tree and not the root component
// We need to add an extra block before the first block to rehydrate correctly
// The extra block is needed since the renderComponent API creates a synthetic component invocation which generates the extra block
var newBlockDepth = startingBlockOffset - 1;
var newCandidate = _this2.dom.createComment("%+b:" + newBlockDepth + "%");
node.parentNode.insertBefore(newCandidate, _this2.candidate);
var closingNode = node.nextSibling;
while (closingNode !== null) {
if (isCloseBlock(closingNode) && getBlockDepth(closingNode) === startingBlockOffset) {
break;
}
closingNode = closingNode.nextSibling;
}
false && assert(closingNode, 'Must have closing comment for starting block comment');
var newClosingBlock = _this2.dom.createComment("%-b:" + newBlockDepth + "%");
node.parentNode.insertBefore(newClosingBlock, closingNode.nextSibling);
_this2.candidate = newCandidate;
_this2.startingBlockOffset = newBlockDepth;
} else {
_this2.startingBlockOffset = 0;
}
return _this2;

@@ -112,3 +144,3 @@ }

if (isCloseBlock(current)) {
var closeBlockDepth = getBlockDepth(current);
var closeBlockDepth = getBlockDepthWithOffset(current, this.startingBlockOffset);

@@ -143,3 +175,3 @@ if (openBlockDepth >= closeBlockDepth) {

if (isOpenBlock(candidate) && getBlockDepth(candidate) === blockDepth) {
if (isOpenBlock(candidate) && getBlockDepthWithOffset(candidate, this.startingBlockOffset) === blockDepth) {
this.candidate = this.remove(candidate);

@@ -168,3 +200,3 @@ currentCursor.openBlockDepth = blockDepth;

if (isCloseBlock(candidate) && getBlockDepth(candidate) === openBlockDepth) {
if (isCloseBlock(candidate) && getBlockDepthWithOffset(candidate, this.startingBlockOffset) === openBlockDepth) {
var nextSibling = this.remove(candidate);

@@ -188,3 +220,3 @@ this.candidate = nextSibling;

if (_nextSibling !== null && isCloseBlock(_nextSibling) && getBlockDepth(_nextSibling) === this.blockDepth) {
if (_nextSibling !== null && isCloseBlock(_nextSibling) && getBlockDepthWithOffset(_nextSibling, this.startingBlockOffset) === this.blockDepth) {
// restore rehydration state

@@ -481,2 +513,6 @@ var _candidate2 = this.remove(_nextSibling);

function getBlockDepthWithOffset(node, offset) {
return getBlockDepth(node) - offset;
}
function isElement(node) {

@@ -520,2 +556,2 @@ return node.nodeType === 1;

}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL0BnbGltbWVyL3J1bnRpbWUvbGliL3ZtL3JlaHlkcmF0ZS1idWlsZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUNBLFNBQUEsTUFBQSxRQUFBLGVBQUE7QUFXQSxTQUFBLGNBQUEsRUFBQSxVQUFBLFFBQUEsV0FBQTtBQUNBLFNBQUEsWUFBQSxFQUFBLGlCQUFBLEVB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IGNhbmRpZGF0ZS50YWdOYW1lID09PSB0YWc7XG4gIH1cbiAgcmV0dXJuIGNhbmRpZGF0ZS50YWdOYW1lID09PSB0YWcudG9VcHBlckNhc2UoKTtcbn1cblxuZnVuY3Rpb24gZmluZEJ5TmFtZShhcnJheTogU2ltcGxlQXR0cltdLCBuYW1lOiBzdHJpbmcpOiBTaW1wbGVBdHRyIHwgdW5kZWZpbmVkIHtcbiAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnJheS5sZW5ndGg7IGkrKykge1xuICAgIGxldCBhdHRyID0gYXJyYXlbaV07XG4gICAgaWYgKGF0dHIubmFtZSA9PT0gbmFtZSkgcmV0dXJuIGF0dHI7XG4gIH1cblxuICByZXR1cm4gdW5kZWZpbmVkO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gcmVoeWRyYXRpb25CdWlsZGVyKGVudjogRW52aXJvbm1lbnQsIGN1cnNvcjogQ3Vyc29ySW1wbCk6IEVsZW1lbnRCdWlsZGVyIHtcbiAgcmV0dXJuIFJlaHlkcmF0ZUJ1aWxkZXIuZm9ySW5pdGlhbFJlbmRlcihlbnYsIGN1cnNvcik7XG59XG4iXSwic291cmNlUm9vdCI6IiJ9

@@ -19,2 +19,3 @@ import { Bounds, ElementBuilder, Environment, Option } from '@glimmer/interfaces';

blockDepth: number;
startingBlockOffset: number;
constructor(env: Environment, parentNode: SimpleElement, nextSibling: Option<SimpleNode>);

@@ -21,0 +22,0 @@ get currentCursor(): Option<RehydratingCursor>;

26

package.json
{
"name": "@glimmer/runtime",
"version": "0.62.3",
"version": "0.62.4",
"description": "Minimal runtime needed to render Glimmer templates",

@@ -9,17 +9,17 @@ "repository": "https://github.com/glimmerjs/glimmer-vm/tree/master/packages/@glimmer/runtime",

"@glimmer/env": "0.1.7",
"@glimmer/global-context": "0.62.3",
"@glimmer/low-level": "0.62.3",
"@glimmer/util": "0.62.3",
"@glimmer/reference": "0.62.3",
"@glimmer/validator": "0.62.3",
"@glimmer/wire-format": "0.62.3",
"@glimmer/interfaces": "0.62.3",
"@glimmer/program": "0.62.3",
"@glimmer/vm": "0.62.3",
"@glimmer/global-context": "0.62.4",
"@glimmer/low-level": "0.62.4",
"@glimmer/util": "0.62.4",
"@glimmer/reference": "0.62.4",
"@glimmer/validator": "0.62.4",
"@glimmer/wire-format": "0.62.4",
"@glimmer/interfaces": "0.62.4",
"@glimmer/program": "0.62.4",
"@glimmer/vm": "0.62.4",
"@simple-dom/interface": "^1.4.0"
},
"devDependencies": {
"@glimmer/local-debug-flags": "0.62.3",
"@glimmer/opcode-compiler": "0.62.3",
"@glimmer/debug": "0.62.3",
"@glimmer/local-debug-flags": "0.62.4",
"@glimmer/opcode-compiler": "0.62.4",
"@glimmer/debug": "0.62.4",
"@types/qunit": "^2.9.0"

@@ -26,0 +26,0 @@ },

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc