Skip to content

Lazy-load EMF stylesheet#1340

Merged
elkimek merged 2 commits into
mainfrom
agent/lazy-load-emf-stylesheet
Jul 24, 2026
Merged

Lazy-load EMF stylesheet#1340
elkimek merged 2 commits into
mainfrom
agent/lazy-load-emf-stylesheet

Conversation

@elkimek

@elkimek elkimek commented Jul 24, 2026

Copy link
Copy Markdown
Owner

What changed

  • defer css/emf.css until the existing lazy EMF runtime opens the assessment UI
  • preserve stylesheet cascade order, offline precaching, concurrent-load sharing, and cache-busted retry behavior
  • contain stylesheet failures with a visible error instead of opening an unstyled editor
  • add browser coverage for load caching, retry, failure containment, and the real EMF entry path
  • ratchet the cold-load request and byte budgets and update architecture/audit documentation

Why

The EMF JavaScript feature was already lazy, but its feature-only stylesheet was still fetched on every returning-user startup. Loading both together removes that unnecessary cold-load request without changing EMF entry points or offline availability.

Impact

Measured on the same local cold mobile returning-user scenario:

  • requests: 438 → 437
  • compressed bytes: 1,846,079 → 1,844,244 (-1,835)
  • decoded bytes: 5,585,960 → 5,577,570 (-8,390)

Validation

  • COVERAGE=1 ./run-tests.sh
  • 487 Vitest/Node tests passed
  • 407 Chromium tests passed
  • 472 responsive-theme assertions passed
  • 67.29% combined function coverage passed the 67.10% ratchet
  • type checks, architecture checks, vendor integrity, module verification, and cold-load budget passed

@elkimek
elkimek marked this pull request as ready for review July 24, 2026 13:14
@elkimek
elkimek merged commit 62b6d06 into main Jul 24, 2026
3 checks passed
@elkimek
elkimek deleted the agent/lazy-load-emf-stylesheet branch July 24, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant