New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@11ty/eleventy-dev-server

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@11ty/eleventy-dev-server - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

45

client/reload-client.js

@@ -58,6 +58,6 @@ class Util {

let newWithoutHref = to.cloneNode();
oldWithoutHref.removeAttribute("href");
newWithoutHref.removeAttribute("href");
// if all other attributes besides href match

@@ -89,3 +89,3 @@ if(!oldWithoutHref.isEqualNode(newWithoutHref)) {

//copy over the attributes
// copy over the attributes
for(let attr of [...source.attributes]) {

@@ -166,3 +166,3 @@ script.setAttribute(attr.nodeName ,attr.nodeValue);

});
socket.addEventListener("close", () => {

@@ -209,3 +209,7 @@ this.connectionMessageShown = false;

if (fromEl.nodeName === "SCRIPT" && toEl.nodeName === "SCRIPT") {
Util.runScript(toEl, fromEl);
if(toEl.innerHTML !== fromEl.innerHTML) {
Util.log(`JavaScript modified, reload initiated.`);
window.location.reload();
}
return false;

@@ -226,7 +230,36 @@ }

},
addChild: function(parent, child) {
// Declarative Shadow DOM https://github.com/11ty/eleventy-dev-server/issues/90
if(child.nodeName === "TEMPLATE" && child.hasAttribute("shadowrootmode")) {
let root = parent.shadowRoot;
if(root) {
// remove all shadow root children
while(root.firstChild) {
root.removeChild(root.firstChild);
}
}
for(let newChild of child.content.childNodes) {
root.appendChild(newChild);
}
} else {
parent.appendChild(child);
}
},
onNodeAdded: function (node) {
if (node.nodeName === 'SCRIPT') {
Util.runScript(node);
Util.log(`JavaScript added, reload initiated.`);
window.location.reload();
}
},
onElUpdated: function(node) {
// Re-attach custom elements
if(customElements.get(node.tagName.toLowerCase())) {
let placeholder = document.createElement("div");
node.replaceWith(placeholder);
requestAnimationFrame(() => {
placeholder.replaceWith(node);
placeholder = undefined;
});
}
}
});

@@ -233,0 +266,0 @@

14

package.json
{
"name": "@11ty/eleventy-dev-server",
"version": "2.0.2",
"version": "2.0.3",
"description": "A minimal, modern, generic, hot-reloading local web server to help web developers.",

@@ -41,15 +41,15 @@ "main": "server.js",

"dependencies": {
"@11ty/eleventy-utils": "^1.0.2",
"@11ty/eleventy-utils": "^1.0.3",
"chokidar": "^3.6.0",
"debug": "^4.3.5",
"debug": "^4.3.6",
"dev-ip": "^1.0.1",
"finalhandler": "^1.2.0",
"finalhandler": "^1.3.0",
"mime": "^3.0.0",
"minimist": "^1.2.8",
"morphdom": "^2.7.2",
"morphdom": "^2.7.4",
"please-upgrade-node": "^3.2.0",
"send": "^0.18.0",
"ssri": "^10.0.6",
"ssri": "^11.0.0",
"urlpattern-polyfill": "^10.0.0",
"ws": "^8.17.0"
"ws": "^8.18.0"
},

@@ -56,0 +56,0 @@ "devDependencies": {

@@ -38,2 +38,3 @@ const path = require("node:path");

useCache: false, // Use a cache for file contents
headers: {}, // Set default response headers
messageOnStart: ({ hosts, startupTime, version, options }) => {

@@ -435,2 +436,6 @@ let hostsStr = " started";

for(const [key, value] of Object.entries(this.options.headers)){
res.setHeader(key, value);
}
if (!contentType) {

@@ -437,0 +442,0 @@ return res.end(contents);

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