Skip to content
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

v8 #2

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

v8 #2

wants to merge 3 commits into from

Conversation

mastondzn
Copy link
Owner

@mastondzn mastondzn commented Mar 5, 2025

  • 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.

this is technically a breaking change because the exposed ClientState enum is now a readonly array
Copy link

github-actions bot commented Mar 5, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 77.55% 2546 / 3283
🔵 Statements 77.55% 2546 / 3283
🔵 Functions 84.95% 288 / 339
🔵 Branches 91.64% 625 / 682
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/client/base-client.ts 96.72% 100% 92.85% 96.72% 21-22
src/client/interface.ts 100% 100% 100% 100%
src/message/parser/missing-tag-error.ts 100% 100% 100% 100%
Generated in workflow #47 for commit 6330947 by the Vitest Coverage Report Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant