Skip to content

Commit a01ab07

Browse files
obiotclaude
andcommitted
fix(device): restore me.device.{requestFullscreen,exitFullscreen} re-export
Reverts the unintended removal of the device-namespace aliases from fd0fc67. Per the user clarification: implementations stay in `lang/deprecated.js` (correct — that's where the engine's other deprecation surface lives) but the names need to be reachable as `me.device.requestFullscreen` / `me.device.exitFullscreen` for backwards compatibility with consumers still calling through that namespace. Net structure: - `lang/deprecated.js` — function bodies + `warning(...)` runtime call + the four-variant vendor probe - `system/device.ts` — one re-export line so the names appear on `me.device.*`. eslint-disable on the re-export covers the `no-deprecated` rule (which fires when re-exporting deprecated symbols — intentional here, since the whole point is to surface them under the deprecated alias) - `system/fullscreen.ts` — `hasFullscreenSupport` / `isFullscreen` (canonical, non-deprecated), imported by BOTH device.ts and lang/deprecated.js. No circular dep. Verified round-trip via Playwright keypress on the platformer example — still req:1 / exit:1 end-to-end through the four-variant probe, zero page errors. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent fd0fc67 commit a01ab07

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

packages/melonjs/src/system/device.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,15 @@ export function enableSwipe(enable?: boolean) {
404404
}
405405
}
406406

407-
// `requestFullscreen` / `exitFullscreen` were removed from `me.device.*` in
408-
// 19.7.0 — the implementations live in `lang/deprecated.js` and surface at
409-
// the top level via `index.ts`'s `export * from "./lang/deprecated.js"`,
410-
// so `me.requestFullscreen()` keeps working as a top-level deprecated shim
411-
// with the canonical migration target being `Application#requestFullscreen` /
412-
// `Application#exitFullscreen`.
407+
// `requestFullscreen` / `exitFullscreen` were deprecated in 19.7.0 — the
408+
// implementations live with the rest of the engine's deprecation surface in
409+
// `lang/deprecated.js`. Re-exported here so they stay reachable as
410+
// `me.device.requestFullscreen` / `me.device.exitFullscreen` for backwards
411+
// compat; the disable below covers the re-export of `@deprecated` symbols
412+
// (the whole point — consumers still get the JSDoc + runtime warning when
413+
// they call them).
414+
// eslint-disable-next-line @typescript-eslint/no-deprecated
415+
export { exitFullscreen, requestFullscreen } from "../lang/deprecated.js";
413416

414417
/**
415418
* Return a string representing the orientation of the device screen.

0 commit comments

Comments
 (0)