Implementation:Microsoft Playwright TraceV4
Appearance
Overview
TraceV4 defines the type schema for version 4 of the Playwright trace file format, extending V3 with additional serialized value types and language/size metadata.
Description
Version 4 extends the trace format with:
Languagetype -- tracks which SDK language generated the trace (javascript, python, java, csharp, jsonl)Sizetype -- width/height dimensions for viewport and screenshot metadata- Extended
SerializedValue-- adds support for BigInt (bi), Map (m), and Set (se) serialization - Enhanced event types with additional metadata fields
Usage
Used by the trace viewer for parsing V4 format trace files.
Code Reference
Source Location
packages/playwright-core/src/utils/isomorphic/trace/versions/traceV4.ts (225 lines)
Key Types
type Language = 'javascript' | 'python' | 'java' | 'csharp' | 'jsonl';
type Point = { x: number; y: number };
type Size = { width: number; height: number };
type SerializedValue = {
// ... V3 fields plus:
bi?: string; // BigInt
m?: SerializedValue; // Map
se?: SerializedValue; // Set
};
Import
import type * as traceV4 from '../utils/isomorphic/trace/versions/traceV4';
I/O Contract
Changes from V3
- Added Language and Size types
- Extended SerializedValue with BigInt, Map, Set support
- Enhanced event metadata
Related Pages
- Microsoft_Playwright_TraceV3 -- Previous version
- Microsoft_Playwright_TraceV5 -- Next version
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment