-
Notifications
You must be signed in to change notification settings - Fork 194
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
Scratchblocks SSR #402
Comments
Can't it be rendered client-side? |
I want it to be rendered server-side so its less work for the client |
Syntax parsing can be done on the server (and there is a unittest for that). Rendering, on the other hand, requires client:
If that one gets fixed in some way, this can be rendered server-side. Until then, it's time to use puppeteer. (Luckily, the setup is already there.) |
Usage of
|
Somehow s3blocks do this? |
@FunctionalMetatable This requires |
@tjvr There are three ways for this:
|
I'm not sure what you mean by (2) -- how would this be different to using the library currently? I think rendering to PNG would probably be the only sensible way to achieve "server-side rendering", if you really want to. |
I have recently decided to set up something like this myself, so that people may more easily embed blocks on GitHub and Discord (and other places) which do not support the plugin! There is also proof-of-concept support for PNG output support, but it does not have text until thx/resvg-js#217 is merged. To use, just percent‐encode the program and put it into the URL’s query part (line breaks can be encoded as (Hmm, now that I think about it, maybe I should set up some way to control the size of the blocks.) |
I'm making a tutorials site (using svelte and sveltekit) and it seems that scratchblocks only can run in the browser.
Is there anyway to support SSR/svg strings?
The text was updated successfully, but these errors were encountered: