)]}'
{
  "commit": "84687fe0f19965c44464eac880768cad70ed860c",
  "tree": "9ee403b0824c89fca5c45b647823b27dc36a6088",
  "parents": [
    "f9e33d9fa039ecb1cc2543b192b8be606bc00dbf"
  ],
  "author": {
    "name": "Matan Lurey",
    "email": "matanlurey@users.noreply.github.com",
    "time": "Mon May 13 20:03:43 2024 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Mon May 13 20:03:43 2024 -0700"
  },
  "message": "Replace `json_utils` with a modern `extension type`, add tests. (#52769)\n\nI started on a refactoring of\nhttps://github.com/flutter/flutter/issues/147666, and was frustrated\nwith the JSON decoding of `gn desc --format\u003djson`, so I used a similar\npattern from my micro-json library (https://pub.dev/packages/jsonut) and\nencapsulated it as an extension type.\n\nMy favorite is the `JsonObject.map` function which replaces:\n\n```dart\n/// Construct a RunTarget from a JSON map.\nfactory RunTarget.fromJson(Map\u003cString, Object\u003e map) {\n  final List\u003cString\u003e errors \u003d \u003cString\u003e[];\n  final String name \u003d stringOfJson(map, _nameKey, errors)!;\n  final String id \u003d stringOfJson(map, _idKey, errors)!;\n  final String targetPlatform \u003d\n      stringOfJson(map, _targetPlatformKey, errors)!;\n\n  if (errors.isNotEmpty) {\n    throw FormatException(\u0027Failed to parse RunTarget: ${errors.join(\u0027\\n\u0027)}\u0027);\n  }\n  return RunTarget._(name, id, targetPlatform);\n}\n```\n\n... with:\n\n```dart\n/// Construct a RunTarget from a JSON map.\nfactory RunTarget.fromJson(Map\u003cString, Object\u003e map) {\n  return JsonObject(map).map((JsonObject json) \u003d\u003e RunTarget._(\n    json.string(_nameKey),\n    json.string(_idKey),\n    json.string(_targetPlatformKey),\n  ));\n}\n```",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "65da125ca40691b26822811a7495e48ea9013616",
      "old_mode": 33188,
      "old_path": "tools/engine_tool/lib/src/gn_utils.dart",
      "new_id": "d767af29cf4c775e411384f894134582319ad341",
      "new_mode": 33188,
      "new_path": "tools/engine_tool/lib/src/gn_utils.dart"
    },
    {
      "type": "delete",
      "old_id": "e813512e7cd0232489731bc44fb5e8df635a9f43",
      "old_mode": 33188,
      "old_path": "tools/engine_tool/lib/src/json_utils.dart",
      "new_id": "0000000000000000000000000000000000000000",
      "new_mode": 0,
      "new_path": "/dev/null"
    },
    {
      "type": "modify",
      "old_id": "fa43c80c4c30d7c6676796a490531af6fb8734a9",
      "old_mode": 33188,
      "old_path": "tools/engine_tool/lib/src/proc_utils.dart",
      "new_id": "7270b80d2a2904e96367035bcf7438d4be749a91",
      "new_mode": 33188,
      "new_path": "tools/engine_tool/lib/src/proc_utils.dart"
    },
    {
      "type": "modify",
      "old_id": "5c2f720879c00673cae5384485a307d5d2c81906",
      "old_mode": 33188,
      "old_path": "tools/engine_tool/lib/src/run_utils.dart",
      "new_id": "7f0b34f3ce64b48eb498ad4f944292574159e226",
      "new_mode": 33188,
      "new_path": "tools/engine_tool/lib/src/run_utils.dart"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "690c6a498123b30ae5a4eedaad5f8fe71e148f28",
      "new_mode": 33188,
      "new_path": "tools/engine_tool/lib/src/typed_json.dart"
    },
    {
      "type": "modify",
      "old_id": "c9ff25fe9743b4c03ac9c6480322ebe506a4fb82",
      "old_mode": 33188,
      "old_path": "tools/engine_tool/pubspec.yaml",
      "new_id": "0e0e14e159c9672d857cadf600a16eb2176a2a52",
      "new_mode": 33188,
      "new_path": "tools/engine_tool/pubspec.yaml"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "c23df2b7940cc8aeb2cafdd7570174eead1473a0",
      "new_mode": 33188,
      "new_path": "tools/engine_tool/test/typed_json_test.dart"
    }
  ]
}
