Next-Alt Core
A faster, lighter alternative to Next.js with built-in support for server components, edge computing, and static site generation.
Features
- Server Components: Create React components that run on the server
- Edge Computing: Deploy components to edge locations for faster response times
- Static Site Generation (SSG): Generate static pages at build time
- Routing: Simple and flexible routing with Link component
Installation
npm install @next-alt/core
Quick Start
import { createServerComponent } from '@next-alt/core';
const MyServerComponent = createServerComponent(async () => {
const data = await fetchData();
return <div>{data}</div>;
}, {
suspense: true,
errorBoundary: true
});
import { createEdgeComponent } from '@next-alt/core';
const MyEdgeComponent = createEdgeComponent(async ({ request }) => {
const region = request.headers.get('x-vercel-ip-country');
return <div>Hello from {region}!</div>;
}, {
regions: ['iad1', 'sfo1'],
cache: { duration: 3600 }
});
import { withStaticProps } from '@next-alt/core';
const MyStaticPage = withStaticProps(async () => {
return {
props: {
data: await fetchData()
},
revalidate: 60
}
})(({ data }) => <div>{data}</div>);
Documentation
For detailed documentation, visit https://next-alt.dev/docs
License
MIT