Skip to content

Vue 3 Migration#139

Merged
luxaritas merged 133 commits into
eternagame:devfrom
MarkH817:feature/vue-3-migration
May 8, 2026
Merged

Vue 3 Migration#139
luxaritas merged 133 commits into
eternagame:devfrom
MarkH817:feature/vue-3-migration

Conversation

@MarkH817
Copy link
Copy Markdown

@MarkH817 MarkH817 commented Mar 10, 2026

Summary

  • Architecture rework
    • Migrate to Vue 3
    • Replace Vue class components to Composition API with <script setup> syntax
    • Keeping as much chat logic in Pinia stores or utility functions as possible
    • Replace Vuex with Pinia
      • Breakdown chat.vuex.ts logic into separate stores (and preventing circular dependencies)
      • irc.store.ts manages client connection and exposes client to other stores only after the client has been registered
      • channel.store.ts manages channel list and chat history
      • chat.store.ts handles chat inputs and calling slash-commands
    • Swap to bootstrap-vue-next for Vue 3 compatibility
    • Add @vueuse/core to handle browser/DOM API interactions
    • Move slash-command logic to a registry pattern (some commands still are in development)
    • Replace deprecated / abandoned libraries
    • Update Browsers List target to defaults
  • Tool changes
    • Add Oxlint and Oxfmt
    • Add Vite
    • Add Vitest for component and utility unit test capability
    • Add lint-staged / husky pre-commit hook
  • Vite related plugins/presets
    • vite-plugin-node-polyfills to allow irc-framework usage
    • postcss-preset-env to convert modern CSS syntax for targeted browsers
    • vite-plugin-babel to add JS polyfills to the build as needed
  • Update irc-framework type definitions for more events/features used
    • Adding tags parameter since Ergo supports message-tags
      • Timestamp
      • Message ID
      • Label
      • Batch
      • Client tags
    • Using reconnection logic already provided by the library
    • Adding other events and updating as needed
  • Adds build:wc script to export as a web component <eterna-chat>
    • Takes username and uid as attributes to initialize the chat client

- Gracefully handle cases when chat user is anonymous or fetch has failed
- Update `getUserInfo()` and `getPuzzleInfo()` to use `fetch()`
- Add default avatar image
- Add native import subpath to `#store` to future-proof path aliases
- Reference exported chat/settings store proxy in Composition API components
- Add ts-expect-error messages around type conflicts in Vue 2 for SFC Composition API
- Replace id attributes with class style identifier
- Will need to refactor to decouple it from App.vue
- Swap type from enum to string union
- Fix interactions with this component to use the correct type
- Swapped invalid uses of <li> with <div>
- Added note to remove `vxm.chat.tabbing` since `:focus-visible` is available in CSS for this scenario
- Adjusted NotificationSection component to check if a channel reference is defined before interacting
- Replace use of id/<li> with class/<div> respectively
- Previously was forcing at least 1 keyword to exist
- Removes $refs and $parent interactions between color picker and sliders
- Convert to Composition API
- Reference new Settings store
- Update/retrieve markdown button setting with `useLocalStorage()`
- Remove Vue libraries not available in Vue 2
- Remove irrelevant test files
- Add Bootstrap Vue Next
- Remove Babel configuration
- Add new entry App.vue
- Updated to ESLint 9
- Move lint-staged from package.json to file
- Update irc-framework websocket type definition
- Store static/constant values under `src/constants` directory
- Add `src/models` directory and use `interface`/`type` instead of `class`/`enum`
- Move more settings previously from Chat Vuex store to settings or other stores
- Created irc store to solely hold irc client, login actions, and connection status
- Add `src/utils` for holding logic independent from Vue rendering
- Restore `stream-browserify` aliasing needed for `irc-framework`
- Add `vite-plugin-node-polyfills` for `irc-framework` since it uses Node-only modules
  - Was previously handled automatically by `webpack`
- Updated env variable names
- Switch User model nicks from `string[]` to `Set<string>`
- Share connection status and reconnection info from IRC client
- Allows renderer to parse blockquotes, rather than use RegEx plugin
- Future-proofing whenever multi-line messages are implemented
- Displays available commands or command details
Copy link
Copy Markdown
Member

@luxaritas luxaritas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of really great work here. Mostly just have relatively minor nitpicks/issues I caught, and some questions for clarification. (nit --> nitpick, quickfix --> proposal for a super minor change, fyi/thanks --> just a note)

Comment thread eslint.config.ts Outdated
Comment thread src/components/LoginForm.vue
Comment thread src/components/LoginForm.vue Outdated
Comment thread src/components/ui/LoadingSpinner.vue Outdated
Comment thread src/components/ui/MinimizationTriangle.vue Outdated
Comment thread src/components/sidebar/SidebarMenu.vue Outdated
Comment thread src/components/connection/ConnectingMessage.vue Outdated
Comment thread src/components/layout/header/StarButton.vue
Comment thread src/commands/handlers/operator.ts Outdated
Comment thread src/commands/handlers/operator.ts
@MarkH817 MarkH817 marked this pull request as draft April 27, 2026 19:09
- Only require #general chat in default list
- The #test channel will only be shown in development mode
- Removing both settings input and slash-command for creating arbitrary channels
Comment thread src/components/message/MessageContent.vue
Comment thread src/components/ChatApp.vue Outdated
})
.use(markdownItRegex, {
name: 'tag-user',
regex: TAG_USER_REGEX,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Future: We may want to update this to attach some sort of client tag or something when sending the message which is tied to the user ID, filled out by selecting the user from a dropdown (we have such a dropdown elsewhere on the site). This way we could handle offline users as well as avoiding potential ambiguity with special characters in usernames (especially if two users have the same name just with different special characters, which is theoretically possible)

MarkH817 added 10 commits April 28, 2026 16:08
- Move definition files for irc-framework and markdown-it-underline to `type` directory
- Remove unused files/features
- Limits channels to join for users
- Allows operators to use ban, mute, etc. on the limited set of channels
- Update ban-related commands to use SAMODE
  - Allows operators to act on channels without needing to join them
- Temporarily join channel to perform KICK/NOTICE
- Rather than grouping messages in bundles, find the positions where senders change
- Remove intermediary group message component
- Prevents multiple tabs from sending duplicate browser notifications
- Throttles consecutive notifications per channel to once per 15 seconds
- Prevents other unfocused tabs from sending notification if there's an active tab reading the channel currently
@MarkH817 MarkH817 marked this pull request as ready for review May 4, 2026 13:44
MarkH817 added 2 commits May 5, 2026 16:46
- Add `build:wc` script and entry file for creating the `<eterna-chat>` web component
- Swaps Vite's legacy plugin with `vite-plugin-babel`
  - The legacy plugin doesn't work in library mode
- Adjusts Bootstrap to work within the Shadow DOM
Copy link
Copy Markdown
Member

@luxaritas luxaritas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 This looks great, really excited for this to land. Will be working on getting this integrated into the other codebases!

@luxaritas luxaritas merged commit 61e7e1b into eternagame:dev May 8, 2026
1 check passed
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.

2 participants