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

@11ty/eleventy-dev-server

Package Overview
Dependencies
Maintainers
1
Versions
24
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 1.0.0-canary.6 to 1.0.0-canary.7

52

client/reload-client.js

@@ -69,32 +69,30 @@ class Util {

try {
// Important: using `./` in `./morphdom.js` allows the special `.11ty` folder to be changed upstream
const { default: morphdom } = await import(`./morphdom.js`);
if((build.templates || []).length > 0) {
// Important: using `./` in `./morphdom.js` allows the special `.11ty` folder to be changed upstream
const { default: morphdom } = await import(`./morphdom.js`);
for (let template of build.templates || []) {
if (template.url === document.location.pathname) {
// Importantly, if this does not match but is still relevant (layout/include/etc), a full reload happens below. This could be improved.
if ((files || []).includes(template.inputPath)) {
// Notable limitation: this won’t re-run script elements or JavaScript page lifecycle events (load/DOMContentLoaded)
morphed = true;
// Util.log( JSON.stringify(build.templates, null, 2) );
for (let template of build.templates || []) {
if (template.url === document.location.pathname) {
// Importantly, if this does not match but is still relevant
// (layout/include/etc), a full reload happens below.
// This could be improved.
if ((files || []).includes(template.inputPath)) {
// Notable limitation: this won’t re-run script elements
morphed = true;
morphdom(document.documentElement, template.content, {
childrenOnly: true,
// Speed-up trick from morphdom docs
onBeforeElUpdated: function (fromEl, toEl) {
// https://dom.spec.whatwg.org/#concept-node-equals
if (fromEl.isEqualNode(toEl)) {
return false;
}
return true;
},
});
morphdom(document.documentElement, template.content, {
childrenOnly: true,
// Speed-up trick from morphdom docs
onBeforeElUpdated: function (fromEl, toEl) {
// https://dom.spec.whatwg.org/#concept-node-equals
if (fromEl.isEqualNode(toEl)) {
return false;
}
return true;
},
});
Util.matchRootAttributes(template.content);
Util.log(`HTML delta applied without page reload.`);
Util.matchRootAttributes(template.content);
Util.log(`HTML delta applied without page reload.`);
}
break;
}
break;
}

@@ -101,0 +99,0 @@ }

{
"name": "@11ty/eleventy-dev-server",
"version": "1.0.0-canary.6",
"version": "1.0.0-canary.7",
"description": "A minimal, modern, generic, hot-reloading local web server to help web developers.",

@@ -5,0 +5,0 @@ "main": "server.js",

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