lighthouse/proto
Connor Clark 948fc6107e
misc: format lighthouse-result.proto (#16170)
2024-08-27 10:34:37 -07:00
..
scripts
README.md docs(proto): update protobuf installation guidance (#14558) 2022-11-28 11:57:03 -08:00
lighthouse-result.proto misc: format lighthouse-result.proto (#16170) 2024-08-27 10:34:37 -07:00

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!