Dev team question: What's the future of Mobiledoc?

I hadn’t realized until I got into playing with the beta editor more last night that posts created with the beta editor don’t return a mobiledoc representation at all when I use the SDK to read them. I’d missed that the new beta editor produces ‘lexical’ and that Ghost is apparently storing that for posts created with the new editor. (I thought I’d seen editing an old post result in new behavior, but I can’t reproduce it. Posts that I create in the old editor seem to remain in mobiledoc format even after opening and editing in the new editor.)

I’m currently building something on top of Ghost that needs mobiledoc.* I’m probably not the only person out there using mobiledoc, either to put content into Ghost or to get it back out.

Is there somewhere I can read about plans for the editor and content representation? If a future release of Ghost is going to remove mobiledoc, it’d be good to have some serious lead time on that.

*Or else it needs html cards in the lexical editor that aren’t self-closing. Or a way to group editor elements together in a div.

2 Likes

Hi Cathy :slight_smile: hope you’re enjoying the new editor beta.

Our editor has been completely rebuilt from the ground up on top of Lexical. The old editor was built on top of Mobiledoc. These two editor frameworks both have their own completely different document formats.

The new editor is currently in Beta, but will become the default in due course. At the moment, the two editors have feature parity and so support for both formats is possible, but this will inevitably be short term as we build on top of the new editor, meaning the Mobiledoc format will be dropped.

I do not have a timeline for when that’s going to happen, but for anything you’re building now, I’d recommend building on top of Lexical. I believe the thing blocking you from building on top of Lexical was fixed and if you encounter any other blockers let us know - we love your bug reports :bug: :heart:

If you’re curious why we’re moving from one to the other, a quick look at the two linked repos should answer most questions!

We will announce the timeline for dropping mobiledoc when we know what it is :nerd_face:

3 Likes

Hi Hannah!

Thanks! It’s helpful to know that Mobiledoc is going away. Time to go figure out how to build a Lexical-formatted post. :slight_smile:

I’m seriously going to have to have a t-shirt printed with that on it.
(I only currently have six bugs open… and only two of the are p2:major. )

Cathy

2 Likes

At the moment, the two editors have feature parity and so support for both formats is possible, but this will inevitably be short term as we build on top of the new editor, meaning the Mobiledoc format will be dropped.

@Hannah – thank you for this reply! Quick question: when you say, "the Mobiledoc format will be dropped", do you mean it’ll be dropped from being an editor? Or do you mean even the Ghost rendering engine will at some point stop supporting Mobiledoc (which would necessitate all Mobiledoc posts actually converted into lexical with some kind of one kind conversion)?

I only ask bc I’m currently in the process of converting all of my lexical posts and pages back into Mobiledoc bc there’s currently a bug that prevents export/import of any lexical content. :slightly_frowning_face:

If you’re curious why we’re moving from one to the other, a quick look at the two linked repos should answer most questions!

I did take a quick look at the repos but could you please elaborate a bit on this? It’s true Mobiledoc appears to no longer be updated but it appears like it’s a mature, opensource product built by Bustle (last updated in Sep 2022; 44 outstanding issues). Lexical OTHO is built by Meta, and currently sports 246 issues. (I know the number of issues isn’t necessarily a proxy for quality but am still just curious.)

Thank you again for helping! :pray:

They are basically the same thing :) Once we no longer use mobiledoc for the editor, we’ll drop support entirely, and yep there’ll need to be a conversion (WIP).

I’d hang fire for a fix. @Cathy_Sarisky was kind enough to raise this issue here and it’s been picked up by our team.

IMO the number of issues on lexical is a positive indicator. Look at any other stat: commits, stars, forks, activity. You’re right that Mobiledoc is mature from Bustle’s - a single publisher that uses it for their internal tooling - perspective, but those open issues represent a set of long-standing core problems for us.

Meanwhile, Lexical drives every editor style field across all of meta’s internal and public tools. It’s used by upwards of 100s of millions of people every day and it only has ~250 open issues :grimacing:

4 Likes

Just stumbled upon this. If this is the case, please update the admin-api : Ghost Admin API Documentation

With the warning note that mobiledoc is eventually going to be deprecated and that lexical shoudl be the way forward. I am building an entire infrastructure around MobileDoc. And I wrote a lot of wrappers for MobileDoc. Now I have to redo that.

I know things change. And I am happy for the long term ghost stability.
But please add warning so that we don’t build things around MobileDoc.

2 Likes

also wondered why the mobiledoc property always was empty. the Admin API docs still don’t mention anything about this new lexical thing. The new editor is now live for all.

1 Like

Hi @Hannah Looks like it’s dropped without any warning or any kind of notification. Even the docs aren’t live yet for the lexical editor.

The whole API just got broken.

1 Like