perf: cut ControlApp re-renders and lazy-load VFX packs
Move audio scrub/volume and brush drafts off root React ticks, coalesce overlay layout IPC, cache machine fingerprint and asset URLs, share one scene overlay host, and stop idle Pixi ticker. Also harden console against EPIPE on window load failures. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -15,3 +15,24 @@ void test('PxiEffectsOverlay: ограничение FPS тикера для н
|
||||
const src = fs.readFileSync(path.join(here, 'PxiEffectsOverlay.tsx'), 'utf8');
|
||||
assert.ok(src.includes('app.ticker.maxFPS'));
|
||||
});
|
||||
|
||||
void test('PxiEffectsOverlay: imperative setDraft для кисти без React state', () => {
|
||||
const src = fs.readFileSync(path.join(here, 'PxiEffectsOverlay.tsx'), 'utf8');
|
||||
assert.ok(src.includes('setDraft'));
|
||||
assert.ok(src.includes('useImperativeHandle'));
|
||||
assert.ok(src.includes('mergeDraftState'));
|
||||
});
|
||||
|
||||
void test('PxiEffectsOverlay: lazy VFX packs + idle ticker stop', () => {
|
||||
const src = fs.readFileSync(path.join(here, 'PxiEffectsOverlay.tsx'), 'utf8');
|
||||
assert.ok(src.includes('ensureVfxPacksForState'));
|
||||
assert.ok(src.includes('collectNeededVfxPacks'));
|
||||
assert.ok(src.includes('syncTickerForState'));
|
||||
assert.ok(src.includes('app.ticker.stop'));
|
||||
// Eager preload всех наборов при init убран.
|
||||
assert.doesNotMatch(
|
||||
src,
|
||||
/syncNodes\([\s\S]*?stateRef\.current[\s\S]*?\);\s*void preloadLightningVfxFrameTextures\(pixi\);\s*void preloadElectricAccentFrameTextures\(pixi\);\s*void preloadFogVfxFrameTextures\(pixi\);/,
|
||||
);
|
||||
assert.ok(src.includes('Lazy VFX'));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user