-
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This switches from nodejs's `EventEmitter` to [emittery](https://npmjs.com/package/emittery) for a few reasons: - type-safe events. This will prevent people doing things like `.on('migration', ...)` instead of `.on('migrating', ...)` etc. It also types the event payload - especially important now since the payload is changing slightly - async events. `this.emit(...)` now returns a promise, which we can await. Which means in a follow-up, we can add `beforeAll` and `afterAll` events, which will enable use cases like locking the migration table. That wouldn't be possible with sync events. - apparently, less chance of memory leaks 🤷 The API is smaller than `EventEmitter` which makes this a breaking change by itself. `emittery` only supports single payloads too, meaning we can no longer `emit('migrating', m.name, m)` - but that was pretty redundant anyway, so it makes sense to update to `MigrationParams` as part of the major (v3) release.
- Loading branch information
Showing
5 changed files
with
93 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters