Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to sending JSON rather than Markdown to client #3000

Closed
tommoor opened this issue Jan 25, 2022 · 6 comments · Fixed by #5553
Closed

Move to sending JSON rather than Markdown to client #3000

tommoor opened this issue Jan 25, 2022 · 6 comments · Fixed by #5553
Assignees
Labels
chore Someone's gotta do it pinned Will not be closed by stale bot techdebt

Comments

@tommoor
Copy link
Member

tommoor commented Jan 25, 2022

Problem

Currently when you request documents from the server we send a Markdown representation to the client which is rendered immediately. For collaborative editing we also render this while waiting for the collaborative connection to start to make the document appear faster.

This worked well up until now as every type of node could be serialized to Markdown in a reversible fashion – going forward this restriction should be removed so we can have items in the doc that cannot be represented in Markdown. For example fancy new node types, file attachments, comments etc.

Solution

Markdown will be used as an import/export type and markdown shortcuts will continue to work in the editor as today, however it will not be used to render in the app and may not be sent from the server at all unless requested explicitly for a download.

To migrate we'll need to convert all the existing docs in the database and store the JSON representation alongside the markdown.

@tommoor tommoor added chore Someone's gotta do it techdebt labels Jan 25, 2022
@therajumandapati
Copy link

@tommoor Do you have any ideas in mind for coming up with a JSON structure for transforming markdown?

@tommoor
Copy link
Member Author

tommoor commented Mar 1, 2022

The format already exists, it's what the Markdown gets parsed into. It also exists inside the CRDT in the database which contains the collaborative state of any given document… eg.

import { parser } from "@server/editor"
const json = parser.parse(markdown)

tommoor referenced this issue Mar 23, 2022
fix: Attachments broken when using non-collab and AWS bucket on the same host
(#3274)
@github-actions

This comment was marked as outdated.

@github-actions github-actions bot added the stale label Jun 30, 2022
@github-actions

This comment was marked as outdated.

@tommoor
Copy link
Member Author

tommoor commented Jul 4, 2023

Work has begun on this, now that collaborative editing is the only editing option it makes things easier. Some features that this potentially unlocks:

  • Different highlighting colors
  • Resizing tables/rows/columns, more content support in table cells
  • Multi-column layouts
  • Arbitrary embed support, resizing embeds
  • Rendering performance gains

@almereyda
Copy link

🙏🏽

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Someone's gotta do it pinned Will not be closed by stale bot techdebt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants