mnfst 0.5.92 → 0.5.93
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.integrity.json +1 -1
- package/lib/manifest.utilities.js +10 -45
- package/package.json +1 -1
|
@@ -21,6 +21,6 @@
|
|
|
21
21
|
"manifest.toasts.js": "sha384-ytd5rDbax/Ou9z23uedFXPZbxDPsk2E/pxCTq4WLvfv+os1qTI6kELp0kPp07g24",
|
|
22
22
|
"manifest.tooltips.js": "sha384-Hhip5ZN66xhDw3m0XBrKLKLpcVRz3Z9RszPKqo6xvFF0mrUgQBVZ+mZjZsXgOOjS",
|
|
23
23
|
"manifest.url.parameters.js": "sha384-FIufiClqDx1rJpU/QUc9z/D43qClQ6Qm8rBahipbJl9BDHUvhrOsUDegmTWW7Tuf",
|
|
24
|
-
"manifest.utilities.js": "sha384-
|
|
24
|
+
"manifest.utilities.js": "sha384-x07Pfi4UxK9tbdcOZgZ5jkveseT1xBUTFtO08ORcokCH64FHsUceoiAICAsRJMle",
|
|
25
25
|
"manifest.js": "sha384-CUFN8gbtQW6+fnxiBnx0nPw6kKDA21+He0KFoDE9FabfJPR4lKRXaT2PWpOOKUS+"
|
|
26
26
|
}
|
|
@@ -3426,54 +3426,19 @@ TailwindCompiler.prototype.setupComponentLoadListener = function () {
|
|
|
3426
3426
|
});
|
|
3427
3427
|
};
|
|
3428
3428
|
|
|
3429
|
-
// Start processing with initial compilation
|
|
3429
|
+
// Start processing with initial compilation. DOM observation is owned by
|
|
3430
|
+
// setupComponentLoadListener (called separately from main.js init) — that one
|
|
3431
|
+
// uses an incremental staticClassCache lookup per mutation, which scales to
|
|
3432
|
+
// thousands of elements. A previous version of this method also installed its
|
|
3433
|
+
// own MutationObserver here that called getUsedClasses() on EVERY mutation
|
|
3434
|
+
// (a full document-wide O(N) DOM scan), so on a busy page with N≥3000 the
|
|
3435
|
+
// scan cost exceeded the inter-mutation interval and the main thread froze
|
|
3436
|
+
// (~100% CPU on docs site, 3042 elements). That observer was redundant with
|
|
3437
|
+
// the incremental one and has been removed.
|
|
3430
3438
|
TailwindCompiler.prototype.startProcessing = async function () {
|
|
3431
3439
|
if (this.usesStaticPrerenderUtilities) return;
|
|
3432
3440
|
try {
|
|
3433
|
-
|
|
3434
|
-
const initialCompilation = this.compile();
|
|
3435
|
-
|
|
3436
|
-
// Set up observer while compilation is running
|
|
3437
|
-
this.observer = new MutationObserver((mutations) => {
|
|
3438
|
-
const relevantMutations = mutations.filter(mutation => {
|
|
3439
|
-
if (mutation.type === 'attributes' &&
|
|
3440
|
-
mutation.attributeName === 'class') {
|
|
3441
|
-
return true;
|
|
3442
|
-
}
|
|
3443
|
-
if (mutation.type === 'childList') {
|
|
3444
|
-
return Array.from(mutation.addedNodes).some(node =>
|
|
3445
|
-
node.nodeType === Node.ELEMENT_NODE);
|
|
3446
|
-
}
|
|
3447
|
-
return false;
|
|
3448
|
-
});
|
|
3449
|
-
|
|
3450
|
-
if (relevantMutations.length === 0) return;
|
|
3451
|
-
|
|
3452
|
-
// Check if there are any new classes that need processing
|
|
3453
|
-
const newClasses = this.getUsedClasses();
|
|
3454
|
-
if (newClasses.classes.length === 0) return;
|
|
3455
|
-
|
|
3456
|
-
if (this.compileTimeout) {
|
|
3457
|
-
clearTimeout(this.compileTimeout);
|
|
3458
|
-
}
|
|
3459
|
-
this.compileTimeout = setTimeout(() => {
|
|
3460
|
-
if (!this.isCompiling) {
|
|
3461
|
-
this.compile();
|
|
3462
|
-
}
|
|
3463
|
-
}, this.options.debounceTime);
|
|
3464
|
-
});
|
|
3465
|
-
|
|
3466
|
-
// Start observing immediately
|
|
3467
|
-
this.observer.observe(document.documentElement, {
|
|
3468
|
-
childList: true,
|
|
3469
|
-
subtree: true,
|
|
3470
|
-
attributes: true,
|
|
3471
|
-
attributeFilter: ['class']
|
|
3472
|
-
});
|
|
3473
|
-
|
|
3474
|
-
// Wait for initial compilation
|
|
3475
|
-
await initialCompilation;
|
|
3476
|
-
|
|
3441
|
+
await this.compile();
|
|
3477
3442
|
this.hasInitialized = true;
|
|
3478
3443
|
} catch (error) {
|
|
3479
3444
|
console.error('Error starting Tailwind compiler:', error);
|