Skip to content

tsconfig.json incorrectly relies upon browser DOM types #65

@ericdrobinson

Description

@ericdrobinson

UXP supports a specific subset of browser DOM APIs. TypeScript's DOM lib, on the other hand, is extremely comprehensive. Configuring an environment with TypeScript's built-in DOM library leads to confusing bugs and causes tools to incorrectly suggest types.

Recommendation:

  1. Remove the dom entry from the tsconfig.json lib array.
  2. Create UXP-specific type declaration files for the following:
    1. UI Classes (e.g. Attr and friends)
    2. HTML Elements (e.g. HTMLAnchorElement and friends)
    3. Events (e.g. BaseUIEvent and friends)

As Adobe incorporates more HTML and standard browser DOM APIs into UXP, the type declaration files can be updated to reflect the enhancements. This will help resolve an entire class of typo/error/etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    TBD / FutureTo be discussed, maybe implemented in the future – issues which are not pressingenhancementNew feature or requestwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions