GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - yanns/play-react: Proof of concept of running react.js on the server side with play

BranchesTags
Open more actions menu

Latest commit

 

History

35 Commits
35 Commits

Folders and files

NameName
Last commit message
Last commit date
app
app
 
 
conf
conf
 
 
project
project
 
 
public/javascripts
public/javascripts
 
 
test
test
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
build.sbt
build.sbt
 
 

Repository files navigation

play-react

Proof of concept of running react.js on the server side with play

Details

Rendering on the Client Side

The page under /clientSide suffers from a "Flash Of No-Data Content". To display some data, the browser must:

  1. load the page and the html, displaying html without data
  2. make an ajax request to the server
  3. wait for an anwser
  4. display the data

This sample application simulates a slow AJAX response to make this flash visible.

Pre rendering on the Server Side

The page under /serverSide pre-renders the html on the server side and displays the page already with data.

The changes on the client side are then applied dynamically with the normal client side JavaScript ReactJS code.

The pre-render the ReactJS components on the server side, the following libraries are used:

  • /serverSide uses trireme provides a Node API on the JVM with Rhino
  • /serverSide2 uses js-engine that itself uses trireme behind Akka actors
  • /serverSideJavax uses js-engine that itself uses the Javax engine
  • /serverSideNode uses js-engine that itself uses NodeJS

Pre rendering on the Server Side and streaming the page

The pre-rendered page waits for the data before sending any bytes to the browser. To optimize this, another version /serverSideStream sends the first bytes immediately, to let the browser load the CSS / JavaScript, and then sends the rest of the body when available. For this, I used the Facebook’s BigPipe concept as presented in the talk “Building composable, streaming, testable Play apps” from Yevgeniy Brikman

TODOs:

  • use nodejs styles modules for the client side libraries -> bind browserify or similar tool

About

Proof of concept of running react.js on the server side with play

Resources

Readme
Activity

Stars

43 stars

Watchers

3 watching

Forks

5 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.