mnfst 0.5.198-next.0 → 0.5.198-next.1
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/lib/manifest.defer.js +10 -7
- package/lib/manifest.integrity.json +1 -1
- package/package.json +2 -2
package/lib/manifest.defer.js
CHANGED
|
@@ -87,6 +87,7 @@ function register(el, rule, opts) {
|
|
|
87
87
|
lazy: !!(opts && opts.lazy),
|
|
88
88
|
discard: !!(opts && opts.discard),
|
|
89
89
|
priority: opts ? opts.priority : 0,
|
|
90
|
+
urgent: ready, // mounted after ready → the user just made it appear
|
|
90
91
|
rendered: false,
|
|
91
92
|
cleanup: []
|
|
92
93
|
};
|
|
@@ -159,19 +160,20 @@ function wire(rec) {
|
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
162
|
|
|
162
|
-
// ---- Idle prewarm (after manifest:ready; priority asc, then document order) ----
|
|
163
|
+
// ---- Idle prewarm (after manifest:ready; urgent first, then priority asc, then document order) ----
|
|
163
164
|
|
|
164
|
-
const idle = window.requestIdleCallback
|
|
165
|
-
?
|
|
166
|
-
:
|
|
165
|
+
const idle = (fn, timeout) => window.requestIdleCallback
|
|
166
|
+
? window.requestIdleCallback(fn, { timeout })
|
|
167
|
+
: setTimeout(fn, 50);
|
|
167
168
|
|
|
168
169
|
function next() {
|
|
169
170
|
let best = null;
|
|
170
171
|
for (const rec of pending) {
|
|
171
172
|
if (!rec.el.isConnected) { pending.delete(rec); continue; }
|
|
172
173
|
if (!best
|
|
173
|
-
|| rec.
|
|
174
|
-
|| (rec.
|
|
174
|
+
|| (rec.urgent && !best.urgent)
|
|
175
|
+
|| (rec.urgent === best.urgent && (rec.priority < best.priority
|
|
176
|
+
|| (rec.priority === best.priority && (best.el.compareDocumentPosition(rec.el) & Node.DOCUMENT_POSITION_PRECEDING))))) {
|
|
175
177
|
best = rec;
|
|
176
178
|
}
|
|
177
179
|
}
|
|
@@ -180,12 +182,13 @@ function next() {
|
|
|
180
182
|
|
|
181
183
|
function schedule() {
|
|
182
184
|
if (idleHandle !== null || !ready || pending.size === 0) return;
|
|
185
|
+
const head = next();
|
|
183
186
|
idleHandle = idle(() => {
|
|
184
187
|
idleHandle = null;
|
|
185
188
|
const rec = next();
|
|
186
189
|
if (rec) render(rec);
|
|
187
190
|
schedule();
|
|
188
|
-
});
|
|
191
|
+
}, head && head.urgent ? 100 : 1000);
|
|
189
192
|
}
|
|
190
193
|
|
|
191
194
|
function markReady() {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"manifest.computed.js": "sha384-LDxER8pyYyYwUxIYIyiJA02s+49g8CzpSlOj28On0DFIUgetT3UmvE/9xOsTwT66",
|
|
13
13
|
"manifest.data.js": "sha384-urUiANuQfrc+AfwTB7+nMneF2C1+EfV+S5+eg4PQnZCJ0Aid50KwSARufiVrGAXd",
|
|
14
14
|
"manifest.datepicker.js": "sha384-8vTJYkLqqvgXgm1w1becuaRR/jUEpiLBjBJ6RsRbUr+ZkypvspD6EsssuDrX4SQq",
|
|
15
|
-
"manifest.defer.js": "sha384-
|
|
15
|
+
"manifest.defer.js": "sha384-wjQ3a8ClODUJi4xlBRI03G7qWOF+DN+fJQXyxcp1jekNwrMqbgshR0LSCgkJJUiH",
|
|
16
16
|
"manifest.dropdowns.js": "sha384-4HuHkBt4i8sTPUDLB9rNLli2/lWLY1tjtCLzey37gRwueG+FRLCnVH1q7ljiVvJR",
|
|
17
17
|
"manifest.edit.js": "sha384-ZvgV3ax7yHtSC23zdvRYJPzBsBpGFBLuBJMgfQ1IDumv97Cn2bpHOePxyQikfl5L",
|
|
18
18
|
"manifest.export.js": "sha384-HCy3n6ifrcAGIyzTRgZ5JIRvSX9q9/8ykMKRSbt1QTnhXz6PgYlV0AE2N2Yi2re+",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mnfst",
|
|
3
|
-
"version": "0.5.198-next.
|
|
3
|
+
"version": "0.5.198-next.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"templates/starter",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"homepage": "https://manifestx.dev",
|
|
77
77
|
"repository": {
|
|
78
78
|
"type": "git",
|
|
79
|
-
"url": "https://github.com/Manifest-X/Manifest.git"
|
|
79
|
+
"url": "git+https://github.com/Manifest-X/Manifest.git"
|
|
80
80
|
},
|
|
81
81
|
"bugs": {
|
|
82
82
|
"url": "https://github.com/Manifest-X/Manifest/issues"
|