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

TS 4.4 changes document.createTreeWalker to only take three params, which is illegal in IE11 #1068

Closed
rictic opened this issue Jul 14, 2021 · 3 comments · Fixed by DefinitelyTyped/DefinitelyTyped#54594

Comments

@rictic
Copy link
Contributor

rictic commented Jul 14, 2021

lib Update Request

Configuration Check

My compilation target is ES2016 and my lib is the default in the TS 4.4 beta.

Missing / Incorrect Definition

document.createTreeWalker was updated to take at most three parameters, where in previous TypeScript versions it would take four. Internet Explorer 11 will throw if the fourth parameter isn't specified.

The fourth parameter is deprecated, but real world code that needs to support older browsers like IE11 must use it.

Sample Code

document.createTreeWalker(document, NodeFilter.SHOW_ELEMENT, null, false);

Real world example: https://github.com/lit/lit/blob/a791514b426b790de2bfa4c78754fb62815e71d4/packages/lit-html/src/lit-html.ts#L396-L401

Documentation Link

https://developer.mozilla.org/en-US/docs/Web/API/Document/createTreeWalker

@DanielRosenwasser DanielRosenwasser transferred this issue from microsoft/TypeScript Jul 15, 2021
@saschanaz
Copy link
Contributor

Do we need something like @types/ie11 for such IE11-only legacy thing?

saschanaz added a commit to saschanaz/DefinitelyTyped that referenced this issue Jul 17, 2021
createTreeWalker is the first known IE11-only failure reported in microsoft/TypeScript-DOM-lib-generator#1068.
saschanaz added a commit to saschanaz/DefinitelyTyped that referenced this issue Jul 17, 2021
createTreeWalker is the first known IE11-only failure reported in microsoft/TypeScript-DOM-lib-generator#1068.
saschanaz added a commit to saschanaz/DefinitelyTyped that referenced this issue Jul 17, 2021
createTreeWalker is the first known IE11-only failure reported in microsoft/TypeScript-DOM-lib-generator#1068.
typescript-bot pushed a commit to DefinitelyTyped/DefinitelyTyped that referenced this issue Aug 3, 2021
* Add IE11 types

createTreeWalker is the first known IE11-only failure reported in microsoft/TypeScript-DOM-lib-generator#1068.

* rename as web-ie11

* fix package error

* add version
aomarks added a commit to lit/lit that referenced this issue Aug 31, 2021
- Upgrade all package locks. Includes TypeScript 4.3.5 -> 4.4.2.
- Typing fixes for TypeScript 4.4.2 (mostly https://devblogs.microsoft.com/typescript/announcing-typescript-4-4/#use-unknown-catch-variables)
- Adds `devDependency` on new `@types/web-ie11` package to address microsoft/TypeScript-DOM-lib-generator#1068
- Upgrade `xmldom` to new `@xmldom/xmldom` due to xmldom/xmldom#271
- Pin the localize transform example to TypeScript ~4.3.5 due to rollup/plugins#983
- Add missing `@types/node` dependency to `internal-scripts` (not sure why this wasn't an error before -- maybe the Node types were coming via a transitive dependency which was removed by an upgrade).
- Minor `@lit/localize-tools` changes: don't run `build` as part of `test` script, use `@lit/ssr` bare module in test instead of relative path, trivial config file schema change from dependency upgrade.
kevinpschaaf pushed a commit to lit/lit-element-starter-ts that referenced this issue Sep 21, 2021
- Upgrade all package locks. Includes TypeScript 4.3.5 -> 4.4.2.
- Typing fixes for TypeScript 4.4.2 (mostly https://devblogs.microsoft.com/typescript/announcing-typescript-4-4/#use-unknown-catch-variables)
- Adds `devDependency` on new `@types/web-ie11` package to address microsoft/TypeScript-DOM-lib-generator#1068
- Upgrade `xmldom` to new `@xmldom/xmldom` due to xmldom/xmldom#271
- Pin the localize transform example to TypeScript ~4.3.5 due to rollup/plugins#983
- Add missing `@types/node` dependency to `internal-scripts` (not sure why this wasn't an error before -- maybe the Node types were coming via a transitive dependency which was removed by an upgrade).
- Minor `@lit/localize-tools` changes: don't run `build` as part of `test` script, use `@lit/ssr` bare module in test instead of relative path, trivial config file schema change from dependency upgrade.
@saschanaz
Copy link
Contributor

Let's consider this as fixed by DefinitelyTyped/DefinitelyTyped#54594.

@github-actions close

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2021

Closing because @saschanaz is one of the code-owners of this repository.

@github-actions github-actions bot closed this as completed Oct 3, 2021
AndrewJakubowicz pushed a commit to lit/lit-element-starter-js that referenced this issue Dec 8, 2021
- Upgrade all package locks. Includes TypeScript 4.3.5 -> 4.4.2.
- Typing fixes for TypeScript 4.4.2 (mostly https://devblogs.microsoft.com/typescript/announcing-typescript-4-4/#use-unknown-catch-variables)
- Adds `devDependency` on new `@types/web-ie11` package to address microsoft/TypeScript-DOM-lib-generator#1068
- Upgrade `xmldom` to new `@xmldom/xmldom` due to xmldom/xmldom#271
- Pin the localize transform example to TypeScript ~4.3.5 due to rollup/plugins#983
- Add missing `@types/node` dependency to `internal-scripts` (not sure why this wasn't an error before -- maybe the Node types were coming via a transitive dependency which was removed by an upgrade).
- Minor `@lit/localize-tools` changes: don't run `build` as part of `test` script, use `@lit/ssr` bare module in test instead of relative path, trivial config file schema change from dependency upgrade.
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 a pull request may close this issue.

2 participants