Skip to content

feat: server-side processing #451

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

Merged
merged 27 commits into from
Jul 15, 2024
Merged

feat: server-side processing #451

merged 27 commits into from
Jul 15, 2024

Conversation

YousefED
Copy link
Collaborator

@YousefED YousefED commented Dec 4, 2023

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.

All related issues have been tagged "server": server

TODO
The current state is a PoC, there are several important todos to implement / figure out:

closes #720
closes #521
closes #387
closes #311

The extraction of elementRenderer and useImperativeHandle also closes the following issues:
closes #750
closes #732
closes #832

Copy link

vercel bot commented Dec 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Jul 15, 2024 10:21am
blocknote-website ✅ Ready (Inspect) Visit Preview Jul 15, 2024 10:21am

@YousefED YousefED changed the title wip: Feature/server-util wip: feature: server-side processing Dec 4, 2023
@nikkimontoya
Copy link

@YousefED Hi! Could you please tell me when you plan to deliver this feature? It would be very useful for me :-)

@Jakisundays
Copy link

@YousefED Hello! 🌟 I'm eagerly looking forward to using this. Could you please complete it? Your work is much appreciated! 🚀

@YousefED
Copy link
Collaborator Author

Hi @nikkimontoya @Jakisundays!

Atm we're prioritizing some work for our sponsors and I currently don't require this feature myself - so even though I'd love to, it will be a while before we can dig into this. You can consider sponsoring or opening a bounty to encourage community members to step in

Copy link

algora-pbc bot commented May 13, 2024

💎 $25 bounty • odufuwas

Steps to solve:

  1. Start working: Comment /attempt #451 with your implementation plan
  2. Submit work: Create a pull request including /claim #451 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to TypeCellOS/BlockNote!

Add a bountyShare on socials

@m-risto
Copy link
Contributor

m-risto commented May 22, 2024

Hi @YousefED,

this is also something which is required, so that we can use BlockNote.

@YousefED
Copy link
Collaborator Author

Hi @YousefED,

this is also something which is required, so that we can use BlockNote.

Hi @m-risto! Thanks and thanks for your sponsorship. Would love to hear more about your exact requirements before we continue working on this. Mind specifying more here, or reaching out on Discord / X / email ([email protected])?

@m-risto
Copy link
Contributor

m-risto commented May 22, 2024

Hi @YousefED

i will write it down tomorrow, if i have a some free time.

The short version is we want to create a pdf server side with puppeteer and that's why we need the html extract.

But i will write you more via discord.

@YousefED YousefED added the server label Jun 7, 2024
Copy link
Collaborator

@matthewlipski matthewlipski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, just a few things that need changing in the docs but rest looks good

@YousefED YousefED merged commit 762b569 into main Jul 15, 2024
4 checks passed
@lawrencenika
Copy link

Thanks team for the hardwork, I tried but cant seem to install it from npm.

% npm install @blocknote/server-util
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@blocknote%2fserver-util - Not found
npm ERR! 404
npm ERR! 404 '@blocknote/server-util@*' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in: /Users/xxx/.npm/_logs/2024-07-15T15_38_08_817Z-debug-0.log

@matthewlipski
Copy link
Collaborator

We accidentally left server-util private when deploying 0.15.0😅 - fixed with 0.15.1, should be on NPM now

@lawrencenika
Copy link

just tried to create editor on partykit server, but errored out immediately for not able to resolve the following packages: fs, net, http, https, url, zlib, os, child_process, perf_hooks, and tls. So, would this new package @blocknote/server-util only be able to run in environment like Node.js that have all those packages built-in?

@soranoo
Copy link

soranoo commented Jul 17, 2024

image
image

Im running it on Nextjs server action and the above error pops up when I import the package from server action.

@YousefED
Copy link
Collaborator Author

Opened #942 for @soranoo and @lawrencenika

@lawrencenika
Copy link

thanks @YousefED , I was told that Partykit uses javacript env by CF called Workerd. Even though it supports TypeScript, thousands of modules from the npm registry, and WebAssembly modules, it seems to not have access to the full node runtime. Only a small subset of npm packages are available on Partykit server. You can read more about it here https://edge-runtime.vercel.app/
https://nextjs.org/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment