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
feat(renderer): renderer package #595
base: main
Are you sure you want to change the base?
feat(renderer): renderer package #595
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the renderer
package provides its own editor, I think we can get away without modifying vite-plugin
. Simply change renderer.html
to editor.html
and from main.ts
export an editor
function instead of render
. Puppeteer can then simply visit /projectName
.
root: Root, | ||
configFile: path.resolve(Root, '../vite.config.ts'), | ||
server: { | ||
port: 9000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this port number be configurable?
Not exactly sure if this is related, but I noticed that running npm run serve
offers the following convenience: will start on port 9000
, and if it's not available, use the next available e.g. 9001
.
Perhaps the port number here could follow a similar approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choosing the next available port is a Vite functionality. It will do it automatically.
Tho it may be a good idea to actually check what port Vite picked using:
server.httpServer.address().port
and redirect Puppeteer there.
Right now we're using a hardcoded 9000
which will work most of the time but will fail if something is already running on 9000
.
since this library is rendering to a canvas surface, is it not possible to just dump every frame to a file and then use something like ffmpeg to generate a video? |
@dcsan This is a draft for #415 which aims to give people the ability to
We already have an ffmpeg exporter (It even comes preinstalled by default when bootstrapping a new project) |
PR for the renderer package to headlessly render projects.
Thought I would make a PR for this to get some feedback and make sure I've not been barking up the wrong tree 😅
I thought it would be a better idea to make the changes to the create package in a different PR.
Also, not sure how package deployments work in lerna but happy to update after feedback 👍
Changes:
Closes #415