feross / queue-microtask

fast, tiny `queueMicrotask` shim for modern engines

Home Page:https://feross.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

globalThis

avasuro opened this issue · comments

commented

Because of 92b2739 (where you refactored code to use globalThis) support of node versions older than v12 where dropped (because older node versions doesn't have support of globalThis), which is a breaking change, so you should either:

  • Update major version of your package instead of updating minor version (should be 2.0.0 instead of 1.2.0) and remove version 1.2.0 and 1.2.1 from npm repository
  • Do not use globalThis

If you will not do that a lot of packages that has your package as dependency will fail. I faced this issue right now.
Could you please fix this. Thank you :)

What version of Node.js is this failing on for you?

I just tested with v6.17.1, v8.16.2, v10.18.0, and v10.23.0 and the test suite passed on all of them.

commented

@feross 11.15.0

I think something wrong in test suites, because even according to this table globalThis is not supported on old node versions, so there is no way how globalThis can work.

P.S. I pulled this repo and did npm run test - test is failing with "ReferenceError: globalThis is not defined"
P.P.S. Indeed, on node 10.23.0 test is passing :) So this issue relates to v11 only. I know why - because in this version native queueMicrotask was first time added (so in all previous versions line number 5 never executed, that's why tests are passing in node v10 and less).

Ah, I see. Basically, Node 11 is in the unlucky situation of supporting queueMicrotask but not supporting globalThis. But all stable versions of Node.js either support one or the other.

I'm going to close this since Node 11 is not a supported version.

@feross When you break backward compatibility you should change the major version, see https://docs.npmjs.com/about-semantic-versioning. So could you please revert that breaking commit, release new patch.. and than you can put that back and do major release.