Ghost/ghost/admin/app/services
Kevin Ansfield b286faf011
Initial setup for Lexical multiplayer websockets service (#16611)
no issue

Rough prototype only, current limitations:
- **No persistence**. Docs are in-memory only, YJS state will be lost on server restart although it could be re-populated by clients if they reconnect without closing their local doc (needs testing/investigation)
- **No tie-in with saved lexical state**. Lexical state is updated in the post model via normal API requests from Admin which can mean the multiplayer doc and the saved lexical state become out of sync but there's no detection/indication of that state at present. Will also trigger the "someone else is editing" errors because multiplayer doesn't yet override the default post update collision detection
- **New posts don't start in multiplayer**. New posts don't have an ID and so can't have a respective YJS doc, after initial save we don't transition to multiplayer because the React component in Ember doesn't re-render on prop changes yet
- **No tests**. Experimental code just to get something working and help answer questions for what's next

Changes:
- added `lexicalMultiplayer` labs flag
- updated `<KoenigLexicalEditor>` to pass through the required `<KoenigComposer>` props for multiplayer when enabled
- added `lexical-multiplayer` service
  - `init()` called during boot, used to set up the `enable()` and `disable()` methods so the flag can be toggled without restarts
  - when enabled it adds `upgrade` request handling to the base Ghost server
    - returns 404 if the URL doesn't match `/ghost/api/admin/posts/multiplayer/*`
    - returns 401 if a valid session cookie is not present
    - if everything is good, hands off to code in `y-websocket.js` that handles YJS doc creation, awareness, keepalive, etc
    - uses doc names in the format `${post.id}/${docId}` where `docId` is `main` for the primary document and a GUID for any sub-documents like captions and nested editors in cards
- updated `SettingsBREADService` to check if the `labs` setting is changed, and enables/disables the `lexical-multiplayer` service as needed so the websockets server can be started and shutdown when toggling without requiring a restart
2023-04-12 20:24:02 +01:00
..
ajax.js Wired up click-to-refresh upgrade banner 2023-03-02 18:39:38 +00:00
billing.js Updated <GHBillingIframe> to not leak event listeners 2022-11-07 11:59:14 +00:00
clock.js Dropped ember-cli-moment-shim dependency 2022-09-24 13:28:23 +02:00
config-manager.js Fixed hosting management screen not loading after sign-in process (#15763) 2022-11-03 11:14:36 +00:00
custom-theme-settings.js Dropped ember-concurrency-decorators dependency 2022-02-09 10:49:38 +00:00
custom-views.js Removed need for .get() with settings service 2022-10-07 16:14:57 +01:00
dashboard-mocks.js Refined attribution source modal on dashboard 2022-10-07 15:43:59 +05:30
dashboard-stats.js Removed need for .get() with settings service 2022-10-07 16:14:57 +01:00
data-cache.js Added data-cache service for managing limited-lifetime cached data 2022-01-21 18:15:06 +00:00
dropdown.js Added support for selecting posts 2023-04-05 18:00:08 +02:00
event-bus.js [chore] Ran native classes codemod for app/services (#2240) 2022-02-02 22:11:11 +00:00
explore.js Fixed Explore iframe route handling hijacking routes on reload 2022-10-26 17:17:22 +01:00
feature.js Initial setup for Lexical multiplayer websockets service (#16611) 2023-04-12 20:24:02 +01:00
frontend.js Fixed hosting management screen not loading after sign-in process (#15763) 2022-11-03 11:14:36 +00:00
ghost-paths.js [chore] Ran native classes codemod for app/services (#2240) 2022-02-02 22:11:11 +00:00
lazy-loader.js Collapsed @service injection definitions to single-line style 2022-02-03 19:04:43 +00:00
limit.js Fixed hosting management screen not loading after sign-in process (#15763) 2022-11-03 11:14:36 +00:00
media-queries.js [chore] Ran native classes codemod for app/services (#2240) 2022-02-02 22:11:11 +00:00
member-import-validator.js Added auto-mapping for complimentary_plan column 2022-10-31 16:47:14 +08:00
members-count-cache.js Dropped ember-cli-moment-shim dependency 2022-09-24 13:28:23 +02:00
members-stats.js Merged v5.16.1 into main 2022-09-27 11:21:48 +07:00
members-utils.js Added basic UI to update portal signup term settings 2023-04-04 10:10:06 +02:00
mention-utils.js Fixed broken empty state in mentions admin url (#16419) 2023-03-16 21:19:56 +05:30
migrate.js Change self-service domain 2023-04-11 16:16:48 +01:00
modals.js Fixed modalOptions.ignoreBackdropClick not always being picked up 2022-07-13 16:02:34 +01:00
navigation.js Removed need for .get() with settings service 2022-10-07 16:14:57 +01:00
notifications.js Updated error fallbacks to generic error message 2022-11-23 21:49:40 +00:00
resize-detector.js Migrated <GhUnsplash> to glimmer component 2022-02-07 16:53:12 +00:00
session.js Added visible theme errors in admin (#16081) 2023-01-06 13:44:27 +01:00
settings.js Updated outbound_link_tagging to match members_track_sources (#16322) 2023-02-23 11:33:23 +01:00
slug-generator.js 🐛 Fixed pasting newlines in post titles (#15794) 2022-11-10 14:43:15 +01:00
tenor.js Fixed hosting management screen not loading after sign-in process (#15763) 2022-11-03 11:14:36 +00:00
theme-management.js Highlighted successful in the theme activation modal (#16454) 2023-03-22 15:54:52 +08:00
ui.js Fixed hosting management screen not loading after sign-in process (#15763) 2022-11-03 11:14:36 +00:00
unsplash.js Fixed hosting management screen not loading after sign-in process (#15763) 2022-11-03 11:14:36 +00:00
upgrade-status.js Wired up click-to-refresh upgrade banner 2023-03-02 18:39:38 +00:00
utils.js Added fetchAndDownloadFile method to utils service 2023-04-07 14:44:28 +07:00
whats-new.js Dropped ember-cli-moment-shim dependency 2022-09-24 13:28:23 +02:00