Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactor Transports, including compatibilty for browser runtimes
I believe transports currently do not handle disconnections very gracefully. WebSocket transport also does not work very well, i think it only works with secure enabled, also the 'simple-websocket' dependency is pretty old and unmaintained, we should use a runtime agnostic dependency there. Maybe have WebSockets as the default instead of TCP so people can use it in browsers without polyfilling unnecessary node builtins. Worth thinking about enforcing separate imports for transports like
@mastondzn/dank-twitch-irc/transports/ws
to decrease bundle sizes. We could also expose a mock transport if people wish to test their event handlers this way.Use TS's erasableSyntaxOnly
In line with node's typescript's compatibilty with this flag, i think it is good to use it, would also enforce no usage of enums.
Expose a version of awaitMessages on the client (collectMessages?)
I saw that discord.js has a similar thing to await incoming messages, this function already kinda exists and is pretty nice internally, i think it would be pretty useful for us to expose a user oriented version on the client.
Refactor Mixins
I think
IgnoreUnhandledPromiseRejectionsMixin
is like a relic of node 14+ times when unhandled rejections exiting your process was unwanted. This should like never be used now. Also mixins like userstate/roomstate trackers should probably just always exist and be user accessible, not just be used by other mixins.msg.channelID
->msg.channel.id
,msg.channelName
->msg.channel.login
,msg.senderUsername
->msg.sender.login
,msg.displayName
->msg.sender.displayName
,msg.messageText -> msg.content
etc.This just makes sense i think, this naming would also be more consistent with helix's get users shape.
ESM-only output, no emitting declaration maps (.d.ts.map) and no including source code on npm.
I think having packages that were esm only was annoying a few years ago, nowadays the ecosystem is pretty much ready, even node can require sync esm graphs, as for declaration maps, i dont think they are useful, i included them because they were also included in older versions, but you cant even "go to definition" correctly because editors cant resolve
~/
paths while in node_modules, i think just being able to navigate the types is more useful and more expected behaviour.