Skip to content

Commit 48fe73e

Browse files
committed
chore: update dependencies and improve performance
- Updated devDependencies in package.json for eslint, playwright, and others to their latest versions. - Added a new function `shouldHandleExternalDomMutation` to enhance DOM mutation handling. - Refactored game state store to remove unnecessary null assignments. - Added reduced motion styles to various components to improve accessibility. - Suppressed duplicate subscriber work in game state store tests. - Implemented abort handling for inflight update checks in xConfig shell. - Added smoke tests for xConfig host surface rendering. - Created tests for new DOM mutation filter functionality and reduced motion styles.
1 parent a4f4463 commit 48fe73e

27 files changed

Lines changed: 831 additions & 475 deletions

e2e/browser-smoke.spec.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// @ts-check
2+
import { test, expect } from "@playwright/test";
3+
4+
test("local browser smoke renders the xConfig host surface", async ({ page }) => {
5+
await page.setContent(`
6+
<!doctype html>
7+
<html lang="en">
8+
<head>
9+
<meta charset="utf-8">
10+
<title>autodarts-xconfig smoke</title>
11+
<style>
12+
#root { min-height: 100vh; }
13+
#ad-xconfig-panel-host { display: grid; min-height: 120px; }
14+
</style>
15+
</head>
16+
<body>
17+
<main id="root">
18+
<button id="ad-xconfig-menu-item" type="button">AD xConfig</button>
19+
<section id="ad-xconfig-panel-host" aria-label="AD xConfig"></section>
20+
</main>
21+
</body>
22+
</html>
23+
`);
24+
25+
await expect(page.locator("#ad-xconfig-menu-item")).toBeVisible();
26+
await expect(page.locator("#ad-xconfig-panel-host")).toBeVisible();
27+
await expect(page).toHaveTitle("autodarts-xconfig smoke");
28+
});

e2e/example.spec.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

package-lock.json

Lines changed: 254 additions & 429 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@
3636
},
3737
"license": "MIT",
3838
"devDependencies": {
39-
"@eslint/js": "^9.38.0",
40-
"@playwright/test": "^1.59.1",
41-
"@types/node": "^25.5.2",
42-
"esbuild": "^0.25.12",
43-
"eslint": "^9.38.0",
44-
"globals": "^16.4.0"
39+
"@eslint/js": "^10.0.1",
40+
"@playwright/test": "^1.60.0",
41+
"@types/node": "^25.9.1",
42+
"esbuild": "^0.28.0",
43+
"eslint": "^10.4.1",
44+
"globals": "^17.6.0"
4545
},
4646
"dependencies": {
47-
"playwright": "^1.59.1"
47+
"playwright": "^1.60.0"
4848
}
4949
}

src/core/dom-mutation-filter.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,13 @@ export function hasExternalDomMutation(mutations = [], isManagedNode = null) {
113113
return touchedNodes.some((node) => !isManagedNode(node));
114114
});
115115
}
116+
117+
export function shouldHandleExternalDomMutation(mutations = [], options = {}) {
118+
if (!hasExternalDomMutation(mutations, options.isManagedNode)) {
119+
return false;
120+
}
121+
122+
return typeof options.shouldHandle === "function"
123+
? Boolean(options.shouldHandle(mutations))
124+
: true;
125+
}

src/core/game-state-store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ export function createGameStateStore(options = {}) {
364364
return;
365365
}
366366

367-
let parsed = null;
367+
let parsed;
368368
try {
369369
parsed = JSON.parse(rawData);
370370
} catch (_) {

src/features/checkout-board-targets/style.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,5 +378,14 @@ export function buildStyleText() {
378378
stroke-width: calc(var(--ad-ext-target-outline-width) + var(--ad-ext-target-outline-width-up-px));
379379
}
380380
}
381+
382+
@media (prefers-reduced-motion: reduce) {
383+
.${TARGET_CLASS},
384+
.${OUTLINE_CLASS} {
385+
animation: none !important;
386+
transition: none !important;
387+
transform: none !important;
388+
}
389+
}
381390
`;
382391
}

src/features/checkout-score-pulse/style.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,14 @@ ${scopedClassSelector(selectorPrefix, EFFECT_CLASSES.blink)} {
187187
opacity: 1;
188188
}
189189
}
190+
191+
@media (prefers-reduced-motion: reduce) {
192+
${scopedClassSelector(selectorPrefix, HIGHLIGHT_CLASS)} {
193+
animation: none !important;
194+
transition: none !important;
195+
transform: none !important;
196+
}
197+
}
190198
`;
191199
}
192200

src/features/dart-marker-darts/logic.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,6 @@ function ensureOverlaySvg(state, documentRef) {
433433
if (String(overlay.tagName || "").toLowerCase() === "svg") {
434434
return overlay;
435435
}
436-
overlay = null;
437436
}
438437

439438
overlay = documentRef.getElementById(OVERLAY_ID);

src/features/dart-marker-darts/style.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,15 @@ export function buildStyleText() {
9696
transform-box: fill-box;
9797
will-change: transform, opacity;
9898
}
99+
100+
@media (prefers-reduced-motion: reduce) {
101+
.${DART_CONTAINER_CLASS},
102+
.${DART_ROTATE_CLASS},
103+
.${DART_SHADOW_CLASS},
104+
.${DART_CLASS} {
105+
animation: none !important;
106+
transition: none !important;
107+
}
108+
}
99109
`;
100110
}

0 commit comments

Comments
 (0)