Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tsconfig.json incorrectly relies upon browser DOM types #65

Open
ericdrobinson opened this issue Jul 11, 2019 · 2 comments
Open

tsconfig.json incorrectly relies upon browser DOM types #65

ericdrobinson opened this issue Jul 11, 2019 · 2 comments
Labels
enhancement New feature or request TBD / Future To be discussed, maybe implemented in the future – issues which are not pressing wontfix This will not be worked on

Comments

@ericdrobinson
Copy link

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.

@pklaschka
Copy link
Contributor

I'm currently unable to update the repo as I'm in the middle of exams and don't have enough time. Until August 8th, I'll review (and merge) pull requests, view comments, etc., but please understand that I don't have the time to actively update the repo for these next two weeks. Thank you very much for your understanding 🙂

@pklaschka
Copy link
Contributor

I agree that this would be ideal. However, this would require a lot of manual labor and, at least for me, is not feasible to do manually. Also, as Adobe only points to the MDN docs, it would be even more time-consuming to provide fully documented typings.

All in all, while I agree that it would be better to do so, I currently don't think it's feasible to maintain it that way. If anyone would be willing to create and maintain this aspect of the typings, feel more than welcome to do so, but personally, I won't have the time to do that...

@ashryanbeats @kerrishotts @peterflynn Any chance of getting some sort of structured format about all the classes and methods of UXP? Generating typings from that could (perhaps) make this idea feasible, and I assume it exists anyway (you haven't written this part of the docs manually?)...

@pklaschka pklaschka added enhancement New feature or request TBD / Future To be discussed, maybe implemented in the future – issues which are not pressing wontfix This will not be worked on labels Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request TBD / Future To be discussed, maybe implemented in the future – issues which are not pressing wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants