Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/djj123dj/jrc
A very small alternative to Javascript JSX compilers! You can't compare it with a full framework. It's too small for that :)
https://github.com/djj123dj/jrc
compiler css html jsx nodejs react typescript
Last synced: about 2 months ago
JSON representation
A very small alternative to Javascript JSX compilers! You can't compare it with a full framework. It's too small for that :)
- Host: GitHub
- URL: https://github.com/djj123dj/jrc
- Owner: DJj123dj
- Created: 2024-11-03T18:00:43.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-07T20:01:03.000Z (2 months ago)
- Last Synced: 2024-11-11T01:04:33.360Z (about 2 months ago)
- Topics: compiler, css, html, jsx, nodejs, react, typescript
- Language: JavaScript
- Homepage: https://discord.dj-dj.be
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Jaspers React-like Compiler (JRC)
I know, it's yet another Javascript Framework, but this one is very small (just about 5KB).
It doesn't need react, but it uses the `tsc` to compile the jsx code.> ### ❌ No Support
> This compiler is open source, but isn't made for public usage. **Use it at your own risk.**
> - Feature requests won't be accepted.
> - Bugs and issues won't be solved.
> - I won't provide support with setting it up.### Usage:
You can just write like any other JSX language. The only difference is that this one doesn't contain any special features.
It's just pure JSX to HTML. But it is more than enough for most applications.```tsx
import {_JRCCreateElement} from "./JRCCompiler"//example renderable div
function ExampleDiv(props:{name:string}): HTMLDivElement {
return (Hello {props.name}!)
}//render main
const ExampleMain: HTMLDivElement = (
)//add content to page
document.addEventListener("DOMContentLoaded",() => {
document.body.appendChild(ExampleMain)
})
```It will generate a script that you can import in a HTML file. You also need to import the compiler itself for it to work.
```html
```
### Output
When you've applied the previous example and you use any static html provider, the html visible in the browser will normally look like this:
```html
Hello World!
Hello Jasper!
```