u/peaceewalkeer

▲ 1 r/npm+1 crossposts

snappy-prerender: react-snap is unmaintained, so I built a modern replacement for SPAs

I maintain multiple legacy React apps - CRA, React 18, client-side routing, content from a CMS / Wordpress REST API. But SEO and OG tags need real HTML, and a client-side app hands them an empty page.

react-snap solved that for years. It has been unmaintained since 2019 and breaks a little more with every browser update. I could not find a drop in replacement so I built one. It has been running on my own site for a while, and now I am putting it out there: snappy-prerender.

What it does, in one sentence: it opens every page of your built app in a real browser at build time and saves the result as plain HTML, so crawlers see the page your users see.

npm
 install --save-dev snappy-prerender@next
npx snappy-prerender init      # a few questions, then a config file
npx snappy-prerender build     # or run it from vite build

No server, no rewrite, no changes to how the app works.

Things I added because I needed them

  • It checks every page after the build and tells you whether the app's JavaScript picked up the prerendered HTML or threw it away and redrew everything. That report is the part I use most.
  • It writes the page title, description, canonical link and Open Graph/Twitter tags for each route, including when the user navigates around the site, so you do not need react-helmet for that.
  • It handles the fiddly things that usually break prerendering: styles injected by CSS-in-JS, form state, data fetched from an API, critical CSS, preload hints.
  • It works with a strict Content Security Policy if your project needs one.

What it is not

  • Not server-side rendering. It runs at build time, so new content means a new build.
  • Not for Next.js, Remix or Astro users; those already render HTML on the server.
  • It cannot fix an app that renders differently every time (dates, random values, viewport-dependent layout). It does tell you which page has the problem.
  • It is a release candidate: 2.6.0-rc.2 is on npm under the next tag while I gather feedback.

Links

Looking forward to criticism, bug-reports and feature-requests and revival requests for unmaintained plugins (react and family only)

reddit.com
u/peaceewalkeer — 11 days ago

adsense approval process stuck on "Review Requested" for 5+ weeks, multiple times

https://bedouinmind.com/

This is a website that I have developed for a client. The website has been updated for about 3+ years now. The client has recently requested adsense integration so that they can earn from the website traffic. I have applied on their behalf 3 times now. Twice using the Google site kit for wordpress plugin and now by integrating the details directly on the website.

I am not getting a rejection or approval. It gets stuck on getting review requested. I have added the ads.txt, metatag and code snippet. But website is still stuck on review.

This is a low traffic website. But I generally get a approved or rejected for the other websites that I have integrated adsense on. This website seems to be hung on the review stage. The theme is pure PHP, no page builders or such. Yeost free is being used for SEO. No blockers on the robots, website and all pages including ads.txt has already been crawled by and available on Google index.

I am stumped. Any help would be much appreciated. Thank you.

u/peaceewalkeer — 5 months ago