GithubHelp home page GithubHelp logo

reaict's Introduction

reaict

Automatically optimize React components with AI

Reaict is a Next.js / Vite / Webpack plugin that automatically analyses your React components and optimizes them for performance during build time. It uses OpenAI's gpt-3.5-turbo model to generate the optimized code.

Ideally this can improve your app's render performance. If you want to improve reconcilliation, run npx million@latest in your app to install Million.js

Installation

npm install reaict-js

Usage

Next.js

// next.config.js
const withReaict = require('reaict-js');

module.exports = withReaict(
  {
    // your next.js config
  },
  { apiKey: 'YOUR_OPENAI_KEY' },
);

Create React App

const withReaict = require('reaict-js');

module.exports = {
  webpack: {
    plugins: { add: [withReaict.webpack({ auto: true })] },
  },
};

Vite

// vite.config.js
import { defineConfig } from 'vite';
import withReaict from 'reaict-js';

export default defineConfig({
  plugins: [withReaict.vite({ apiKey: 'YOUR_OPENAI_KEY' })],
});

Webpack

const withReaict = require('reaict-js');

module.exports = {
  plugins: [withReaict.webpack({ apiKey: 'YOUR_OPENAI_KEY' })],
};

Notes

so much that can be done:

  • prompt optimization
  • support class / arrow func components
  • pre-eval functions
  • github action instead of every run
  • cache functions across runs
  • component validation (perf profiling + screenshot)
  • optimizing on threshold (don't memo everything)
  • integration w/ v0?
  • user hints (e.g. put a function // optimize!)
  • integration w/ million.js
  • package analysis and auto refactor
  • automatic error handing

reaict's People

Contributors

aidenybai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.