-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Should "dom" lib be added to the default tsonfig? #3799
Comments
Yea makes sense to me. |
This is the reverse of what we mean by browser compatibility. Deno doesn't have a Maybe you just meant the tsconfig used for |
That was what essentially inspired this issue. If I run |
If I use the |
As a temporary fix, I found that appending this at the top of the file works (though VSCode/non-deno-typescript will throw errors). /// <reference lib="https://raw.githubusercontent.com/microsoft/TypeScript/master/lib/lib.dom.d.ts" /> |
@kitsonk You make a good point that Deno shouldn't accept code that it can't run. I retract my "makes sense" comment above. I think we all agree that we need to make a non-buggy workflow for users to have DOM APIs in their isomorphic apps. @pandawanfr I actually think that solution is pretty cool.... |
Ok so the answer to the question is: No, Deno doesn't have a DOM so the DOM lib shouldn't be applied by default. |
So does that mean this issue should be reopened? |
No, as we don't want it to be defaulted to be on. Closing #3726 should meet everyones use case in a way that is supportable the long term. |
if that works, and also done this https://raw.githubusercontent.com/denoland/deno/main/cli/dts/lib.dom.d.ts |
After watching some conference talks on YouTube I thought I would try giving it a go.
I ran into this issue though when playing around with it:
#3793 (comment)
One of the core tenants of Deno is that Deno should be browser compatible:
https://youtu.be/z6JRlx5NC9E (11:55)
Currently by default the tsconfig will cause errors to be thrown if you use variables like
document
andwindow
.If being browser compatible is one of Deno's core tenants though, shouldn't it have the
"dom"
lib active in it's default tsconfig?The text was updated successfully, but these errors were encountered: