Open SachaG opened 1 year ago
Just to confirm, we cannot stick to SVG: https://indieweb.org/The-Open-Graph-protocol#Does_not_support_SVG_images So Vercel Satori is probably useless, unless Nivo charts are using HTML instead of SVG. Edit: but they do use SVG it seems.
Nivo API generates SVG server-side too, but not images. https://nivo.rocks/bar/api/
First step would be to find an alternative to Puppeteer screenshotting, light enough to be usable in a more dynamic fashion (so with requests spread over time, but also with more of them because of the combination of filters). Perhaps JSDOM allows that but I am not sure if it handles SVG either. Or a separate non-JS lightweight application that can render SVG. It's tricky to install stuff on either Render or Vercel though, I had issues with mongodb tooling for exports for instance. You need a full Docker image in this case...
You'll say that I am a tad biased, but I think Next.js is a perfect fit here, as it bring all the API needed to fine-tune the rendering process (eg pre-render some critical chart, configure incremental rendering for the others, make some totally dynamic etc. etc.). Route handlers are tailored to generate non-HTML content like images.
@SachaG anything left here since you finalized this?
Current Setup
results
in every language and take a screenshot using Puppeteer.results
, we generate a stand-alone Gatsby page that contains just that chart.results
site.Issues:
Setup Idea 1 (Better)
A separate API that:
results
site.Splitting this out into a separate API would dramatically speed up the build of the
results
app; and the separate API responses could be dynamically generated instead of statically generated like the Gatsby app.Setup Idea 2 (Best)
A separate API that: