Skip to content

Update DOM from TSJS-lib-generator #32335

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

Merged
merged 2 commits into from
Jul 10, 2019
Merged

Update DOM from TSJS-lib-generator #32335

merged 2 commits into from
Jul 10, 2019

Conversation

sandersn
Copy link
Member

  1. Update Navigator and other small updates.
  2. Make ProgressEvent generic.
  3. Make window: Window & typeof globalThis.
  4. Add types:
    • CSS Overflow
    • CSS Masking
    • Web Authentication
    • WebGL 2

The big change is that window now includes globals in its type via typeof globalThis. This helps some codebases a lot, such as chrome-devtools-frontend.

1. Update Navigator and other small updates.
2. Make ProgressEvent generic.
3. Make `window: Window & typeof globalThis`.
4. Add types:
  * CSS Overflow
  * CSS Masking
  * Web Authentication
  * WebGL 2

The big change is that `window` now includes globals in its type via
`typeof globalThis`. This helps some codebases a lot, such as
chrome-devtools-frontend.
@sandersn
Copy link
Member Author

@typescript-bot user test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 10, 2019

Heya @sandersn, I've started to run the parallelized community code test suite on this PR at 4a4298f. You can monitor the build here. It should now contribute to this PR's status checks.

@sandersn
Copy link
Member Author

@typescript-bot test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 10, 2019

Heya @sandersn, I've started to run the extended test suite on this PR at 4a4298f. You can monitor the build here. It should now contribute to this PR's status checks.

@sandersn
Copy link
Member Author

@typescript-bot run dt

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 10, 2019

Heya @sandersn, I've started to run the parallelized Definitely Typed test suite on this PR at 4a4298f. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot
Copy link
Collaborator

The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master.

@sandersn
Copy link
Member Author

User tests look good; no surprises there. Chrome-devtools-frontend especially benefits.

@sandersn
Copy link
Member Author

From RWC:

  1. We lose related spans on members declared as part of Window and declared globally:
window.navigate
       ~~~~~~~~
       'navigate' not found on 'Window & typeof globalThis'. Did you mean 'navigator'?

But it no longer has a related span "navigator is declared here", because navigator now has two declarations.

  1. Casting window as MyMadeupWindowSubtype will not work until MyMadeupWindowSubtype is revised to include properties from globalThis, or the cast is doubled to cast through unknown.

  2. VS Code walks a parent chain of windows, but starts the loop with let w = window. It now needs to be let w: Window = window.

I don't think any of these breaks are bad.

@sandersn
Copy link
Member Author

DT looks fine, just a couple of $ExpectType comments need to be updated.

@sandersn sandersn merged commit 5289f2e into master Jul 10, 2019
/**
* Specifies the beginning and end of the document body.
/**
* Specifies the beginning and end of the document body.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👆 what is all this, LF/CRLF variation?

Looks set to create trouble down the line.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like comments.json (1) still has explicit \r\n and (2) something changed recently to stop converting them to \n.

The right fix is to explicitly change comments.json to use \n.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea!

People may have weird git configs, check in and then CRLF noise could obscure real changes for PR reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants