Skip to content

Avoid outputting an empty object for nested module with external bindings #7145

Open
@nojaf

Description

@nojaf

Hi there,

Could it be possible to not output any JS code when doing external only bindings inside a nested module.
Example

type any

type listener

type eventTarget = {}

module EventTarget = {
  @send
  external addEventListener: (eventTarget, string, listener) => unit =
    "addEventListener"
}

leads to

var $$EventTarget = {};

export {
  $$EventTarget ,
}

The existence of $$EventTarget seems unnecessary.
Could this be possible?

If so, and this is deemed acceptable I'd be happy to try and contribute this if I get some pointers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions