Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cyco130/haydi
A wannabe Vite for Deno
https://github.com/cyco130/haydi
deno frontend ssr typescript
Last synced: 3 months ago
JSON representation
A wannabe Vite for Deno
- Host: GitHub
- URL: https://github.com/cyco130/haydi
- Owner: cyco130
- License: other
- Created: 2022-12-27T12:39:53.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-30T09:39:17.000Z (almost 2 years ago)
- Last Synced: 2024-09-16T15:09:39.287Z (3 months ago)
- Topics: deno, frontend, ssr, typescript
- Language: TypeScript
- Homepage:
- Size: 60.5 KB
- Stars: 15
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Haydi
**Haydi** (pronounced "high-dee") is an experiment to create an on-demand dev server (like Vite) for Deno.
Open the `playground/react` directory in your IDE and run `deno task dev` to see it in action. It will compile the source files on demand, both for the server and the client and run a simple React SSR demo app.
## Design
Haydi has a plugin system (internal for now) inspired by Vite's. It uses plugins to resolve, load, and transform modules both for the server and the browser.
For the server-side code, modules are transformed into an async function body and executed. This will allow custom transforms (Vue, Svelte etc.) and hot loading later on. This will be dropped once Deno supports a [native loader API](https://github.com/denoland/deno/issues/8327).
For the client-side code, modules are transformed and sent to the browser on demand. Bare imports (e.g. `import React from "react"`) are resolved using the `import-map.browser.json` file and rewritten. Currently, they resolve to CDN versions. We can cache them locally later. Relying on a CDN (even if cached) skirts around the most complicated part of Vite (dependency optimization).
## Future plans
- Proper error handling
- Hot reloading and HMR
- Local browser module caching
- CSS and other assets
- Vue, Svelte, Preact, Solid etc.
- Proper CLI
- Configuration options
- External plugin interface
- Production build## Credits
- Fatih Aygün, MIT License
- The "module to function body" transform is adapted from Vite's SSR transform