• Stars
    star
    764
  • Rank 59,449 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 5 years ago
  • Updated over 1 year ago

Reviews

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

Repository Details

A compiler that converts React-compatible codes to VanillaJS with no Virtual DOM

Travis (.org) npm

Vidact

Vidact compiles your React source codes to VanillaJS code with No Virtual DOM ™️. It is similar to Svelte, but unlike Svelte, Vidact does not introduce a new syntax. It takes in pure React-compatible JavaScript (JSX) and outputs plain JavaScript.

Vidact currently is in alpha phase and has known limitations. It does not fully comply with React's behaviour in some edge cases, and probably never will, but the goal is to get as close behaviour to React as possible. Also, it currently only supports functional components and does not support class components.

How does it work and how is it different from React?

Vidact is a babel-plugin that scans your source code to find what parts of the UI need to be updated in response to a prop or state change and generates a plain JavaScript code that should have the same DOM result as the equivalent React code. Note that all of this is done in build time! Whereas React does the bulk of its work in runtime in the browser by leveraging Virtual DOMs to determine what needs to be updated in the actual DOM.

When should I use it instead of React?

Vidact is not currently ready to be used in production.

The goal is to have an alternative library for those who love React, but are looking for a more lightweight and high-performance implementation for smaller projects.

Roadmap

  • JSX conversion for native HTML elements
  • JSX conversion for component elements
  • Support event listeners for native HTML elements
    • Proxy onChange for text inputs and textarea
  • Support inline styles
  • Reactive props
  • Basic array child nodes support
  • useState: Stateful components
  • Dangerously set innerHTML
  • useRef
  • useEffect
  • useEffect with cleanup (detect component unmount)
  • useCallback
  • useMemo
  • Conditional expression performance
  • Support custom hook functions built upon native hooks
  • Improve array child support
    • Avoid refreshing elements with the same key and only do prop updates instead
    • Avoid refreshing rearranged elements with the same key
  • SVG support
  • Support components with multiple conditional return statements
  • Support context
  • SSR support
  • Props spread

More Repositories

1

react-native-copilot

Step-by-step walkthrough tooltip for your react native app
TypeScript
2,002
star
2

made-in-iran

A list of cool projects made in Iran
TypeScript
833
star
3

konsul

A react renderer for browser's dev console
JavaScript
615
star
4

grafgiti

Vandalize your github contributions wall.
JavaScript
412
star
5

react-native-loader

A collection of animated spinners for React Native
JavaScript
393
star
6

racket

A complete starting app for developing universal React/Redux web apps with generators, best practices and more
JavaScript
290
star
7

react-native-easy-dnd

Drag and drop with react-native made simple
TypeScript
125
star
8

angular-persian

🌏 Persian tools for angular.js
CoffeeScript
98
star
9

lithree.js

🔮 Lightweight 3D WebGL framework written in ES6
JavaScript
42
star
10

react-native-ximage

An alternative to react native's Image component with cache support.
JavaScript
31
star
11

react-use-context-selector

Context selector hook for React
TypeScript
29
star
12

openbabel-node

OpenBabel Bindings for Node.js
C++
26
star
13

php-jalali-extension

A php extension for Jalali dates
Shell
20
star
14

DateTimeBundle

A Symfony2 Bundle to format DateTime to string according to a Calendar and a Datepicker FormType.
JavaScript
16
star
15

telegram-vanilla-client

TypeScript
15
star
16

react-markdown-native

Render Markdown as React native components
JavaScript
14
star
17

volley

A Web-Based Volleyball game
JavaScript
12
star
18

mol3d

A chemical visualization tool on top of WebGL
JavaScript
10
star
19

Razi

A new scientific chemistry library for java.
Java
10
star
20

pasoor

♠️ A simple API for game cards.
JavaScript
9
star
21

molcanvas.js

A WebGL molecule renderer and editor
JavaScript
7
star
22

goron

Yet another graphical database management tool [WIP]
JavaScript
7
star
23

muzik

A simple music player made with react. I made it for an "interview" test but never joined the company.
JavaScript
7
star
24

vscode-shopify-i18n

TypeScript
6
star
25

shelem

♥️ Shelem (a perisan card game) made with react native
JavaScript
6
star
26

mohebifar.ir

Mohamad Mohebifar's blog
HTML
4
star
27

openmm-transformer

A cleaner way to manage custom forces in OpenMM
Python
4
star
28

muniranians

JavaScript
4
star
29

GayPI

:octocat: Isomorphic JavaScript API wrapper around the Github API v3.
JavaScript
4
star
30

truck-cli

JavaScript
3
star
31

openmm-buckingham-plugin

C++
3
star
32

chem.js

A molecular modeling JavaScript framework.
JavaScript
3
star
33

CalendarBundle

A Symfony2 Bundle to show times with any type of calendar (Persian هجری, Gregorian, ...)
PHP
2
star
34

fix-pdb

A simple script for fixing broken PDB files
Python
2
star
35

pybel-orca

Python code around pybel to write inputs and read outputs of the ab initio package, ORCA
Python
2
star
36

cssTransit

Javascript CSS Transition
JavaScript
1
star
37

react-konsole

1
star
38

node-parsi-payment

A Node.js module providing access to the Iran's Shetab Payment API
JavaScript
1
star
39

smirnoff

The SMIRks Native Open Force Field (SMIRNOFF)
Jupyter Notebook
1
star
40

janshop

Simple RESTful django content management framework
HTML
1
star