SlideShare a Scribd company logo
1 of 56
Download to read offline
Less JS!
for backend developers
About me
Olga Semeniuk,
Java developer
https://plus.google.com/+OlgaKorichkovskaya
Agenda
● Web components
● Polymer
● JSF: PrimeFaces
Goals:
● Reducing amount of code
● Readability
● Composability (being able to create whole
sites and apps by putting different elements
together)
Web Components
set standards from Google
WebComponents.org
Goals:
● Build widgets
● …which can be reused reliably
● …and which won’t break pages if the next
version of the component changes
internal implementation details
Web Components: aims
● Simplification
● Reusability
● Robustness
2008 - W3C start working on spec
...
2013 - Working draft is published
2014 - Polymer presentation on Google I/O
2015, May - Polymer 0.9 released
Timeline
Bower
● A package manager for the web
● Search for dependencies and install
them as packages
● Created by Twitter
● Open Source
www.bower.io
Bower
$ npm install -g bower
www.bower.io
$ bower init
$ bower install --save webcomponentsjs
Web Components
Shadow DOM
HTML Imports
HTML Templates
Custom Elements
Shadow DOM
Method of combining multiple DOM trees
into one hierarchy and
how these trees interact with each other
within a document
Shadow DOM: benefits
● Encapsulate content by creating
document fragments.
● Separate content from presentation
thereby eliminating naming conflicts and
improving code expression
Shadow DOM:
hide presentation Details
Shadow DOM:
separating content from presentation
25+,
Android 41+ None None None 4.4+ 15+
Browser support
Polyfills
webcomponents.js is a set of polyfills built on
top of the Web Components specifications,
enable Web Components in browsers that lack
native support
It makes it possible for developers to use
these standards today
HTML Imports
Imports let include and reuse HTML docs in
other HTML docs.
for html <link rel="import" href="..">
We have <script src>, <link rel="stylesheet">,
<img>, <video>, <audio>...
HTML Imports
The URL is called an import location. To load content from
another domain, the import location needs to be CORS-enabled
HTML Imports: benefits
● Decomposition
● Combining several resources (JS,
CSS, ..) in one
● Reuse
Browser support
36+,
Android 41+
None None None 40+ 23+
Custom Elements
“Everything is an element” philosophy:
web app becomes a collection of well-
defined, reusable components.
Custom Elements
Define own element types with custom tag
names.
As with any element, element can also be
created in JavaScript.
Custom Elements
Define own Polymer element
Custom Elements
Types of elements:
● UI elements, which render UI to the
screen.
● Non-UI elements, which provide
other utilities.
Custom Elements: benefits
● Reduce the amount of code
● Express the function of the code
● Encapsulation, inheritance
Browser support
33+,
Android
41+
None 22+ 7.1+,
iOS Safari 8+
Android
Browser
4.4.4+
20+
Web Components
● Increase productivity
● Declarative
● Composability
● Implement APIs per element type
Polymer
Library built with some extra sugar, provides
a declarative syntax for defining custom
elements, special features including
● two-way data binding,
● declarative event handling,
● declarative inheritance
● property observation
Created & supported by Google
Polymer
Polymer elements
Core-elements are a set of visual and non-visual
utility elements for working with layout, user input,
selection, and scaffolding apps.
Polymer's paper collection implements
material design, highly visual, highly interactive
elements that include things like controls,
layouts, hero transitions, and scrolling effects.
Material design
● Material is the metaphor
● Bold, graphic, intentional
● Motion provides meaning
“Visual language that synthesizes the classic
principles of good design with the innovation and
possibility of technology and science.” © Google
Principles:
http://google.com/design/spec/material-design
● Browser integrated: declarative event
handlers, mutation observers, query selector
● Interoperability - every framework is
compatible with DOM
Polymer : pros
● Write script in a scripting language, write
styles in a styling language, write markup in a
markup language.
● DevTools support
● Browser support
● Not production ready, so far
● Client side technology - many similar
things to JS - frameworks, such
experience is very helpful
Polymer : cons
JSF: PrimeFaces
primefaces.org
PrimeFaces
● Component library for JavaServer Faces
(JSF) based applications
● Standard part of the Java EE stack, so
you can’t do anything wrong
● The most popular JSF framework
Who uses PrimeFaces?
PrimeFaces: 100+ UI Components
Themes
Hide Complexity
JS CSS JSON AJAX
Keep Flexibility
JS API CSS
Override
Client
Callbacks
Ajax
Callbacks
Templates
JSF 2 Templating with Facelets
ui:insert
ui:define
ui:include
ui:composition
PrimeFaces Selectors
An alternative, flexible, grouping based approach to
reference components to partially process and update.
update=”@(form)”
update=”@(form.first)”
update=”@(.mystyle)”
update=”@(.ui-datatable)”
update=”@(:input:not(select))”
update=”@(:input:disabled))”
Custom Elements
PrimeFaces contains API to build custom
components.
But custom components is often difficult to
maintain.
Pros
● Mature and cross browser compatible
● Very large and helpful community
● Easy to understand even for novice team
members
and cons
● Tightly coupled: Layout, Design, Logic,
Communication with the server
● Need some time to make components
look right together
● Easy to make mistakes related to a
misunderstanding of the request-
response lifecycle
and cons
● Not suitable for heavily consumer oriented
website
● Final HTML page is generated from
pseudo-html (xhtml)
● and resulting HTML is often atrocious
● Generation take time
● JSF concept is outdated
Polymer vs PrimeFaces
● Future, based on modern
web technology
● Client side framework
● Requery strong knowledge in
JavaScript and CSS
● Specification is in progress
● Looks modern, easy build
single page application
● Past, part of Java EE
● Server side framework
Java based, but JavaScript,
CSS is very useful
● A lot of documentation,
books, strong community
● Looks more modest, but
has attractive paid theme
Polymer and PrimeFaces
● Powerful frameworks to simplify writing code for
the UI
● Contains set of ready components with styles
● Allow to create own components
● Keep page templating
● Have own search in DOM
● Encapsulate complexity
● Responsive Design
● Extendable
Polymer demo
1. Project skeleton (Spring-Boot, index.html)
2. Add Polymer, core-, paper-elements
3. Create component
4. - add data
5. - style
6. Style for welcome page
7. Add paper-input, paper-button and core-ajax
8. Backend service
PrimeFaces demo
1. Generate project skeleton from archetype (https:
//github.com/bprager/spring-boot-primefaces)
2. Welcome page layout
3. Add polymer components
4. Add interaction with Spring Been
Links
● Web Components WebComponents.org
● Polymer polymer-project.org
● Material-design http://www.google.
com/design/spec/material-design/
● PrimeFaces primefaces.org
● SpringBoot/PrimeFaces Maven-Archetype https://github.
com/bprager/spring-boot-primefaces
● Slides
<questions></questions>
Thanks!

More Related Content

What's hot

001. Introduction about React
001. Introduction about React001. Introduction about React
001. Introduction about ReactBinh Quan Duc
 
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)Red Hat Developers
 
