Skip to content

Flow Support (Fraggle Rock) #11313

@patrickhulce

Description

@patrickhulce

Summary

Lighthouse is going to slowly introduce support for running on flows, i.e. situations beyond just the initial page load. This issue collects related discussions we've had on this topic in the past, describes the rough roadmap and milestones, and links to relevant design documents as they're written.

Scope

Four core scenarios to eventually support.

  • Run snapshot-style audits on a page after interaction, i.e. I've clicked a menu option and now rerun the accessibility category
  • Run timespan-style audits on a page during any arbitrary interaction
  • Run Lighthouse on a traditional page navigation from an existing page
  • Run Lighthouse on a single page app navigation

Tentative Milestones

Phase 0 - Research & Design

  • Create an inventory of all audits cataloging their implicit requirements (e.g. snapshot v. timespan v. load) Complete
  • Create design doc and project plan Complete

Phase 1 - Basic End-to-End FR Structure

Phase 2 - Configuration Support, Snapshot mode

Phase 3 - Timespan mode

Phase 4 - Navigation mode

  • add navigations definition to config
  • create minimal navigation mode entrypoint in fraggle rock API
    • skip almost all logic, artifacts and puppeteer APIs only
  • create DevToolsLog gatherer
    • extend FR session to handle onAny()
    • expose networkmonitor object on driver / create status monitor on top of recorder
      • cleanup recordFromLogs/getRecords/getRawRecords
  • enable non-standard artifact parity
    • add artifact dependency support to config (definition) and runners (sequencing)
    • covert base artifacts to actual artifacts
    • create Trace gatherer and traces shim artifact
    • create devtoolsLogs shim artifact
  • reshape navigation mode to match more of gather-runner, FR-COMPAT annotations
    • expose execution context on driver instead of delegate
    • extract driver shared logic @patrickhulce
    • extract gather-runner shared logic @patrickhulce
      • navigation @patrickhulce
      • driver setup (JS dialogs, rIC wrap, etc)
      • phase setup (throttling, scroll position, etc)
      • navigation page load errors
      • slow CPU warning
      • base artifacts
  • filter out manual audits in empty categories

Phase 5 - Audit/Artifact upgrading

Goals: Internal refactoring to make places that require a page load more explicit, remove assumptions. (e.g. #11034 #11253 etc)
Goal: Match real-world navigation mode usecases (waitFor conditions, real network monitor stuff)

This part is parallelizable and work likely distributed among the team.

Phase 6 - Transitional Compatibility Layer / Parity / DevTools compat

  • Add Fraggle Rock mode to CLI
    • fraggle rock navigation mode
  • Test framework for additional cases
  • Fraggle Rock Smoketest Parity with Legacy #12861
    • set throttlingMethod devtools by default in timespans
    • protocol timeout support on session
    • preserve devtools log in error cases
    • preserve trace in error cases (ask @paulirish if necessary)
    • OOPIF support
    • config parity
      • navigation extension (via id)
      • plugin support
      • config validation
        • warn and drop audits that don't have artifacts met
  • GatherContext as base artifact
  • driver.disconnect implementation
  • additional trace categories
  • timespan emulation
  • fix screenshot issue Screenshots with Puppeteer have incorrect dimensions #12988 (not fixable)
  • better logging

Phase 7 - Report UI + API Hardening

Phase 8 (Post CDS) - Fraggle Rock as the new normal, scope expansion, cleanup, QoS improvements

High Priority

  • DevTools implementation
  • navigate from an existing page without URL knowledge i.e. provide navigate: () => myLink.click() instead of a URL
    • navigate without the about:blank jumps
    • remove dependency on requestedUrl and/or backfill requestedUrl to match
  • Add Flow Report support to LH viewer + gist (high priority because it will assist with testing)
  • Gather/Audit Mode in User Flows #13364

Backlog

Epics
  • single page app navigation mode (provide SPA load metrics like navigation, not just timespan) tracked elsewhere
  • opportunity rework to focus on kilobytes rather than wastedMs primo prio
  • anti-clobber mode (go through our methods that can stomp on puppeteer usage and optionally skip them) tracked elsewhere
    • throttling
    • emulation
    • blocked URL patterns
    • request interception
    • javascript dialogs
    • disconnect should disable all settings
  • cleanup tracked elsewhere
    • remove legacy path
      • remove gather-runner
      • remove artifact hacks for
    • update config helpers to use new FR types
  • expand FLHR to include interaction steps, labels, etc
  • [ ] More consistent thumbnails (example)
Tasks

Roughly priority ranked.

  • ensure that defaultSession can't be used to enable/disable domains not doing
  • enforce any use of *.disable must use a dedicated session not doing
  • Highest-impact audits report(flow): top opportunities #13082 tracked elsewhere
  • artifact improvements not doing
    • split cssusage artifact into stylesheet content and usage
    • split jsusage artifact into script content and usage
  • mobile viewport for flow report tracked elsewhere
  • pagedependencygraph support for timespans fuck no

CDP Asks

  • getThrottlingSettings/getEmulationSettings

Related Issues

#1769
#3837
#11312
#11122
#6028
#1418
#2332

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions