Babel plugin for the Server-Side which converts JSX to ESX for performance gains.
Experimental.
In
import React from 'react'
const data = { value: 'hi '}
const Component = ({value}) => (
<div>
<p> some content </p>
<p> some {value} </p>
</div>
)
const App = () => <Component {...data}/>
export default App
Out
const esx = require('esx')();
import React from 'react';
const data = {
value: 'hi '
};
const Component = ({
value
}) => esx`<div>
<p> some content </p>
<p> some ${value} </p>
</div>`;
esx.register({
Component
});
const App = () => esx`<Component ...${data}/>`;
export default App;
$ npm install babel-plugin-esx-ssr
.babelrc
{
"plugins": ["esx-ssr"]
}
$ babel --plugins esx-ssr script.js
require("babel-core").transform("code", {
plugins: ["esx-ssr"]
});
This plugin is for esx
v2.x.x.
esx
is an OPEN Open Source Project. This means that:
Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.
See the CONTRIBUTING.md file for more details.
MIT