No it didn’t work with React Native because it uses a bunch of browser APIs to measure the content size, but I hope someone will build an alternative for RN!
HN user
shuding
twitter.com/shuding_
Thanks for the feedback. In the future we will be focusing on closing that gap. Some research is still going on and with Next.js 13's server components and server-side data fetching primitives, I believe there will be a great experience to use SWR and Next.js to have all the scenarios covered.
We answered that in the blog post: https://swr.vercel.app/blog/swr-v2#the-future--thank-you
With the new release of Next.js 13, we see a lot of exciting new things as well as paradigm shifts in the React ecosystem: React Server Components, streaming SSR, async components, and the use hook. Many of them are related to data-fetching, and some of them have overlapping use cases with SWR. However, the goal of the SWR project remains the same. We want it to be a drop-in library that is lightweight, framework agnostic, and a little bit opinionated (i.e. revalidate upon focus). Instead of trying to be a standard solution, we want to focus on innovations that make the UX better. In the meantime, we are also doing research on how to improve SWR with these new abilities of React.
There are already a lot of choices to convert SVGs to PNGs, what Vercel uses is https://github.com/yisibl/resvg-js. And Sharp is another good option.
It does not rely on a browser. Satori itself includes a CSS parser/normalizer, a flexbox layout engine, a text layout engine and a SVG renderer.
JSX here is just a way to represent the HTML information because you can't write HTML in JavaScript. It is NOT required. But with the JSX representation, the lib doesn't have to parse it again, and it's using it as JSON, check the "Use without JSX" section in the docs: https://github.com/vercel/satori#use-without-jsx
Advanced text shaping isn’t implemented yet, where we plan to use Harfbuzz in the future.
No, Satori does not guarantee that the SVG will 100% match the browser-rendered HTML output. That's because Satori implements its own layout engine based on the SVG 1.1 spec. However, Satori generated result (SVG) is stable on all browsers.
No, these will not be going away in the near future as far as we can see. React 18 / RSC are still in alpha or experimental stage, and what we shared are just new ways to do data fetching that we are currently exploring.
In fact, component-level data fetching doesn’t conflict with top-level data fetching like gSP and gSSP. Today you can already use gSSP with Suspense-based data fetching together with Next.js 12. It’s just that you normally don’t need to use both, doesn’t mean you can’t :)
Is this using WebContainers? Or is it just very similar?
No, it’s not using WebContainers. It’s a native ES module based Next.js dev server that works inside the browser.
Wow great work tga, love it!!
Hey! SWR author here. Mind sharing the annoyances and how I can make it better for you?