stx-router 0.2.329 → 0.2.330
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/client.js +9 -2
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -988,7 +988,8 @@ else {
|
|
|
988
988
|
var scoped=/(?:^|\\s)data-stx-scoped(?:\\s|=|$)/i.test(attrs);
|
|
989
989
|
var runDecl=(attrs.match(/data-stx-run\\s*=\\s*["']?(always|once)["']?/i)||[])[1];
|
|
990
990
|
var ownerDecl=(attrs.match(/data-stx-owner\\s*=\\s*["']([^"']+)["']/i)||[])[1]||'';
|
|
991
|
-
|
|
991
|
+
var registry=/(?:^|\\s)data-stx-modules(?:\\s|=|$)/i.test(attrs)||REGISTRY_TEXT.test(code);
|
|
992
|
+
fragScripts.push({text:code,slot:slot,setupName:generatedSetupName(code),scoped:scoped,run:runDecl?runDecl.toLowerCase():'',owner:ownerDecl,registry:registry});
|
|
992
993
|
// Retain scoped setup code in its inert placeholder. A placeholder
|
|
993
994
|
// inside template.content is unreachable through document, so the
|
|
994
995
|
// repeated component runtime must execute it for each clone.
|
|
@@ -1059,7 +1060,13 @@ else {
|
|
|
1059
1060
|
// Execute page scripts FIRST \u2014 they define setup functions and set _latestSetup
|
|
1060
1061
|
log('[router] frag scripts:', fragScripts.length);
|
|
1061
1062
|
document.querySelectorAll('script[data-stx-page]').forEach(function(s){s.remove()});
|
|
1062
|
-
|
|
1063
|
+
// The page's module registry first (#1957), setups last. A fragment
|
|
1064
|
+
// lists its scripts in document order, and the registry is emitted
|
|
1065
|
+
// after the content it serves: a component that imports a package ran
|
|
1066
|
+
// ahead of it and threw "is not registered on this page". The full
|
|
1067
|
+
// document path orders them the same way (registryFirst, below).
|
|
1068
|
+
function fragOrder(entry){return entry.registry?0:entry.setupName?2:1}
|
|
1069
|
+
fragScripts.sort(function(a,b){return fragOrder(a)-fragOrder(b)});
|
|
1063
1070
|
function runFragScripts(){
|
|
1064
1071
|
fragScripts.forEach(function(entry){
|
|
1065
1072
|
var code=entry.text;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stx-router",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.330",
|
|
5
5
|
"description": "File-based router for STX — .stx template discovery, nested layouts, typed route params, middleware, and client-side SPA navigation.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|