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

Missing Dialog element #16880

Closed
arjunyel opened this issue Jul 1, 2017 · 11 comments
Closed

Missing Dialog element #16880

arjunyel opened this issue Jul 1, 2017 · 11 comments
Assignees
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this

Comments

@arjunyel
Copy link

arjunyel commented Jul 1, 2017

TypeScript Version: 2.4.1
Code

<body>
  <dialog id="modal">
    <p>Hello Modal!</p>
  </dialog>
  <script>
    const modal = document.getElementById("modal") as HTMLDialogElement; // Error
    modal.showModal();
  </script>
</body>

Expected behavior:
Understand what a dialog element is
Actual behavior:
[ts] Cannot find name 'HTMLDialogElement'.

@kitsonk
Copy link
Contributor

kitsonk commented Jul 1, 2017

Generally TypeScript does not include the experimental technologies that aren't widely adopted tend not to be added to TypeScript. This helps developers to not accidentally create code that is broken on most browsers. Developers who know they are only going to be running on Chrome, can of course add these types to their environment themselves.

@arjunyel
Copy link
Author

arjunyel commented Jul 1, 2017

Dialog is a Living Standard and the readme for TSJS-lib-generator says:
"WhatWG
A "Working Draft" should go on DefinitelyTyped. A "Living Standard" should be added here."

@kitsonk
Copy link
Contributor

kitsonk commented Jul 1, 2017

No. TypeScript does not cover everything in the standard until it is widely adopted.

@arjunyel
Copy link
Author

arjunyel commented Jul 1, 2017

Is that recorded somewhere? The only thing I've found is the readme saying "Living Standard" is the baseline.

@mhegazy
Copy link
Contributor

mhegazy commented Aug 15, 2017

Dialog is a Living Standard and the readme for TSJS-lib-generator says:
"WhatWG
A "Working Draft" should go on DefinitelyTyped. A "Living Standard" should be added here."

The process of including a definition on DT in the default library is painful. it involves errors to all users of the DT definition file, and a cascade of issues in depending packages.
we have been more open to accepting definitions into the standard library to avoid that pain in the future.

@mhegazy mhegazy added Help Wanted You can do this Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Bug A bug in TypeScript labels Aug 15, 2017
@mhegazy mhegazy self-assigned this Aug 15, 2017
@mhegazy mhegazy added this to the TypeScript 2.6 milestone Aug 15, 2017
@mhegazy mhegazy added the Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet label Aug 15, 2017
@mhegazy mhegazy reopened this Aug 15, 2017
@mhegazy mhegazy added Fixed A PR has been merged for this issue and removed Fixed A PR has been merged for this issue Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet labels Aug 24, 2017
@jhpratt
Copy link

jhpratt commented Aug 26, 2017

@mhegazy @kitsonk Is there a way to add support for properties like this using .tsconfig? I'm running into this exact same error, and can't figure anything out. I'm using the polyfill that Google has provided, so support isn't an issue for me.

@arjunyel
Copy link
Author

@jhpratt I'm a beginner so I could be wrong but I think your two options are waiting for Typescript 2.6 or writing your own definition in the short term https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html

@jhpratt
Copy link

jhpratt commented Aug 26, 2017

@terrylewis60 What's your problem? This is absolutely unacceptable behavior period, let alone in the open source community.

@arjunyel Thanks! I'll check that out.

@kitsonk
Copy link
Contributor

kitsonk commented Aug 26, 2017

I think someone doesn't understand being subscribed to a thread via e-mail in GitHub and thinks we are intentionally sending them e-mails. Someone needs to learn how to use a computer.

@jhpratt as mentioned, an interface file with something that introduced what you are looking for. The state of this issue though now indicates that the typings are now in master and will be available in TypeScript at the next release.

@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

5 participants
@kitsonk @jhpratt @mhegazy @arjunyel and others