An open API service indexing awesome lists of open source software.

https://github.com/rafael-vasconcellos/coffee-ssr

playing with ssr on vite
https://github.com/rafael-vasconcellos/coffee-ssr

front-end landing-page react react-router reactjs ssr study ui-framework-study vite

Last synced: 3 months ago
JSON representation

playing with ssr on vite

Awesome Lists containing this project

README

          

# Sobre

estudo do uso de server side rendering (SSR) em aplicações feitas com o vite

## JSX se torna JS. como?
### Exemplo básico
```js
// transpilador
const babel = require("@babel/core");
const presetReact = require("@babel/preset-react");

const jsxCode = `
const App = () => (


Hello


SolidJS



)
`;

const output = babel.transformSync(jsxCode, {
presets: [presetReact],
});

console.log(output.code);
```

### Output
```js
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
//import { jsxs } from "solid-js/h";

const App = () => (
jsxs("div", {
children: [
jsx("h1", { children: "Hello" }),
jsx("p", { children: "SolidJS" }),
],
});
)
```