wip: feature: server-side processing #451
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This introduces a
server-util
package which can be used to interact with BlockNote without instantiating an entire editor. For example, it can be used to render HTML from BlockNote blocks in JSON format (or from a YDoc) for server-side rendering. Or, for server-side conversion to markdown for server-side search indexing.TODO
The current state is a PoC, there are several important todos to figure out:
document
. If we don't want this, we either need a more lightweight polyfill, or replace ourdocument.createElement
related calls with something else. Or for example, use React / JSX for built-in nodes as well, as React supports server-side rendering without a dependency ondocument
toExternalHTML
,toInternalHTML
) currently expect aneditor
parameter. Is this useful / desired? Currently we fake an editor by passingeditorContext
instead@blocknote/core
package (and if you'd use a react custom block, it would pull in all of@blocknote/react
). Perhaps we can organize our package structure to be more lightweightcloses #387
closes #311