![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
lev-react-renderer
Advanced tools
A Restify middleware that provides a res.render
method for sending HTML
responses based on a React component. styled-components is supported.
The rendering is done server-side (SSR) but isomorphic / client-side rendering is also supported by providing a link to your bundle.
npm install --save lev-react-renderer
'use strict';
const restify = require('restify');
const reactRenderer = require('lev-react-renderer');
const formatText = restify.formatters['text/plain; q=0.3'];
const httpd = restify.createServer({
formatters: {
'text/html': formatText
}
});
httpd.use(reactRenderer());
httpd.get('/', (req, res, next) => {
res.render(YourApp, yourProps);
});
httpd.listen(8080, '0.0.0.0', () => {
log.info('%s listening at %s', httpd.name, httpd.url);
});
In addition to Server-Side Rendering (SSR) this library supports 'hydrating' your application on the client-side. To do so, simply provide the location of your 'bundle' when creating the middleware. e.g.
httpd.use(reactRenderer({
bundle: 'public/bundle.js'
}));
The bundle should call the hydrate function with the same component you are
passing to res.render()
. e.g.
import { hydrate } from 'lev-react-renderer';
import { YourApp } from './YourApp';
hydrate(YourApp);
To test changes to this repository simply run:
make test
FAQs
A React rendering middleware for Restify
The npm package lev-react-renderer receives a total of 1 weekly downloads. As such, lev-react-renderer popularity was classified as not popular.
We found that lev-react-renderer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.