Best Practices with WSO2 Developer Studio
Best Practices with WSO2 Developer Studio Best Practices with WSO2 Developer Studio
Best Practices with WSO2 Developer Studio WSO2
 
JavaFX and HTML5 - Like Curds and Rice
JavaFX and HTML5 - Like Curds and RiceJavaFX and HTML5 - Like Curds and Rice
JavaFX and HTML5 - Like Curds and RiceStephen Chin
 
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"Fwdays
 
Devoxx : being productive with JHipster
Devoxx : being productive with JHipsterDevoxx : being productive with JHipster
Devoxx : being productive with JHipsterJulien Dubois
 
Introduction to WSO2 Developer Studio
Introduction to WSO2 Developer Studio Introduction to WSO2 Developer Studio
Introduction to WSO2 Developer Studio WSO2
 
Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Stephen Chin
 
An Unexpected Solution to Microservices UI Composition
An Unexpected Solution to Microservices UI CompositionAn Unexpected Solution to Microservices UI Composition
An Unexpected Solution to Microservices UI CompositionDr. Arif Wider
 
Micronaut Deep Dive - Codeone 2019
Micronaut Deep Dive - Codeone 2019Micronaut Deep Dive - Codeone 2019
Micronaut Deep Dive - Codeone 2019graemerocher
 
React native: building native iOS apps with javascript
React native: building native iOS apps with javascriptReact native: building native iOS apps with javascript
React native: building native iOS apps with javascriptPolidea
 
Decoupled Architecture and WordPress
Decoupled Architecture and WordPressDecoupled Architecture and WordPress
Decoupled Architecture and WordPressPantheon
 
Angular meetup 2 2019-08-29
Angular meetup 2   2019-08-29Angular meetup 2   2019-08-29
Angular meetup 2 2019-08-29Nitin Bhojwani
 
Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019graemerocher
 
O que é esse tal de OWIN?
O que é esse tal de OWIN?O que é esse tal de OWIN?
O que é esse tal de OWIN?Andre Carlucci
 
Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Stephen Chin
 
WSO2Con USA 2015: End-to-end Microservice Architecture with WSO2 Identity Ser...
WSO2Con USA 2015: End-to-end Microservice Architecture with WSO2 Identity Ser...WSO2Con USA 2015: End-to-end Microservice Architecture with WSO2 Identity Ser...
WSO2Con USA 2015: End-to-end Microservice Architecture with WSO2 Identity Ser...WSO2
 
React JS Belgium Touch Base - React, Flux, React Native
React JS Belgium Touch Base - React, Flux, React NativeReact JS Belgium Touch Base - React, Flux, React Native
React JS Belgium Touch Base - React, Flux, React NativePhilos.io
 

What's hot (20)

001. Introduction about React
001. Introduction about React001. Introduction about React
001. Introduction about React
 
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
 
Best Practices with WSO2 Developer Studio
Best Practices with WSO2 Developer Studio Best Practices with WSO2 Developer Studio
Best Practices with WSO2 Developer Studio
 
Microservices with Spring
Microservices with SpringMicroservices with Spring
Microservices with Spring
 
JavaFX and HTML5 - Like Curds and Rice
JavaFX and HTML5 - Like Curds and RiceJavaFX and HTML5 - Like Curds and Rice
JavaFX and HTML5 - Like Curds and Rice
 
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
 
Devoxx : being productive with JHipster
Devoxx : being productive with JHipsterDevoxx : being productive with JHipster
Devoxx : being productive with JHipster
 
ASP.NET 5 Overview
ASP.NET 5 OverviewASP.NET 5 Overview
ASP.NET 5 Overview
 
Introduction to WSO2 Developer Studio
Introduction to WSO2 Developer Studio Introduction to WSO2 Developer Studio
Introduction to WSO2 Developer Studio
 
Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5
 
An Unexpected Solution to Microservices UI Composition
An Unexpected Solution to Microservices UI CompositionAn Unexpected Solution to Microservices UI Composition
An Unexpected Solution to Microservices UI Composition
 
Micronaut Deep Dive - Codeone 2019
Micronaut Deep Dive - Codeone 2019Micronaut Deep Dive - Codeone 2019
Micronaut Deep Dive - Codeone 2019
 
React native: building native iOS apps with javascript
React native: building native iOS apps with javascriptReact native: building native iOS apps with javascript
React native: building native iOS apps with javascript
 
Decoupled Architecture and WordPress
Decoupled Architecture and WordPressDecoupled Architecture and WordPress
Decoupled Architecture and WordPress
 
Angular meetup 2 2019-08-29
Angular meetup 2   2019-08-29Angular meetup 2   2019-08-29
Angular meetup 2 2019-08-29
 
Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019
 
O que é esse tal de OWIN?
O que é esse tal de OWIN?O que é esse tal de OWIN?
O que é esse tal de OWIN?
 
Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5
 
WSO2Con USA 2015: End-to-end Microservice Architecture with WSO2 Identity Ser...
WSO2Con USA 2015: End-to-end Microservice Architecture with WSO2 Identity Ser...WSO2Con USA 2015: End-to-end Microservice Architecture with WSO2 Identity Ser...
WSO2Con USA 2015: End-to-end Microservice Architecture with WSO2 Identity Ser...
 
