lighthouse/proto
Paul Irish c220a33c4d
core(gather): handle crash if CDP target crashes (#11840)
2024-04-16 18:00:07 -07:00
..
scripts
README.md
lighthouse-result.proto

README.md

How to compile protos + use locally

You'll need to have v3.20+ of protobuf.

Note that they changed the versioning scheme and went from 3.20.1 to 4.21.0. Making it more confusing, in brew and Github, 4.21.x is shown as v21.x.

  1. Install the proto compiler with brew install protobuf, or something like this.
  2. Run yarn test-proto

Proto Resources

LHR Round Trip Flow

LHR round trip flow:
    (Compiling the Proto)
    lighthouse_result.proto -> protoc --python_out ... -> lighthouse_result.pb2
                                                                  ⭏
                                                               (used by)
    (Making a Round Trip JSON)                                     ⭏
    lhr.json --> proto_preprocessor.js -> lhr_processed.json -> json_roundtrip_via_proto.py -> lhr.round_trip.json

Hacking Hints

  • Clean out compiled proto and json with yarn clean
  • Round trips might jumble the order of your JSON keys and lists!