Page MenuHomePhabricator

[Epic] Spike for Vue.js migration for Visual Editor
Closed, ResolvedPublic

Description

This ticket was created based on a meeting between Editing and Design System teams.

Conditions of satisfaction

  • build a list of tangible use cases/scenarios that would land at the intersection of VE and Vue so we can identify technical constraints [Pre-mortem list of scenarios] @ppelberg
  • Create a spike to understand what kinds of things in Visual Editor are easy or hard to work with in terms of Vue Integration. The outcome would be a list of complex use cases outlining feasibility, desirability etc. @dchan

Associated documents

Event Timeline

ppelberg updated the task description. (Show Details)
ppelberg added a subscriber: VPuffetMichel.

Next Steps

Create a spike to understand what kinds of things in Visual Editor are easy or hard to work with in terms of Vue Integration. The outcome would be a list of complex use cases outlining feasibility, desirability etc.

  • @VPuffetMichel is going to file a ticket for to work on the spike described above
ppelberg moved this task from To Triage to Triaged on the VisualEditor board.
ppelberg moved this task from Upcoming to This Fiscal Year on the Editing-team board.
STH renamed this task from [Epic] Vue.js migration for Visual Editor to [Epic] Spike for Vue.js migration for Visual Editor.Apr 25 2022, 5:05 PM
STH changed the task status from Open to In Progress.
STH triaged this task as Medium priority.
STH subscribed.
STH lowered the priority of this task from Medium to Low.May 17 2022, 5:54 PM

@dchan and I have had a few discussions about this. Here's a summary of what we've discussed so far:

  • We should prioritize assessing the feasibility of migrating VE's UI to Vue.js, so that it can use the same Codex components that will be used by other UIs. Migrating the other layers of VE (CE and DM) is much less valuable, so we're not looking at that.
  • Currently, VE is very synchronous, and UI updates often happen synchronously in response to model updates. Vue would introduce asynchronicity here. We want to focus our thinking and our experiments on whether this could cause problems, and how those problems could be avoided.
    • For example, the link context item has an "unlink" button that will remove the link that the selection is in. But what if a click event comes in for that button, and in the meantime the selection has already moved to a different link, or somewhere that isn't a link? How do we detect this case?
      • (Note that the existing implementation in ve.ui.LinearContext already updates context items asynchronously in response to selection changes, so to some extent this is already a theoretical possibility that we don't protect against in the existing OOUI-based code.)
  • For now, we think a promising architecture would be to introduce a "glue" layer that sits between the DM/CE and the Vue UI, receiving updates from the DM/CE through synchronous event handlers and updating Vue refs that represent certain aspects of the state of the DM/CE. These refs are updated synchronously, but the Vue UI reacts to those updates asynchronously. This makes the "glue" layer a sort of buffer zone between the synchronous world of DM/CE and the asynchronous world of the Vue UI.
    • This glue layer could be implemented as a Vuex store or a Pinia store. But for simplicity, we think that our proof of concept prototypes should not use a store, but a loose collection of refs and computed refs.
  • We think we should start by prototyping Vue implementations of two VE UI components:
    • The toolbar: T308713
    • The link context item (plus, optionally, the link inspector): T308714
STH raised the priority of this task from Low to Medium.May 19 2022, 2:42 PM
ldelench_wmf changed the task status from In Progress to Stalled.Aug 12 2022, 1:38 PM

Closing this as "done for now". There is more work we could do here (e.g. the link context item proof of concept, which we never ended up doing), but we're not planning to work on this in the near/medium term. If we decide to do more work in this area in the future, we can reopen this task then.