-
Notifications
You must be signed in to change notification settings - Fork 529
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
Add JSDOMNodeJSEnv to ci matrix and fix polyfill #2191
Conversation
core/js/src/main/scala/cats/effect/unsafe/PolyfillExecutionContext.scala
Show resolved
Hide resolved
core/js/src/main/scala/cats/effect/unsafe/PolyfillExecutionContext.scala
Show resolved
Hide resolved
I just tested this and it does indeed work! Thanks for the revision! 👍 |
Hooray!! Thanks for giving it a spin :) |
.gitignore
Outdated
# npm | ||
node_modules/ | ||
package-lock.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vasilmkd @djspiewak Just want to make sure you're aware that I decided to ignore the lockfile (created by the JSDOM
dependency), but not sure about this decision at all. @mpilquist, @ChristopherDavenport, @rossabaker, and I have been struggling with this same issue for fs2 and http4s.
In this case its just a test dependency, but @rossabaker makes a good point about repeatable builds. http4s/http4s#4938 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Holding off until a decision about the package-lock
file has been made.
Wait a second, what @djspiewak asked in Discord is actually a very valid question. If |
It's possible they are somehow disabling it, to better emulate the browser? |
I confirm that the native |
We decided to commit this. |
I set up a small node project locally.
I copied code from their readme to get a basic set up going: // From the jsdom readme
const jsdom = require("jsdom");
const { JSDOM } = jsdom;
// these 4 lines are mine
console.log(global.setImmediate);
global.setImmediate(() => console.log('hello setImmediate'));
console.log(setImmediate);
setImmediate(() => console.log('hello again setImmediate'));
// from the jsdom readme
const dom = new JSDOM(`<!DOCTYPE html><p>Hello world</p>`);
console.log(dom.window.document.querySelector("p").textContent); // "Hello world" And I'm seeing this output:
This IMO means that |
I mean, that all seems reasonable ... now try running it again through the ScalaJS test bridge? https://github.com/scala-js/scala-js-env-jsdom-nodejs |
It fails there, or rather reports |
That may very well be true, but I feel very inclined not to touch it. JSDOM is a fake environment, only used for testing. Whatever works should suffice. |
I'm just using the PR to document all discoveries, I think this is more or less good to go. |
Oh, absolutely, I appreciate your research efforts! Apologies if came across curt. |
Found it, |
Cool, that's what I thought! |
My own attempt to fix the problem reported in #2188.