Skip to content

Correct ResizeObserver callback arity #387

Open

Description

@jderochervlk

Part of #382 — v1.0.0 alpha readiness.

Problem

src/observers/ResizeObserverTypes.res:54-L56 declares:

type resizeObserverCallback = array<resizeObserverEntry> => resizeObserver => unit

Native ResizeObserver invokes one callback with two arguments. The declared type instead makes callers return a second function. A compiled packed consumer emitted a nested function; invoking it with the native argument shape returned the inner function without executing its body. A real-frame Chromium probe confirmed the same behavior.

Acceptance criteria

  • Change the callback contract to (array<resizeObserverEntry>, resizeObserver) => unit.
  • Update affected fixtures and documentation examples.
  • Add a real-browser regression that observes/resizes an element and asserts both callback work and access to the supplied observer.
  • Add compile coverage that rejects the old nested callback shape where appropriate.
  • Verify observation cleanup/disconnection so the test does not leak browser state.

Coordination

Use the regression infrastructure in #383. Source fixes can be developed in parallel, but this issue should close with executed regression coverage, not only a successful compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions