Download the PHP package bear/reactjs-module without Composer
On this page you can find all versions of the php package bear/reactjs-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bear/reactjs-module
More information about bear/reactjs-module
Files in bear/reactjs-module
Package reactjs-module
Short Description Redux React Serevr-Side Rendering using V8Js module for BEAR.Sunday
License MIT
Informations about the package reactjs-module
BEAR.ReactJsModule
BEAR.ReactJsModule is a redux-react-ssr
which renders Redux React UI on the server-side support module for BEAR.Sunday.
Prerequisites
- php7
- V8Js
Install
Composer Install
Module Install
In this canse, you need to place ssr-app.bundle.js
at $baseDir
directory.
Redux UI Skeleton Install
Copy skeleton directory to your BEAR.Sunday project root.
Install dependencies.
Build ui application.
Three js bundled file is produced.
- react.bundle.js React library bundled code
- {app-name}.bundle.js Application bundled code for client side
- {ssr-app-name}.bundle.js Application bundled code for server side
You can include JavaScript client code (CSS, DOM ..) for {app}.bundle.js
only. See more detail at the example.
ResourceOjbect
To inject SSR renderer, Annotate @Inject
with @Named
annotation to setRenderer
setter method
with {ssr-app-name}
application name.
Template
We need php template code. For exapmle, Index.php
page resource needs Index.html.php
template file.
You can get the value of body by escape()
or raw()
.
Note: app.bundle.js
is client javascript code. The page is rendered fully even {$markup} is removed by client JS code.
VoidV8Module
It is possible to install VoidV8Module
to run non V8Js environment for clien side rendering only.