Commit 9e2e0baddc7 for woocommerce
commit 9e2e0baddc70343a8ba978842e0719e7cd50eb2c
Author: Mahangu Weerasinghe <mahangu@users.noreply.github.com>
Date: Tue Oct 13 21:36:22 2026 +0530
Review TypeScript callback compatibility in public packages (#69756)
* chore: review published TypeScript callback compatibility
* fix: clarify public API review exclusions
diff --git a/.ai/review/guidelines/js-public-api-contract.md b/.ai/review/guidelines/js-public-api-contract.md
index 880ff513285..581c6dc8fbc 100644
--- a/.ai/review/guidelines/js-public-api-contract.md
+++ b/.ai/review/guidelines/js-public-api-contract.md
@@ -2,6 +2,7 @@
**Source:**
+- #69365: exported callback methods became function properties, breaking TypeScript consumer compatibility.
- #68271: restored a `createElement` import.
- #55795: restored a removed `@woocommerce/data` export.
- #55876: navigation store restored and deprecated.
@@ -11,8 +12,8 @@
**What broke:** Published `@woocommerce/*` packages and `wcSettings` keys are used by extensions. Removed exports, keys, and stores broke them, and the published build crashed when JSX lost its runtime import.
-**Pattern to catch:** In `packages/js` or blocks packages: removing or renaming exports, props, store selectors, or `wcSettings` / AssetDataRegistry keys. JSX without the classic runtime import. Import-time side effects.
+**Pattern to catch:** In `packages/js` or blocks packages: removing or renaming exports, props, store selectors, or `wcSettings` / AssetDataRegistry keys. JSX without the classic runtime import. Import-time side effects. Changes from exported TypeScript callback methods to function properties can break source compatibility even when emitted JavaScript is unchanged.
-**How to confirm:** Check the package `index` exports and changelog. Does the published build use the classic JSX runtime? Grep `getSetting( 'key' )` readers.
+**How to confirm:** Check the package `index` exports and changelog. Does the published build use the classic JSX runtime? Grep `getSetting( 'key' )` readers. For published callback types under `strictFunctionTypes`, check whether an unchanged consumer with a narrower callback parameter still compiles: method parameters are bivariant, function-property parameters are contravariant. Confirm a concrete consumer compilation break before reporting.
-**Don't flag when:** Private (non-exported) modules. Additive exports.
+**Don't flag when:** Private APIs not exposed through public exports, re-exports, or signatures. Additive exports. Type changes that preserve existing consumer assignability.
diff --git a/ai-review-config.json b/ai-review-config.json
index 88a3ddde290..7e45a231c3f 100644
--- a/ai-review-config.json
+++ b/ai-review-config.json
@@ -1115,6 +1115,7 @@
"plugins/woocommerce/src/Internal/Admin/Settings.php"
],
"signals": [
+ ") =>",
"export ",
"export default",
"createElement",