React JS Belgium Touch Base - React, Flux, React Native
React JS Belgium Touch Base - React, Flux, React NativeReact JS Belgium Touch Base - React, Flux, React Native
React JS Belgium Touch Base - React, Flux, React Native
 

Viewers also liked (8)

BIG DATA: From mammoth to elephant
BIG DATA: From mammoth to elephantBIG DATA: From mammoth to elephant
BIG DATA: From mammoth to elephant
 
X text
X textX text
X text
 
Jee conf
Jee confJee conf
Jee conf
 
Generics Past, Present and Future
Generics Past, Present and FutureGenerics Past, Present and Future
Generics Past, Present and Future
 
Statis code analysis
Statis code analysisStatis code analysis
Statis code analysis
 
Spring data jee conf
Spring data jee confSpring data jee conf
Spring data jee conf
 
Scala Rock-Painting
Scala Rock-PaintingScala Rock-Painting
Scala Rock-Painting
 
Do we need JMS in 21st century?
Do we need JMS in 21st century?Do we need JMS in 21st century?
Do we need JMS in 21st century?
 

Similar to Less JS for Backend with Web Components

What's new in Portal and WCM 8.5
What's new in Portal and WCM 8.5What's new in Portal and WCM 8.5
What's new in Portal and WCM 8.5Vinayak Tavargeri
 
Building reusable components as micro frontends with glimmer js and webcompo...
Building reusable components as micro frontends  with glimmer js and webcompo...Building reusable components as micro frontends  with glimmer js and webcompo...
Building reusable components as micro frontends with glimmer js and webcompo...Andrei Sebastian Cîmpean
 
Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...
Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...
Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...Lucas Jellema
 
Web components are the future of the web - Take advantage of new web technolo...
Web components are the future of the web - Take advantage of new web technolo...Web components are the future of the web - Take advantage of new web technolo...
Web components are the future of the web - Take advantage of new web technolo...Marios Fakiolas
 
IRJET- Polymer Javascript
IRJET- Polymer JavascriptIRJET- Polymer Javascript
IRJET- Polymer JavascriptIRJET Journal
 
JIO and WebViewers: interoperability for Javascript and Web Applications
JIO and WebViewers: interoperability  for Javascript and Web ApplicationsJIO and WebViewers: interoperability  for Javascript and Web Applications
JIO and WebViewers: interoperability for Javascript and Web ApplicationsXWiki
 
Liferay UG Meetup #8 - Portal 7.3 + portlets com nodeJS - 2020-03-04
Liferay UG Meetup #8 - Portal 7.3 + portlets com nodeJS - 2020-03-04Liferay UG Meetup #8 - Portal 7.3 + portlets com nodeJS - 2020-03-04
Liferay UG Meetup #8 - Portal 7.3 + portlets com nodeJS - 2020-03-04Fernando Fernández
 
Web App Prototypes with Google App Engine
Web App Prototypes with Google App EngineWeb App Prototypes with Google App Engine
Web App Prototypes with Google App EngineVlad Filippov
 
Angular elements - embed your angular components EVERYWHERE
Angular elements - embed your angular components EVERYWHEREAngular elements - embed your angular components EVERYWHERE
Angular elements - embed your angular components EVERYWHERENadav Mary
 
Reason to choose Angular JS for your Web Application
Reason to choose Angular JS for your Web ApplicationReason to choose Angular JS for your Web Application
Reason to choose Angular JS for your Web ApplicationPriyanka Verma
 
Mozilla Add-Ons Evolution 2011 in review and Upcoming in 2012
Mozilla Add-Ons Evolution 2011 in review and Upcoming in 2012Mozilla Add-Ons Evolution 2011 in review and Upcoming in 2012
Mozilla Add-Ons Evolution 2011 in review and Upcoming in 2012Brian King
 
Angular patterns
Angular patternsAngular patterns
Angular patternsPremkumar M
 
Web Components the best marriage for a PWA
Web Components the best marriage for a PWAWeb Components the best marriage for a PWA
Web Components the best marriage for a PWAManuel Carrasco Moñino
 
Contributions: what they are and how to find them
Contributions: what they are and how to find themContributions: what they are and how to find them
Contributions: what they are and how to find themPedro Cambra
 
AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)Alex Ross
 

Similar to Less JS for Backend with Web Components (20)

Web component
Web componentWeb component
Web component
 
What's new in Portal and WCM 8.5
What's new in Portal and WCM 8.5What's new in Portal and WCM 8.5
What's new in Portal and WCM 8.5
 
Building reusable components as micro frontends with glimmer js and webcompo...
Building reusable components as micro frontends  with glimmer js and webcompo...Building reusable components as micro frontends  with glimmer js and webcompo...
Building reusable components as micro frontends with glimmer js and webcompo...
 
Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...
Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...
Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...
 
Web components are the future of the web - Take advantage of new web technolo...
Web components are the future of the web - Take advantage of new web technolo...Web components are the future of the web - Take advantage of new web technolo...
Web components are the future of the web - Take advantage of new web technolo...
 
Polymer 101
Polymer 101Polymer 101
Polymer 101
 
IRJET- Polymer Javascript
IRJET- Polymer JavascriptIRJET- Polymer Javascript
IRJET- Polymer Javascript
 
JIO and WebViewers: interoperability for Javascript and Web Applications
JIO and WebViewers: interoperability  for Javascript and Web ApplicationsJIO and WebViewers: interoperability  for Javascript and Web Applications
JIO and WebViewers: interoperability for Javascript and Web Applications
 
Liferay UG Meetup #8 - Portal 7.3 + portlets com nodeJS - 2020-03-04
Liferay UG Meetup #8 - Portal 7.3 + portlets com nodeJS - 2020-03-04Liferay UG Meetup #8 - Portal 7.3 + portlets com nodeJS - 2020-03-04
Liferay UG Meetup #8 - Portal 7.3 + portlets com nodeJS - 2020-03-04
 
Web App Prototypes with Google App Engine
Web App Prototypes with Google App EngineWeb App Prototypes with Google App Engine
Web App Prototypes with Google App Engine
 
Angular elements - embed your angular components EVERYWHERE
Angular elements - embed your angular components EVERYWHEREAngular elements - embed your angular components EVERYWHERE
Angular elements - embed your angular components EVERYWHERE
 
Reason to choose Angular JS for your Web Application
Reason to choose Angular JS for your Web ApplicationReason to choose Angular JS for your Web Application
Reason to choose Angular JS for your Web Application
 
Mozilla Add-Ons Evolution 2011 in review and Upcoming in 2012
Mozilla Add-Ons Evolution 2011 in review and Upcoming in 2012Mozilla Add-Ons Evolution 2011 in review and Upcoming in 2012
Mozilla Add-Ons Evolution 2011 in review and Upcoming in 2012
 
Dust.js
Dust.jsDust.js
Dust.js
 
KATHY ZHANG_3
KATHY ZHANG_3KATHY ZHANG_3
KATHY ZHANG_3
 
Angular patterns
Angular patternsAngular patterns
Angular patterns
 
Web Components the best marriage for a PWA
Web Components the best marriage for a PWAWeb Components the best marriage for a PWA
Web Components the best marriage for a PWA
 
Contributions: what they are and how to find them
Contributions: what they are and how to find themContributions: what they are and how to find them
Contributions: what they are and how to find them
 
AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)
 
Web summit.pptx
Web summit.pptxWeb summit.pptx
Web summit.pptx
 

Recently uploaded

Genesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptxGenesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptxFamilyWorshipCenterD
 
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfOpen Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfhenrik385807
 
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024eCommerce Institute
 
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )Pooja Nehwal
 
Philippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.pptPhilippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.pptssuser319dad
 
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...NETWAYS
 
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...NETWAYS
 
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...henrik385807
 
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...NETWAYS
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesPooja Nehwal
 
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...NETWAYS
 
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝soniya singh
 
