-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Investigate replacing puppeteer with smaller alternative #148
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@jongold we're testing a few approaches right now! Check out the latest pulls https://github.com/vercel/og-image/pulls |
You can also give node-canvas a try |
I've put together a table, plus there's a Wiki test suite with more detailed edge cases for further comparison: https://commons.wikimedia.org/wiki/User:JoKalliauer/SVG_test_suites/resvg_Issues_details
resvg(resvg-js) and librsvg(sharp) each have their own strengths, with librsvg being a bit faster with new features and bug fixes after migrating to Rust, but no crate has been released yet. resvg-js can easily achieve dual-engine rendering in the future, thanks to napi-rs's good architecture, to complement each other. |
hi, you can use miniblink: https://github.com/weolar/miniblink49 |
We decided that embedding a browser is not a sustainable solution. So we built an alternative solution to convert HTML/CSS to PNG. Check out https://vercel.com/blog/introducing-vercel-og-image-generation-fast-dynamic-social-card-images |
We are bumping up against the 50MB limit when upgrading dependencies since chromium continues to get larger.
This was discovered in a PR that was bumping dependencies: #147
We could try using a different tool to reduce the size.
HTML => PNG
The developer authors HTML and we convert to PNG with a browser, for example:
puppeteer-core
+chrome-aws-lambda
is approximately 55MB (and growing)playwright-core
+playwright-aws-lambda
is approximately 52MB (and growing)wkhtmltoimage
is approximately 45MB, see how do I use AWS LambdaSVG => PNG
The developer authors SVG and we convert to PNG with a library, for example:
sharp
is approximately 20MBsharp
svg => png #181@resvg/resvg-js
is approximately 3MBresvg-js
#183@napi-rs/canvas
is approximately 19MB demo@napi-rs/canvas
#182The text was updated successfully, but these errors were encountered: