2017 © Pedro Peláez
 

library redux-react-ssr

Redux ReactJS server side rendering using v8js

image

koriym/redux-react-ssr

Redux ReactJS server side rendering using v8js

  • Friday, March 24, 2017
  • by koriym
  • Repository
  • 2 Watchers
  • 10 Stars
  • 2,933 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

PLEASE NOTE, THIS PROJECT IS NO LONGER BEING MAINTAINED

Use Koriym.Baracoa instead. A Redux-React-SSR example is available., (*1)


redux-react-ssr

redux-react-ssr is a library that uses the power of Facebook's React Redux library to render UI components on the server-side with PHP as well as on the client., (*2)

Prerequisites

  • php7.1
  • V8Js (optional for development)

Usage

<?php
require dirname(__DIR__, 3) . '/vendor/autoload.php';

use Koriym\ReduxReactSsr\ReduxReactJs;

$ssr = new ReduxReactJs(
    file_get_contents(__DIR__ . '/build/react.bundle.js'),
    file_get_contents(__DIR__ . '/build/app.bundle.js'),
    new ExceptionHandler(),
    new V8Js()
);
$view = $ssr('App', ['hello' => ['message' => 'Hello, Redux!']], 'root');
$html = <<<EOT
<!DOCTYPE html>
<html>
  <head>
    <title></title>
  </head>
  <body>
    <div id="root">{$view->markup}</div>
    <script src="build/react.bundle.js"></script>
    <script src="build/app.bundle.js"></script>
    <script>{$view->js}</script>
  </body>
</html>
EOT;

echo $html;

No V8Js enviroment

It is posibble to use without V8Js extention for development. In that case, Render method return no markup but enable to render by only client without error., (*3)

Installation

composer require koriym/redux-react-ssr

Testing redux-react-ssr

git clone git@github.com:koriym/Koriym.ReduxReactSsr.git
composer install
cd Koriym.ReduxReactSsr/example/redux
npm install
npm run build
npm start

Install V8Js

OSX

brew update
brew install homebrew/php/php71-v8js

edit php.ini or add 'V8Js.ini', (*4)

extension="/usr/local/opt/php71-v8js/v8js.so"

The Versions

24/03 2017

1.x-dev

1.9999999.9999999.9999999-dev https://github.com/koriym/PHP.Skeleton

Redux ReactJS server side rendering using v8js

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shingo Kumagai

psr skeleton

26/01 2017

dev-spike

dev-spike https://github.com/koriym/PHP.Skeleton

Redux ReactJS server side rendering using v8js

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shingo Kumagai

psr skeleton

17/01 2017

1.0.2

1.0.2.0 https://github.com/koriym/PHP.Skeleton

Redux ReactJS server side rendering using v8js

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shingo Kumagai

psr skeleton

16/01 2017

1.0.1

1.0.1.0 https://github.com/koriym/PHP.Skeleton

Redux ReactJS server side rendering using v8js

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shingo Kumagai

psr skeleton

16/01 2017

1.0.1.x-dev

1.0.1.9999999-dev https://github.com/koriym/PHP.Skeleton

Redux ReactJS server side rendering using v8js

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shingo Kumagai

psr skeleton

16/01 2017

1.0.0

1.0.0.0 https://github.com/koriym/PHP.Skeleton

Redux ReactJS server side rendering using v8js

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shingo Kumagai

psr skeleton

12/12 2016

0.3.0

0.3.0.0 https://github.com/koriym/PHP.Skeleton

Redux ReactJS server side rendering using v8js

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shingo Kumagai

psr skeleton

15/10 2016

0.2.0

0.2.0.0 https://github.com/koriym/PHP.Skeleton

Redux ReactJS server side rendering using v8js

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shingo Kumagai

psr skeleton

05/10 2016

0.1.2

0.1.2.0 https://github.com/koriym/PHP.Skeleton

Redux ReactJS server side rendering using v8js

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shingo Kumagai

psr skeleton

15/09 2016

0.1.1

0.1.1.0 https://github.com/koriym/PHP.Skeleton

Redux ReactJS server side rendering using v8js

  Sources   Download

MIT

The Requires

  • php >=7.0.0
  • ext-v8js >=1.3.0

 

The Development Requires

by Shingo Kumagai

psr skeleton

30/05 2016

0.1.0

0.1.0.0 https://github.com/koriym/PHP.Skeleton

Redux ReactJS server side rendering using v8js

  Sources   Download

MIT

The Requires

  • php >=7.0.0
  • ext-v8js >=1.3.0

 

The Development Requires

by Shingo Kumagai

psr skeleton