-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
jsdom Port for 1.0 (Feature Request) #3447
Comments
@David-Else To be honest, I just forgot about the PR. It was blocked by missing support for I currently don't have time to work on this. If anyone wants to pick up this issue, I'd highly appreciate it. :) Also, not sure whether this belongs in deno/std or whether this should be a userland thing.. |
I regret that at this point in time I don't have the knowledge needed to work on this, but fingers crossed someone reading this will :) |
@MarkTiedemann I am trying to use normal jsdom with deno and can't get it working as it is not compatible with es modules. I have been struggling to use jsdom for my tests for what seems like forever now. Is there some simple solution to use jsdom in deno that you happen to know of? Cheers! |
I used Hope this helps. If you want to give this PR a shot, feel free ask for help. :) |
@MarkTiedemann: I just tried it out. This is very cool! error: Uncaught ImportPrefixMissing: relative import path ",y),_null:E(" not prefixed with / or ./ or ../ Imported from "file:///home/.../jsdom/vendor/jsdom.js" If you search for ...,_import:E("import",y),_null:E("null",y),... Somehow deno parses the |
@David-Else that's correct, with #4030 I'm able to |
Also, #4040 helps get a step further, but there is a dependency in there what has some jspm import syntax which we don't support in Deno. |
Tried this: // app.ts
import jsdom from 'https://dev.jspm.io/jsdom'
console.log('its',jsdom); It fails here:
|
(also JSDOM from JSPM seems to load now fine under Deno. I haven't tried it with loading types though) |
The module output by jspm is working fine. there is no declaration file. so all is edit: Declaration files that depend on libraries are relatively easy to migrate The problem is with |
@axetroy I have my eye on https://deno.land/x/types/ , but ideally Pika would ship JSDom with the |
Hey folks! Any move on this? Is there anything else that has been tested? I'd like to contribute on this specific field, so if I could help, please ping :) |
@David-Else @axetroy I think we are really down to one conflict (see #5365), but it feels like we should really just eliminate any conflicts. We don't really want any. |
As for the record, I took back @MarkTiedemann's work and updated it just a bit, especially adapted tests to the new Deno tester, if you think I can make a PR: master...Pierstoval:jsdom |
I'm not sure this is needed anymore. The basic import jsdom from "https://dev.jspm.io/jsdom";
console.log(
new jsdom.JSDOM("<h1>Hello, World!<h1>", { url: "https://localhost" })
.window.document.querySelector("h1").textContent
); // => "Hello, World!" |
Is it okay for the Deno ecosystem to rely that much on the JS one? I would rather implement a stand-alone version of it, could it be internal to Deno, or a specific Deno-compatible version of the original package, WDYT? |
Yes. Deno is a JS runtime. It would be sad if it was not compatible with the existing JS ecosystem. |
I was meaning the Node.js one, specifically, but I get your point :) |
Perhaps this should be an example in the docs/manual ? I think the part that will be strange/legitimate grievance here: is where will documentation live for (But this is very cool!) |
Maybe https://deno.land/x/jsdom? Don't think this needs to be in std. |
closed in favor of #6794 - more specific |
@MarkTiedemann I was wondering if the jsdom port is still happening? I see it was never merged: denoland/std#542
It would be amazing to be able to test code for the browser in Deno 1.0. Thanks!
The text was updated successfully, but these errors were encountered: