Code Monkey home page Code Monkey logo

vitext's Introduction

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

vitext's People

Contributors

aslemammad avatar borrus-sudo avatar dependabot[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.