Post

All I need is a @preactjs.com metaframework with progressive enhancement in mind on Vite and support for modern runtimes (Cloudflare, Node). Astro is good, but I want to go only-jsx!

0 reposts3 likes

```tsx import { App } from "jsr:@fresh/core@2.0.0-alpha.27"; export const app = new App({ root: import.meta.url }); app.get("/", (ctx) => ctx.render(<button>Hello, World!</button>)); await app.listen(); ```

yeah, it's almost a perfect choice, but it seems stale at the moment (no updates), the canary version is unstable, doesn't support Vite, no other deployment platforms besides Deno/Docker, and some APIs should be simplified or deprecated (e.g. <Head> or fresh/runtime utils). looking forward for v2!

Yeah it’s rough around the edges still. I did not use it for production in the end because they had no support for custom error pages/handlers etc. But it’s quite close to “very nice framework”.

actually canary has this feature, works as expected. `/routes/_error.tsx`: export default function ErrorPage(ctx: FreshContext) { const status = (ctx.error as HttpError).status; console.log(ctx.error); if (status === 404) { return <div>Not Found</div>; } return <div>Server Error</div>; }

Honest question: what do you think a metaframework would add? Personally, I'm quite against it -- metaframeworks tend to be massive time commitments and produce sub-standard results as they try to hit way too many use cases. For a lib as flexible & open as Preact, a metaframework would only close

Totally agree. You are actually right about the additional maintenance costs of new additions to frameworks. Since the Vite plugin already exists, the possibilities are open and all I need is SSR support and maybe some sugar for data fetching & <head/> manipulation. Thx for the links! 🫡

Depending on your definition of SSR (there's a million and one variations out there), the Vite plugin does offer prerendering & head manipulation already. Don't have anything to offer yet for data fetching though. Someone was starting to look into islands w/ preset-vite recently too.

This has popped back up in my notifications and I'm realizing the first sentence sounds a bit confrontational which I promise wasn't the intention. Perhaps this is better: "What do you find lacking now that a metaframework could address?"

oh it's fine! I think the ssr story in general (be it ssg/isr/on-demand ssr), zero-js by default (islands architecture) and middleware support. Basically the Fresh framework (from Deno) is very similar to what I need but it lacks support for Vite and other runtimes (Node, Cloudflare).

off valid opportunities and ways to build apps, IMO. I'm a far bigger fan of users owning & growing more comfortable with their tooling, manipulating it to get the most out of their apps. So along those lines, I'd love to write out more demos/examples showcasing ideas & variations to

get users more comfortable really owning their setup. I had hoped to add more examples (and potentially move this to the Preact org), but haven't had time. It's a start though: github.com/rschristian/... That's not to say a metaframework won't ever happen, but the Preact team is tiny with very

github.comGitHub - rschristian/preact-project-demos: Some commonly asked about patterns & examples for building Preact projectsSome commonly asked about patterns & examples for building Preact projects - rschristian/preact-project-demos