Skip to content

Releases: mysticatea/event-target-shim

v6.0.2

07 Jan 09:30
1347327
Compare
Choose a tag to compare

🐛 Bug Fixes

This version fixed event-target-shim/es5 and event-target-shim/umd exported files for working well on IE11.

v6.0.1

07 Jan 09:28
9a1949f
Compare
Choose a tag to compare

❌ This is an accidental broken release ❌

v6.0.0

07 Jan 09:25
487b9f7
Compare
Choose a tag to compare

This package has been rewritten with TypeScript.

💥 Breaking Changes

API has some breaking changes.
See Migration Guide for details.

✨ New Features

Event class is available

Previously, this package had not exported Event class as prefers using the native Event class. Since this version, this package exports it.

import { EventTarget, Event } from "event-target-shim";

const target = new EventTarget();
target.dispatchEvent(new Event("foo"));

signal option on EventTarget.prototype.addEventListener is available

It's a new feature that was added to the standard recently: whatwg/dom#919

import { EventTarget, Event } from "event-target-shim";
import { AbortController } from "abort-controller";

const target = new EventTarget();
const ac = new AbortController();

target.addEventListener("foo", listener, { signal: ac.signal });

// Remove the listener
ac.abort();

■ Customizing error/warning handling

Since this version, if a listener threw an exception, it causes the uncaughtException event on Node.js or the error event on window. Also, if an operation was ignored silently, it prints warnings with console.warn.

You can customize this behavior.

import { setErrorHandler, setWarningHandler } from "event-target-shim";

setErrorHandler((error) => {
  // Do something.
});
setWarningHandler((warning) => {
  // Do something.
});

v5.0.1

19 Feb 06:03
v5.0.1
410bad2
Compare
Choose a tag to compare

🐛 Bug Fixes

  • 6218530 fixed the bug that the transpiled .umd.js file is using ES2015 syntax.

v5.0.0

21 Jan 07:34
v5.0.0
a3774a5
Compare
Choose a tag to compare

This release affects only type definitions for TypeScript but doesn't change any implementation.

Breaking changes

v4.0.3

05 Dec 02:32
v4.0.3
f7f80bb
Compare
Choose a tag to compare

🐛 Bug fixes

  • 77fb620 fixed a bug that it used ES2018 syntax which Node.js 6.x doesn't support.

v4.0.2

05 Dec 02:31
v4.0.2
8f3eaae
Compare
Choose a tag to compare

🐛 Bug fixes

  • bc69ef4 fixed a bug in the type definition.

v4.0.1

01 Dec 14:43
v4.0.1
287ab36
Compare
Choose a tag to compare

🐛 Bug fixes

v4.0.0

01 Dec 13:50
v4.0.0
a6c10d0
Compare
Choose a tag to compare

The notable change is that this package gets including the TypeScript type definition 🎉

💥 Breaking changes

  • 9557cbd dropped Node.js 4.x support. It has been EOL since April 2017.
  • 66429d0 added the TypeScript type definition. It might be impact for people is using this package with TypeScript.
  • 91df0db removed the undocumented return values from EventTarget#addEventListener and EventTarget#removeEventListener.

✨ Enhancements

  • ff21937 added some lacking members to our Event wrapper: srcElement, cancelBubble, returnValue, and initEvent. Those exist for historical reason.

v3.0.2

26 Jun 09:31
v3.0.2
a33b40b
Compare
Choose a tag to compare

Bug fixes

  • db03dcc fixed an invalid field in package.json.
  • 5e5aa51 fixed the problem that EventTarget stops event dispatching if a listener threw an exception.