Skip to content

Refactor websocket system to Yjs - #301

Merged
snide merged 58 commits into
mainfrom
ws_rewrite
Jun 22, 2025
Merged

Refactor websocket system to Yjs#301
snide merged 58 commits into
mainfrom
ws_rewrite

Conversation

@snide

@snide snide commented Jun 20, 2025

Copy link
Copy Markdown
Contributor

So many things:

  • Rewrites the websocket layer to use y.js. This provides:
    • A TS document layer
    • The ability to handle conflicts in editing
    • Editors across tabs now stay in sync
  • Moved the active scene to the party level, and changes the playfield route to /[party-name]/play
  • The save system isn't so eager now. It must be explicitely called rather than reacting to stageProps
  • Images now store a version parameter with their location ?v=1. This avoids the cache busting I was doing before with timestamps and should prevent a lot of flashes when data hydrates.
  • The scene list is now delivered across the y.js layer. This means that changes to the scene order or content (including thumbnail generation) will update across editors.
  • There are now proper safeguards for removing or reordering scenes when it is the one you have selected.
  • There are new checks for the websocket layer to check against consistancy vs. the database. These fire intermittedly but also when you on focus inactive editors.
  • Removed all stageProps binding in favor of direct functions to update state.
  • Added a selector for game sessions in the layout.
  • Made the import and duplicate scene systems more robust to match the new versioning system
  • Adds a documentation folder at /docs which can store some architecture docs
  • The scene list now properly handles time when you change the order of the currently selected file.
  • Added devLog functions to only broadcast console logs in dev mode.

Bugs to fix:

  • Need to generate a thumbnail for newly created scenes. This likely needs to generate images that are based off the example, or the uploaded image and then give it a proper location with a version
  • Need some code cleanup

@github-actions

github-actions Bot commented Jun 20, 2025

Copy link
Copy Markdown
Contributor

Fly Preview Deployments - Completed ✅

@snide
snide merged commit b6adb55 into main Jun 22, 2025
@snide
snide deleted the ws_rewrite branch June 22, 2025 16:49
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