{"id":22900912,"url":"https://github.com/movahhedi/lestin","last_synced_at":"2025-05-08T01:40:24.947Z","repository":{"id":65715881,"uuid":"597803066","full_name":"movahhedi/lestin","owner":"movahhedi","description":"Vanilla JSX, No Virtual-DOM","archived":false,"fork":false,"pushed_at":"2025-05-07T06:52:15.000Z","size":1153,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-07T06:55:14.780Z","etag":null,"topics":["dom","js","jsx","jsx-runtime","lestin","react","ts","tsx"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/movahhedi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-02-05T17:28:24.000Z","updated_at":"2025-05-07T06:52:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"ebe5c852-63e0-4917-a499-97ed1947510c","html_url":"https://github.com/movahhedi/lestin","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"8e6e1e5a7f2d66bcb2127478b7e0098e650b1cb0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movahhedi%2Flestin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movahhedi%2Flestin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movahhedi%2Flestin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movahhedi%2Flestin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/movahhedi","download_url":"https://codeload.github.com/movahhedi/lestin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252983767,"owners_count":21835758,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dom","js","jsx","jsx-runtime","lestin","react","ts","tsx"],"created_at":"2024-12-14T01:30:39.341Z","updated_at":"2025-05-08T01:40:24.929Z","avatar_url":"https://github.com/movahhedi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lestin\nLestin has one job: Transform JSX codes to pure HTML elements using `document.createElement()`.\n\nLestin is DOM-based. There's no virtual-DOM, and thus, no additional overhead. We can theoretically say its performance is ~equal to vanilla JS (it's just three functions). (Please contribute on testing Lestin performance).\n\nLestin adds **less than 1KB** gzipped to bundles, but reduces the project size much more than this, as it simplifies component and element creations by supporting JSX; Compared to React (~30KB) and Preact (~3KB).\n\n## Using Lestin\n\nTo use Lestin, install it with TypeScript and Vite, and add the configs described below to `tsconfig.json`.\n\n### Installing Lestin\n\nInstalling using Yarn:\n```\nyarn add -D lestin typescript vite\n```\n\nInstalling using NPM:\n```\nnpm install -D lestin typescript vite\n```\n\n### Configuring JSX for Lestin\n\nAfter installing, to support JSX, add these configs to your `tsconfig.json` in the root of your project:\n\n```json\n{\n\t\"compilerOptions\": {\n\t\t\"jsx\": \"react-jsx\",\n\t\t\"jsxImportSource\": \"lestin\",\n\t\t\"moduleResolution\": \"node\",\n\t\t\"esModuleInterop\": true,\n\t}\n}\n```\n\n## Examples\nCheck out [`/examples`](examples) for more examples.\n\nThese are some mini projects built with Lestin as examples:\n- [Toastification - Toast notifications for DOM WebApps](https://github.com/movahhedi/Toastification)\n- [ImageSort - A simple picture categorizer for the exhaust of photos on phone](https://github.com/movahhedi/ImageSort)\n- [A presentation about RegEx based on code-presentation](https://github.com/movahhedi/regex-basics)\n- [A client-side SVG creator](https://github.com/movahhedi/iau-profile-pic-creator)\n- [A simple code presentation](https://github.com/movahhedi/code-presentation)\n- [A very basic event adder for Google Calendar](https://github.com/movahhedi/GoogleCalendar-EventCreator)\n\nBelow are some examples of other libraries like React and their equivalents in Lestin:\n\n### React Example\n\nWhat it's like in React ([Source](https://github.com/facebook/react#examples)):\n```js\nimport { createRoot } from 'react-dom/client';\n\nfunction HelloMessage({ name }) {\n    return \u003cdiv\u003eHello {name}\u003c/div\u003e;\n}\n\nconst root = createRoot(document.body);\nroot.render(\u003cHelloMessage name=\"Taylor\" /\u003e);\n```\n\nThe same in Lestin:\n```js\nfunction HelloMessage({ name }) {\n    return \u003cdiv\u003eHello {name}\u003c/div\u003e;\n}\n\ndocument.body.appendChild(\u003cHelloMessage name=\"Taylor\" /\u003e);\n```\n\nYou don't need to import Lestin in your scripts for JSX. TypeScript and Vite automatically import them upon build. This is due to setting `lestin` as the `jsxImportSource` in `tsconfig.json`.\nAlthough you may import it to use it's type declarations such as `Lestin.PropsWithChildren`.\n\nLestin uses Vite as its primarily supported bundler. Vite is extremely fast⚡️, and reliable.\n\n**Quick reminder:** If you choose not to use JSX in your project, using Lestin does nothing, and you can safely remove it. But I really can't find a reason not to use JSX in new projects.\n\n## SSR with Lestin\n[Puppeteer](https://pptr.dev/) and [Prerender](https://prerender.io/) are excellent renderers (technically headless browser middlewares) for SSR. Lestin is tested on them too. Read [*Headless Chrome: an answer to server-side rendering JS sites* @ Chrome Developers](https://developer.chrome.com/docs/puppeteer/ssr/).\n\n\n## Thank You\nSpecial thanks to [React](https://reactjs.org), [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react), [*How to Use JSX without React* by Kartik Nair](https://betterprogramming.pub/how-to-use-jsx-without-react-21d23346e5dc), future contributors to this project, and you, for using Lestin.\n\n## License\nLestin is [MIT licensed](https://github.com/movahhedi/lestin/blob/main/LICENSE).\n\nCopyright 2023-present Shahab Movahhedi ([shmovahhedi.com](https://shmovahhedi.com)).\n\nCopyrights on the type definition files are respective of each contributor listed at the beginning of each definition file. Their licenses apply.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmovahhedi%2Flestin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmovahhedi%2Flestin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmovahhedi%2Flestin/lists"}