• This repository has been archived on 28/Dec/2023
  • Stars
    star
    388
  • Rank 110,734 (Top 3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 3 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The Next.js like React framework for better User & Developer experience!

Vitext โšก๐Ÿš€

Discord

The Next.js like React framework for better User & Developer experience

  • ๐Ÿ’ก Instant Server Start
  • ๐Ÿ’ฅ Suspense support
  • โšซ Next.js like API
  • ๐Ÿ“ฆ Optimized Build
  • ๐Ÿ’Ž Build & Export on fly
  • ๐Ÿš€ Lightning SSG/SSR
  • โšก Fast HMR
  • ๐Ÿ”‘ Vite & Rollup Compatible
intro.mp4
npm install vitext

Vitext (Vite + Next) is a lightning fast SSG/SSR tool that lets you develop better and quicker front-end apps. It consists of these major parts:

๐Ÿ’ก Instant Server Start

The development server uses native ES modules, So you're going to have your React app server-rendered and client rendered very fast, under a half a second for me.

๐Ÿ’ฅ Suspense support

Vitext supports React Suspense & Lazy out of the box.

import { lazy, Suspense } from 'react';

const Component = lazy(() => import('../components/Component'));
const Loading = () => <p>Loading the Component</p>;

const App = () => {
  return (
    <Suspense fallback={<Loading />}>
	  <Component />
    </Suspense>
  );
};

โšซ Next.js like API

If you're coming from a Next.js background, everything will work the same way for you. Vitext has a similar API design to Next.js.

// pages/Page/[id].jsx
const Page = ({ id }) => {
  return <div>{id}</div>;
};

// build time + request time (SSG/SSR/ISR)
export function getProps({ req, res, query, params }) {
  // props for `Page` component
  return { props: { id: params.id } };
}

// build time (SSG)
export async function getPaths() {
  // an array of { params: ... }, which every `params` goes to `getProps`  
  return {
    paths: [{ id: 1 }],
  };
}

export default IndexPage;

getPaths & getProps are optional. If getPaths' running got done, then every paths item is going to be passed to a getProps function, And when the user requests for the specific page, they're going to receive the exported html (SSG). But if getPaths wasn't done or there's no exported html page for the user's request, then the getProps is going to get called with the request url's params (SSR).

๐Ÿ“ฆ Optimized Build

Vitext uses Vite's building and bundling approach, So it bundles your code in a fast and optimized way.

๐Ÿ’Ž Build & Export on fly

You don't need to wait for HTML exports of your app because Vitext exports pages to HTML simultaneously while serving your app, So no next export.

๐Ÿš€ Lightning SSR/SSG

ES modules, Fast compiles and Web workers empower the Vitext SSR/SSG strategy, so you'll have an astonishingly fast SSR/SSG.

โšก Fast HMR

Vitext uses @vitejs/plugin-react-refresh under the hood, So you have a fast HMR right here.

๐Ÿ”‘ Vite & Rollup Compatible

We can call Vitext a superset of Vite; It means that Vitext supports everything Vite supports with vitext.config.js.

// exact Vite's config API 
export default {
  plugins: [...],
  optimizeDeps: {...},
  ...
};

Examples

You can checkout packages/examples directory to see examples that have been implemented using vitext.

Contribution

We're in the early stages now, So we need your help on Vitext; please try things out, recommend new features, and issue stuff. You can also check out the issues to see if you can work on some.

License

MIT

More Repositories

1

vite-plugin-cloudflare

๐Ÿ”ฅ Easier and better experience writing Cloudflare workers in Vite
TypeScript
270
star
2

venode

๐Ÿข๐Ÿฆ• The missing child of Node.js and Deno.
TypeScript
177
star
3

contextism

๐Ÿ˜ Use React Context better.
TypeScript
142
star
4

react-worker-components-plugin

โšก Something like react server components, but web workers instead of a server
TypeScript
102
star
5

modern-node-polyfills

modern polyfills for node native modules based on jspm-core
TypeScript
39
star
6

deconf

One config to rule them all.
Go
28
star
7

Xmoji

An emoji picker for your OS. Be happy with :)
TypeScript
25
star
8

qwik-pwa-example

Please head over to https://github.com/qwikdev/pwa
TypeScript
17
star
9

Did

A node.js script for changing the wallpaper about your favorite topics.
JavaScript
9
star
10

Cheatsheets

My own fun cheatsheets๐Ÿž
8
star
11

Aslemammad

8
star
12

Aloodak-GUI

GUI version of Aloodak
CSS
7
star
13

rock-todo-list

Next generation is telefunc. Not anything else ๐Ÿ˜Ž
TypeScript
7
star
14

dotfiles

Shell
5
star
15

hangman

simple game for mastering svg animations. Test state.
TypeScript
4
star
16

simple-shop-api

JavaScript
4
star
17

Bitcoin-Warner

Java
3
star
18

XController

Some additionals for xbox controller in Gnu/linux
TypeScript
3
star
19

Aloodak-RN

3
star
20

react-router-hook

Combine hooks with React-Router. ๐Ÿ˜
TypeScript
2
star
21

simple-shop-front

frontend of simple-shop-api
TypeScript
2
star
22

simple-react-bootstrap

Simple uncomplete react bootstrap project (pizza order page)
JavaScript
2
star
23

Jpg-to-png

read the down
Java
2
star
24

leetcode

JavaScript
2
star
25

simpleChart

solve quera.ir challenge
JavaScript
2
star
26

PingS

A game with scratch
2
star
27

fanavard-1399-test

JavaScript
2
star
28

googlehacked.github.io

HTML
1
star
29

Happy-Programmers-Day

Java
1
star
30

static

TypeScript
1
star
31

vite-plugin-vercel

1
star
32

GithubGraph

Don't see this project. Please.
1
star
33

Dynamic-Wallpaper

Shell
1
star
34

bmi

Java
1
star
35

genius-api

nodejs genius api
1
star
36

E-commerce

An open source and free E-commerce
CSS
1
star
37

empty

1
star
38

Date-Project

Java
1
star
39

Vidound

Java
1
star
40

hisletters

navigate the history 20th history with a small script! It's a POC though.
TypeScript
1
star
41

jotai-jsx

TypeScript
1
star