bun-plugin-stx 0.2.456 → 0.2.458
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/serve.js +1 -1
- package/package.json +3 -3
package/dist/serve.js
CHANGED
|
@@ -9510,7 +9510,7 @@ function __stxOverlay(errs){
|
|
|
9510
9510
|
el.innerHTML=h;
|
|
9511
9511
|
}
|
|
9512
9512
|
`;
|
|
9513
|
-
const HMR_CLIENT_SCRIPT = `<script data-stx-hmr>(()=>{if(window.__stxHmr)return;window.__stxHmr=1;${HMR_OVERLAY_JS}function bust(){var ls=document.querySelectorAll('link[rel="stylesheet"]');for(var i=0;i<ls.length;i++){var l=ls[i];var u=new URL(l.href,location.href);u.searchParams.set('v',Date.now().toString(36));l.href=u.toString()}}var version=__STX_HMR_VERSION__,es=null;function swapFragment(){var r=window.stxRouter;if(r&&typeof r.refresh==='function'){try{return r.refresh().then(function(ok){if(!ok)location.reload()},function(){location.reload()})}catch(_){location.reload()}}else{location.reload()}}function reloadStores(){var s=window.stx;if(!s||typeof s.__hmrReplaceStores!=='function'){location.reload();return}fetch('/_stx/stores.js',{cache:'no-store'}).then(function(r){return r.ok?r.text():null}).then(function(code){if(code===null){location.reload();return}s.__hmrReplaceStores(code)}).catch(function(){location.reload()})}function connect(){var source=new EventSource('/_stx/hmr');es=source;source.onmessage=function(e){try{var m=JSON.parse(e.data);if(m.type==='connected'){if(typeof m.version==='number'&&m.version!==version)location.reload();return}if(typeof m.version==='number')version=m.version;if(m.type==='reload')location.reload();else if(m.type==='css')bust();else if(m.type==='fragment')swapFragment();else if(m.type==='store')reloadStores();else if(m.type==='build-error')__stxOverlay(m.errors)}catch(_){}};source.onerror=function(){if(es
|
|
9513
|
+
const HMR_CLIENT_SCRIPT = `<script data-stx-hmr>(()=>{if(window.__stxHmr)return;window.__stxHmr=1;${HMR_OVERLAY_JS}function bust(){var ls=document.querySelectorAll('link[rel="stylesheet"]');for(var i=0;i<ls.length;i++){var l=ls[i];var u=new URL(l.href,location.href);u.searchParams.set('v',Date.now().toString(36));l.href=u.toString()}}var version=__STX_HMR_VERSION__,es=null,lost=false,retry=250;function swapFragment(){var r=window.stxRouter;if(r&&typeof r.refresh==='function'){try{return r.refresh().then(function(ok){if(!ok)location.reload()},function(){location.reload()})}catch(_){location.reload()}}else{location.reload()}}function reloadStores(){var s=window.stx;if(!s||typeof s.__hmrReplaceStores!=='function'){location.reload();return}fetch('/_stx/stores.js',{cache:'no-store'}).then(function(r){return r.ok?r.text():null}).then(function(code){if(code===null){location.reload();return}s.__hmrReplaceStores(code)}).catch(function(){location.reload()})}function connect(){var source=new EventSource('/_stx/hmr');es=source;source.onmessage=function(e){try{var m=JSON.parse(e.data);if(m.type==='connected'){retry=250;if(lost||typeof m.version==='number'&&m.version!==version)location.reload();return}if(typeof m.version==='number')version=m.version;if(m.type==='reload')location.reload();else if(m.type==='css')bust();else if(m.type==='fragment')swapFragment();else if(m.type==='store')reloadStores();else if(m.type==='build-error')__stxOverlay(m.errors)}catch(_){}};source.onerror=function(){if(es!==source)return;lost=true;if(source.readyState===2){source.close();setTimeout(function(){if(es===source)connect()},retry);retry=Math.min(retry*2,4000)}}}connect();addEventListener('pagehide',function(){if(es){es.close();es=null}});addEventListener('pageshow',function(e){if(e.persisted&&!es)connect()})})()</script>`;
|
|
9514
9514
|
function injectHmrClient(html) {
|
|
9515
9515
|
if (!html || production)
|
|
9516
9516
|
return html;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bun-plugin-stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.458",
|
|
5
5
|
"description": "A Bun plugin that allows for using Laravel Blade-like syntax.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"typecheck": "bun tsc --noEmit"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@stacksjs/stx": "0.2.
|
|
78
|
-
"stx-router": "0.2.
|
|
77
|
+
"@stacksjs/stx": "0.2.458",
|
|
78
|
+
"stx-router": "0.2.458"
|
|
79
79
|
}
|
|
80
80
|
}
|