)]}'
{
  "commit": "015ea6d0b03c5e3f1da306301c8a8e8aa90157a4",
  "tree": "dc4ffe87b2ba6a9f99e23a440eb5ef9e1c074089",
  "parents": [
    "ab7eb7aff6f4dd4a1fe8edf70dedd719b328bdbe"
  ],
  "author": {
    "name": "Shivanshu",
    "email": "112751483+shivanshu877@users.noreply.github.com",
    "time": "Wed Jul 08 11:32:29 2026 +0530"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Jul 08 06:02:29 2026 +0000"
  },
  "message": "engine: explain why each candidate build was skipped in Flutter web loader (#186254)\n\n## Description\n\nWhen the Flutter web loader picks a build for the current browser, it\nwalks `buildConfig.builds` and takes the first one whose\n`compileTarget`, `renderer`, and WASM-allowlist constraints all match.\nToday, builds that fail those checks are silently filtered out, so:\n\n* If every build is rejected, the user sees the generic *\"FlutterLoader\ncould not find a build compatible...\"* error and has no way to tell\nwhich constraint blocked which build.\n* If a preferred build (e.g. `dart2wasm` + `skwasm`) is rejected and the\nloader silently falls back to a less-preferred build (e.g. `dart2js` +\n`canvaskit`), the user has no way to tell that a fallback even happened,\nmuch less why.\n\nThis was suggested by @yjbanov in\nhttps://github.com/flutter/flutter/issues/143603#issuecomment-1996739832\nand is the fallback-side complement to the COOP/COEP load-failure\nwarning in #142822.\n\n## What changed\n\n`loader.js`\u0027s `buildIsCompatible` was a `bool`-returning predicate.\nRefactored to `buildIncompatibilityReason` that returns either `null`\n(compatible) or a short human-readable string. The selection loop\ncaptures the reason for each skipped candidate, then:\n\n* If **no compatible build is found**, prints a `console.warn`\nunconditionally so the silently-blank-page case is never silent. The\nwarning hints at `verboseBuildSelection` for follow-up.\n* If **`verboseBuildSelection: true`** is set on the Flutter config,\nprints one `console.warn` per skipped candidate explaining its rejection\nreason — useful both for the no-build case and for the \"why does the\nloader keep falling back to canvaskit when I expected skwasm?\" debug\ncase. Off by default to keep the typical user\u0027s console quiet.\n\nSample output a developer would see on a browser without WasmGC, with\n`verboseBuildSelection: true`:\n\n```\n[warn] Flutter Web: build dart2wasm/skwasm was skipped: dart2wasm requires WasmGC support; this browser does not implement it yet.\n```\n\nAnd without `verboseBuildSelection`, when no compatible build is found:\n\n```\n[warn] Flutter Web: no compatible build found for this browser. Set `verboseBuildSelection: true` in your Flutter configuration to see why each candidate was rejected.\n```\n\n## Tests\n\nNo JS test infrastructure exists for\n`engine/src/flutter/lib/web_ui/flutter_js/`. The change is also pure\nadditive logging — the build-selection algorithm picks the same build it\npicked before. Requesting a test exemption.\n\nThis PR replaces #186238 (closed for a clean conversation timeline).\n\n## Pre-launch Checklist\n\n- [x] I read the [Contributor Guide].\n- [x] I read the [Tree Hygiene] page.\n- [x] I read and followed the [Flutter Style Guide].\n- [x] I signed the [CLA].\n- [x] No behavioral change beyond the new opt-in diagnostic logging.\n\n[Contributor Guide]:\nhttps://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview\n[Tree Hygiene]:\nhttps://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md\n[Flutter Style Guide]:\nhttps://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md\n\n---------\n\nCo-authored-by: Harry Terkelsen \u003c1961493+harryterkelsen@users.noreply.github.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f84d2e69f91578099580e89a24b61b6d246d782e",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/lib/web_ui/flutter_js/src/loader.js",
      "new_id": "7fa689e7cb99db03b715085d15f26e8427bfc860",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/lib/web_ui/flutter_js/src/loader.js"
    },
    {
      "type": "modify",
      "old_id": "11c439d4ad2333178a9a2ae7ed467564cf40acac",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/lib/web_ui/flutter_js/src/types.d.ts",
      "new_id": "4a6202a6b5bbe1d224788c181f79f5551fa814a3",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/lib/web_ui/flutter_js/src/types.d.ts"
    }
  ]
}
