The event-target-shim dependency is a major version out of date, resulting in duplicate installation headaches for projects that actually need the newer event-target-shim version to polyfill event related globals (the old version doesn't export the needed classes) at the same time as the abort-controller/polyfill.
For example, in graphql-react-examples:
graphql-react-examples@ /[redacted]/graphql-react-examples
├─┬ abort-controller@3.0.0
│ └── event-target-shim@5.0.1
└── event-target-shim@6.0.2
https://github.com/jaydenseric/graphql-react-examples/blob/4b732478987ea452acfb43c752ab99512463d9b2/utils/nodePolyfills.js#L1-L22
if (typeof window === 'undefined') {
if (!('performance' in global))
global.performance = require('perf_hooks').performance;
if (!('EventTarget' in global))
global.EventTarget =
require('events').EventTarget || require('event-target-shim').EventTarget;
if (!('Event' in global))
global.Event =
require('events').Event || require('event-target-shim').Event;
if (!('CustomEvent' in global))
global.CustomEvent = class CustomEvent extends Event {
constructor(eventName, { detail, ...eventOptions } = {}) {
super(eventName, eventOptions);
this.detail = detail;
}
};
require('abort-controller/polyfill');
}
The
event-target-shimdependency is a major version out of date, resulting in duplicate installation headaches for projects that actually need the newerevent-target-shimversion to polyfill event related globals (the old version doesn't export the needed classes) at the same time as theabort-controller/polyfill.For example, in
graphql-react-examples:https://github.com/jaydenseric/graphql-react-examples/blob/4b732478987ea452acfb43c752ab99512463d9b2/utils/nodePolyfills.js#L1-L22