Adrian Faciu
Principal software engineer. Focused on front-end. Learning something new each day. Building things at WeVideo.
React
Vue
Angular
Backbone
Ember
Svelte
Source: https://www.blog.duomly.com/client-side-rendering-vs-server-side-rendering-vs-prerendering/
Gatsby
Hugo
Jekyll
Astro
Hexo
Source: https://www.cosmicjs.com/blog/static-site-generators-explained-in-5-minutes
React (Server Components)
SvelteKit
NextJs
Nuxt
Angular Universal
Source: https://www.blog.duomly.com/client-side-rendering-vs-server-side-rendering-vs-prerendering/
Source: https://web.dev/rendering-on-the-web/
import { json } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
export const loader = async () => {
return json({
posts: [
{
slug: "my-first-post",
title: "My First Post",
},
{
slug: "90s-mixtape",
title: "A Mixtape I Made Just For You",
},
],
});
};
export default function Posts() {
const { posts } = useLoaderData();
console.log(posts);
return (
<main>
<h1>Posts</h1>
</main>
);
}
import { json } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
export const loader = async () => {
return json(db.getPosts());
};
export default function Posts() {
const { posts } = useLoaderData();
return (
<main>
<h1>Posts</h1>
<ul>
{posts.map(post => (<li>{post.title}</li>)}
</ul>
</main>
);
}
import { json } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
export const loader = async () => {
return json(db.getPosts());
};
export default function Posts() {
const { posts } = useLoaderData();
return (
<main>
<h1>Posts</h1>
<ul>
{posts.map(post => (<li>{post.title}</li>)}
<ul>
</main>
);
}
export default function NewInvoice() {
return (
<Form method="post">
<input type="text" name="company" />
<input type="text" name="amount" />
<button type="submit">Create</button>
</Form>
);
}
export async function action({ request }) {
const body = await request.formData();
const invoice = await createInvoice(body);
return redirect(`/invoices/${invoice.id}`);
}
export default function NewInvoice() {
const transition = useTransition();
return (
<Form method="post">
<input type="text" name="company" />
<input type="text" name="amount" />
<button type="submit">
{transition.state === "submitting"
? "Creating invoice..."
: "Create invoice"}
</button>
</Form>
);
}
export default function NewInvoice() {
const { submission } = useTransition();
return submission ? (
<Invoice
invoice={Object.fromEntries(
submission.formData
)}
/>
) : (
<Form method="post">
<input type="text" name="company" />
<input type="text" name="amount" />
<button type="submit">
Create invoice
</button>
}
export default function InvoiceRoute() {
const invoice = useLoaderData();
return <Invoice data={invoice} />;
}
export function ErrorBoundary({ error }) {
console.error(error);
return (
<div>
<h2>Oh snap!</h2>
<p>
There was a problem loading this invoice
</p>
</div>)
}
import { Links } from "@remix-run/react";
export function links() {
return [
{
rel: "stylesheet",
href: "https://unpkg.com/modern-css-reset@1.4.0/dist/reset.min.css",
},
];
}
export default function Root() {
return (
<html>
<head>
<Links />
{/* ... */}
</head>
{/* ... */}
</html>
);
}
By Adrian Faciu
Principal software engineer. Focused on front-end. Learning something new each day. Building things at WeVideo.