Isomorphic js? Shared js
with react.js
Bondarenko Oleksander (aka Snig)
Application architecture
Code and
component
re-use
Rapid
Development
&
Handling
large code-
bases
Drupal and React.js
Drupal
hook_menu
controller
Browser
JS
HTML
Drupal
hook_menu
controller
Browser
JS
HTML
AJAX
Drupal
hook_menu
controller
Browser
JS
About me
Bondarenko Oleksandr (aka SNIG):
5+ years exp on web development.
4+ years on drupal
External consultant, Team lead (of one part drupal
developers), front-end optimisation.
loadbalancer
webserver
mySQL memcached Node.js services
webserver
PHP templates
Duplication and only
some Code reuse
Small components
over big controllers
Self contained
Can be used
everywhere
Can be addressed
and rendered
separately
JS is part of the
component
CSS can be part of
the component
Share code between
server and client
Share code between
server and client
React.js
JavaScript UI Library
Virtual DOM
Many small, self
contained, reusable
components
Getting the data in there
Drupal
Backend
React
Frontend
Drupal
Backend
React
Frontend
Drupal
Backend
React
Frontend
Drupal
Backend
React
Frontend
Problematic
Remember
Self-contained
Reusable
Drupal
Backend
React
Frontend
React
Frontend
Drupal
Backend
Drupal
Backend
React
Frontend
Drupal
Backend
React
Frontend
Overfetching
Under Fetching
Solutions
Flux Datastores
Drupal
Backend
React
Frontend
GraphQL
“I even wonder if GraphQL could
be the basis for a future version
of Views.”
Server side rendering
SEO
Better user experience
Several approaches
V8js
NodeJS proxy
NodeJS service
Bundling
Conclusion?
Enables developers to only
focus on their components
Rapid prototyping
Easier Refactoring
Easy re-using of
components
Error Handling
Load components
asynchronously
Frontend and backend are
part of the same
application
Ok, it’s all about
Isomorphic js
Questions?

Isomorphic js shared js with react.js