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

@shopify/theme-hot-reload

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/theme-hot-reload - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

43

dist/theme-hot-reload.js

@@ -86,38 +86,2 @@ (function hotReloadScript() {

const oseActions = {
startDataReload: async (signal) => {
if (!isOSE)
return null;
// Force OSE to show the loading state
window.dispatchEvent(new Event('pagehide'));
return fetch(window.location.href, {
// Note: enable these properties when we have access to replace_templates
// method: 'POST',
// body: storefrontReplaceTemplatesParams(data.replaceTemplates),
// This is required to get the OnlineStoreEditorData script:
headers: { Accept: 'text/html' },
signal,
})
.then((response) => response.text())
.catch((error) => {
logError('Error fetching full page reload for section settings', error);
return null;
});
},
finishDataReload: async (oseDataPromise) => {
if (!isOSE)
return null;
const refreshedHtml = await oseDataPromise;
const newOSEData = new DOMParser()
.parseFromString(refreshedHtml ?? '', 'text/html')
.querySelector('#OnlineStoreEditorData')?.textContent;
if (newOSEData) {
const oseDataElement = document.querySelector('#OnlineStoreEditorData');
if (oseDataElement && newOSEData !== oseDataElement.textContent) {
oseDataElement.textContent = newOSEData;
logInfo('OSE data updated');
}
}
// OSE reads the new data after the page is loaded
window.dispatchEvent(new Event('load'));
},
sendEvent: (payload) => {

@@ -135,5 +99,2 @@ if (!isOSE)

const controller = new AbortController();
const oseDataPromise = isOSE
? oseActions.startDataReload(controller.signal)
: null;
await Promise.all(elements.map(async (element) => {

@@ -153,5 +114,2 @@ const sectionId = element.id.replace(/^shopify-section-/, '');

});
if (oseDataPromise) {
await oseActions.finishDataReload(oseDataPromise);
}
};

@@ -326,2 +284,1 @@ const refreshAppEmbedBlock = async (data, block) => {

})();
export {};

4

package.json

@@ -9,3 +9,3 @@ {

"license": "MIT",
"version": "0.0.0",
"version": "0.0.1",
"engines": {

@@ -27,3 +27,3 @@ "node": ">=22",

"scripts": {
"build": "tsc",
"build": "rm -rf dist && tsc",
"format": "prettier --write .",

@@ -30,0 +30,0 @@ "test": "echo \"Error: no test specified\" && exit 1"

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