React.js + AEM
CIRCUIT - An Adobe Developer Event
Presented by ICF Interactive
Follow along : http://slides.com/benwestrate/deck-1/live
Overview
- What is React.js?
- Why use React.js?
- How to get data to your react components?
What is React
- React is developed by Facebook
- React uses a Virtual Dom
- React helps keep your code in small reusable components
Why Use React.js?
- Large Data sets render blazingly fast
- It will only update the DOM when it needs to
- It is just plain fun to write react components
AEM Authored Data
- There are hundreds of ways to get data to your FrontEnd components.
- But not hundreds of ways that fit most situations.
AEM Authored Data
- Standard method that can be used for one or many instances of a component
- A web standard way of putting data on the page
What we are looking for
AEM Authored Data
A Solution
<script type="text/json"
data-component="headerChooser"
data-component-config
data-component-instance="header-chooser">
{
"textColor" : "Black"
}
</script>
data-stoar - @joshuazeltman
Main Configuration - Optional
AEM Authored Data
A Solution
<script type="text/json"
data-component="headerChooser"
data-component-instance="header-chooser">
{
"hook" : "uniqueName",
"titleText" : "Test Title",
"titleType" : "h3"
}
</script>
data-stoar - @joshuazeltman
Component Data
Initializing
Goals
- Simple initialization
- Initialize on page load
- Initialize both React components and non-react components
Initializing
A Solution
Mainstay
var Global = function( clientLibraryComponents ){
this.componentsToInitialize = new DataStoar();
mainStay( this.componentsToInitialize, clientLibraryComponents );
}
module.exports = { init : Global };
mainstay - @BenWestrate
Process Overview
Process Overview
See it in action
The End
Questions?
Contact Me
CIRCUIT 2015 - React
By Ben Westrate
CIRCUIT 2015 - React
- 8,041