@GoyeSays
@GoyeSays
https://github.com/Goye
What is ReactJS?
A library for creating user interfaces
but is more about the same?
https://facebook.github.io/react/
+
My MVC is better than your MVC
My MVVM is better than your MVC
My MVC is better than you MVVM
Framework vs components - https://goo.gl/iU3BEo
Traditional MV* separation of concerns
A lot of complexity
Model | Controller | ModelView | View |
---|---|---|---|
Data | DisplayLogic | Database data | Template |
https://facebook.github.io/react/
Everything is a component!
https://www.webcomponents.org/
https://www.webcomponents.org/
@michaellnorth
HTML IMPORTS
@michaellnorth
CUSTOM ELEMENTS
@michaellnorth
HTML TEMPLATES
@michaellnorth
SHADOW DOM
@Goye
HTML TEMPLATE EXAMPLE
<template id="customTemplate">
//Css
<style type="text/css">
.title {
text-transform: uppercase;
}
</style>
//Script
<script type="text/javascript" />
//Content
<div class="main">
<h3> Hello everyone! </h3>
</div>
</template>
//Grab the template
var tmpl = document.querySelector('#customTemplate');
//Add the fragment to the DOM
document.body.appendChild(
document.importNode(tmpl.content, true)
);
Shadow DOM
Document
Custom Component
Shadow DOM
Shadow DOM - CSS Encapsulation
Shadow DOM
@michaellnorth
Shadow DOM
@Goye
Imperative | Declarative |
---|---|
Explicit instructions | Describe the outcome |
The system is stupid, you're smart | The system is smart, you don't care |
Ultimate flexibility | Limited flexibility |
Rackspace
How vs What
Imperative
Declarative
Go to kitchen
Open fridge
Remove chicken from fridge
...
Bring food to table
I want a dinner with chicken.
"Easy, fast, robust, and consistent package manager"
https://www.npmjs.com/
https://babeljs.io/
Use next generation JavaScript, today.
https://webpack.js.org/
https://github.com/Goye
https://github.com/Goye