call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@vikas rana
 
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStrSaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStrsaastr
 
LANDMARKS AND MONUMENTS IN NIGERIA.pptx
LANDMARKS  AND MONUMENTS IN NIGERIA.pptxLANDMARKS  AND MONUMENTS IN NIGERIA.pptx
LANDMARKS AND MONUMENTS IN NIGERIA.pptxBasil Achie
 
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfCTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfhenrik385807
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AITatiana Gurgel
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Hasting Chen
 
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Krijn Poppe
 

Recently uploaded (20)

Genesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptxGenesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptx
 
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfOpen Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
 
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
 
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
 
Philippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.pptPhilippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.ppt
 
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
 
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
 
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
 
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
 
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
 
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
 
call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@
 
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
 
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStrSaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
 
LANDMARKS AND MONUMENTS IN NIGERIA.pptx
LANDMARKS  AND MONUMENTS IN NIGERIA.pptxLANDMARKS  AND MONUMENTS IN NIGERIA.pptx
LANDMARKS AND MONUMENTS IN NIGERIA.pptx
 
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfCTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AI
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
 
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
 

Less JS for Backend with Web Components

  • 1. Less JS! for backend developers
  • 2. About me Olga Semeniuk, Java developer https://plus.google.com/+OlgaKorichkovskaya
  • 3. Agenda ● Web components ● Polymer ● JSF: PrimeFaces
  • 4.
  • 5. Goals: ● Reducing amount of code ● Readability ● Composability (being able to create whole sites and apps by putting different elements together)
  • 6. Web Components set standards from Google WebComponents.org
  • 7. Goals: ● Build widgets ● …which can be reused reliably ● …and which won’t break pages if the next version of the component changes internal implementation details
  • 8. Web Components: aims ● Simplification ● Reusability ● Robustness
  • 9. 2008 - W3C start working on spec ... 2013 - Working draft is published 2014 - Polymer presentation on Google I/O 2015, May - Polymer 0.9 released Timeline
  • 10. Bower ● A package manager for the web ● Search for dependencies and install them as packages ● Created by Twitter ● Open Source www.bower.io
  • 11. Bower $ npm install -g bower www.bower.io $ bower init $ bower install --save webcomponentsjs
  • 12. Web Components Shadow DOM HTML Imports HTML Templates Custom Elements
  • 13. Shadow DOM Method of combining multiple DOM trees into one hierarchy and how these trees interact with each other within a document
  • 14. Shadow DOM: benefits ● Encapsulate content by creating document fragments. ● Separate content from presentation thereby eliminating naming conflicts and improving code expression
  • 16. Shadow DOM: separating content from presentation
  • 17. 25+, Android 41+ None None None 4.4+ 15+ Browser support
  • 18. Polyfills webcomponents.js is a set of polyfills built on top of the Web Components specifications, enable Web Components in browsers that lack native support It makes it possible for developers to use these standards today
  • 19. HTML Imports Imports let include and reuse HTML docs in other HTML docs. for html <link rel="import" href=".."> We have <script src>, <link rel="stylesheet">, <img>, <video>, <audio>...
  • 20. HTML Imports The URL is called an import location. To load content from another domain, the import location needs to be CORS-enabled
  • 21. HTML Imports: benefits ● Decomposition ● Combining several resources (JS, CSS, ..) in one ● Reuse
  • 23. Custom Elements “Everything is an element” philosophy: web app becomes a collection of well- defined, reusable components.
  • 24. Custom Elements Define own element types with custom tag names. As with any element, element can also be created in JavaScript.
  • 25. Custom Elements Define own Polymer element
  • 26. Custom Elements Types of elements: ● UI elements, which render UI to the screen. ● Non-UI elements, which provide other utilities.
  • 27. Custom Elements: benefits ● Reduce the amount of code ● Express the function of the code ● Encapsulation, inheritance
  • 28. Browser support 33+, Android 41+ None 22+ 7.1+, iOS Safari 8+ Android Browser 4.4.4+ 20+
  • 29. Web Components ● Increase productivity ● Declarative ● Composability ● Implement APIs per element type
  • 30. Polymer Library built with some extra sugar, provides a declarative syntax for defining custom elements, special features including ● two-way data binding, ● declarative event handling, ● declarative inheritance ● property observation
  • 31. Created & supported by Google Polymer
  • 32. Polymer elements Core-elements are a set of visual and non-visual utility elements for working with layout, user input, selection, and scaffolding apps. Polymer's paper collection implements material design, highly visual, highly interactive elements that include things like controls, layouts, hero transitions, and scrolling effects.
  • 33.
  • 34.
  • 35. Material design ● Material is the metaphor ● Bold, graphic, intentional ● Motion provides meaning “Visual language that synthesizes the classic principles of good design with the innovation and possibility of technology and science.” © Google Principles: http://google.com/design/spec/material-design
  • 36. ● Browser integrated: declarative event handlers, mutation observers, query selector ● Interoperability - every framework is compatible with DOM Polymer : pros ● Write script in a scripting language, write styles in a styling language, write markup in a markup language. ● DevTools support
  • 37. ● Browser support ● Not production ready, so far ● Client side technology - many similar things to JS - frameworks, such experience is very helpful Polymer : cons
  • 39. PrimeFaces ● Component library for JavaServer Faces (JSF) based applications ● Standard part of the Java EE stack, so you can’t do anything wrong ● The most popular JSF framework
  • 41. PrimeFaces: 100+ UI Components
  • 43. Hide Complexity JS CSS JSON AJAX Keep Flexibility JS API CSS Override Client Callbacks Ajax Callbacks
  • 44. Templates JSF 2 Templating with Facelets ui:insert ui:define ui:include ui:composition
  • 45. PrimeFaces Selectors An alternative, flexible, grouping based approach to reference components to partially process and update. update=”@(form)” update=”@(form.first)” update=”@(.mystyle)” update=”@(.ui-datatable)” update=”@(:input:not(select))” update=”@(:input:disabled))”
  • 46. Custom Elements PrimeFaces contains API to build custom components. But custom components is often difficult to maintain.
  • 47. Pros ● Mature and cross browser compatible ● Very large and helpful community ● Easy to understand even for novice team members
  • 48. and cons ● Tightly coupled: Layout, Design, Logic, Communication with the server ● Need some time to make components look right together ● Easy to make mistakes related to a misunderstanding of the request- response lifecycle
  • 49. and cons ● Not suitable for heavily consumer oriented website ● Final HTML page is generated from pseudo-html (xhtml) ● and resulting HTML is often atrocious ● Generation take time ● JSF concept is outdated
  • 50. Polymer vs PrimeFaces ● Future, based on modern web technology ● Client side framework ● Requery strong knowledge in JavaScript and CSS ● Specification is in progress ● Looks modern, easy build single page application ● Past, part of Java EE ● Server side framework Java based, but JavaScript, CSS is very useful ● A lot of documentation, books, strong community ● Looks more modest, but has attractive paid theme
  • 51. Polymer and PrimeFaces ● Powerful frameworks to simplify writing code for the UI ● Contains set of ready components with styles ● Allow to create own components ● Keep page templating ● Have own search in DOM ● Encapsulate complexity ● Responsive Design ● Extendable
  • 52. Polymer demo 1. Project skeleton (Spring-Boot, index.html) 2. Add Polymer, core-, paper-elements 3. Create component 4. - add data 5. - style 6. Style for welcome page 7. Add paper-input, paper-button and core-ajax 8. Backend service
  • 53. PrimeFaces demo 1. Generate project skeleton from archetype (https: //github.com/bprager/spring-boot-primefaces) 2. Welcome page layout 3. Add polymer components 4. Add interaction with Spring Been
  • 54. Links ● Web Components WebComponents.org ● Polymer polymer-project.org ● Material-design http://www.google. com/design/spec/material-design/ ● PrimeFaces primefaces.org ● SpringBoot/PrimeFaces Maven-Archetype https://github. com/bprager/spring-boot-primefaces ● Slides