-
-
Notifications
You must be signed in to change notification settings - Fork 259
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
this change makes it so strict package managers installing duplicate … #1449
this change makes it so strict package managers installing duplicate … #1449
Conversation
We discussed the polyfilling for globalThis and decide it's good. This is going to be back ported to majors where the polyfilling is needed. The implementation is inspired by the one in core-js, minus the parts that wouldn't possibly work inside an ES module. |
@param {Object} it the global object to test | ||
@returns {Boolean} it exists | ||
*/ | ||
function check(it: any) { |
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.
why have this check?
why not:
const globalObject =
(typeof globalThis === 'object' && globalThis) ||
(typeof window === 'object' && window) ||
(typeof self === 'object' && self) ||
(typeof global === 'object' && global);
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.
first because it's heavily tested code from core-js implementation
second it tests for actual global instead of accidental variables
…versions of test-helpers across different addons use a shared global state instead of module state
…element type through the promise chain
fc84403
to
be76e64
Compare
This has failures right now, but it was previously passing, and the "engines" failures are due to floating deps that I can't control with yarn (I tried, and resolutions are brittle). I'm going to merge this as is, then switch the repo to pnpm, add release-plan, and get a patch out |
…versions of test-helpers across different addons use a shared global state instead of module state