SlideShare a Scribd company logo
Extending eZ Platform 2.x with Symfony and React
With the eZ Platform 2.x development case
Who are we?
Piotr Nalepa
Senior UI Developer @ eZ Systems
@sunpietro
Maciej Kobus
PHP Developer @ eZ Systems
The Past
The technology decisions, regarding eZ Platform 1.x
were made at some point between 2013 and 2014
Technology stack in eZ Platform 1.x
• PHP 5.6,
• Symfony 2.x,
• YUI3,
• No CSS pre-processors,
Developing features in eZ Platform 1.x
• Difficult,
• Slow,
• Lack of programmers resources
The biggest problem
Infamous YUI3
The goals for eZ Platform 2.x
Make editors/developers happy again
• Increase app performance,
• Eliminate the loading spinner headache,
• Make it easy to extend
Seeking a right solution
The sources of inspirations
• Community,
• Meetups,
• Conferences,
• Our own experience
AdminUI backend technology stack
• PHP 7.1,
• PHP Symfony framework 3.x,
• Twig templates,
• Symfony Forms,
• KNP Menu Bundle,
• Translations Bundle
AdminUI frontend technology stack
• JavaScript ES6+,
• ReactJS 16.x,
• Bootstrap 4.x,
• SASS,
• Webpack,
• AlloyEditor
On the frontend side
Why ReactJS?
• Mechanism of quick UI updates,
• Easy way to manage state and data flow,
• Easy to implement event handlers,
• Paradigm of splitting code into smaller components,
• No need to use any extra templating engines, like Handlebars,
• Easy to combine with any other JS library or framework (if needed).
Why not Web Components?
• Difficult to extend existing Web Components when ShadowDOM is on,
• Custom Elements are just another way of writing divs with CSS classes,
• Not many good practices for Web Components development,
• Slow to develop new features.
Should you avoid using Web Components?
No!
Browsers support in theAdminUI
The latest version of the following browsers:
• Mozilla Firefox,
• Google Chrome,
• Microsoft Edge,
• Safari,
• Opera
Why only the latest versions of browsers?
• Latest JS features,
• Latest CSS features,
• HTML5 APIs
What about mobile devices?
The base Admin UI is mobile adapted.
The Page Builder component is a desktop-first application,
might be adapted later when needed.
Extensible UI parts
What can you extend in theAdminUI?
Everything in AdminUI can be extended:
• with PHP code (in most cases),
• with JavaScript/ReactJS (in some cases).
Extension points for frontend developers
ReactJS modules
• Universal Discovery (the only one loaded everywhere),
• Sub-Items List,
• Multi-File Upload
Injecting stylesheets and scripts
JS, CSS and Twig files can be injected
by using YAML config and tags
UI Component classes on backend
EzSystemsEzPlatformAdminUiComponentTwigComponent
EzSystemsEzPlatformAdminUiComponentScriptComponent
EzSystemsEzPlatformAdminUiComponentLinkComponent
Sample tag usage
tags:
- { name: ezplatform.admin_ui.component, group: 'script-head' }
Injection points
• stylesheet-head
• script-head
• custom-admin-ui-modules
• custom-admin-ui-config
• stylesheet-body
• script-body
• content-edit-form-before
• content-edit-form-after
• content-create-form-before
• content-create-form-after
• dashboard-blocks
Extending Universal Discovery
(function (global, eZ) {
eZ = eZ || {};
eZ.adminUiConfig = eZ.adminUiConfig || {};
eZ.adminUiConfig.universalDiscoveryWidget =
eZ.adminUiConfig.universalDiscoveryWidget || {};
eZ.adminUiConfig.universalDiscoveryWidget.extraTabs =
eZ.adminUiConfig.universalDiscoveryWidget.extraTabs || [];
eZ.adminUiConfig.universalDiscoveryWidget.extraTabs.push({
id: 'tab-identifier',
title: 'tab-title',
iconIdentifier: 'tab-icon-identifier',
panel: CustomTabContentPanel,
attrs: {}
});
})(window, window.eZ);
Universal Discovery – result of extension
Extending Sub-Items List
ReactDOM.render(React.createElement(eZ.modules.SubItems, {
handleEditItem,
generateLink,
parentLocationId: container.dataset.location,
sortClauses: {[sortField]: sortOrder},
restInfo: {token, siteaccess},
extraActions: [{
component: SomeCustomComponent,
attrs: Object.assign({}, mfuAttrs, {
onPopupClose: doSomethingOnClose,
})
}],
items,
contentTypesMap,
totalCount: subItemsList.ChildrenCount
}), container);
Sub-Items List – result of extension
Extending Field Type validators – class
class CustomFieldTypeValidator extends global.eZ.BaseFieldValidator {
validateValue(event) {
return {
isError: false,
errorMessage: ''
};
}
}
Extending Field Type validators – implementation
const validator = new CustomFieldTypeValidator({
classInvalid: 'is-invalid',
fieldSelector: '.ez-field-edit--custom-field-type',
eventsMap: [
{
selector: '.ez-field-edit--custom-field-type input',
eventName: 'blur',
callback: 'validateValue',
errorNodeSelectors: ['.ez-field-edit__label-wrapper'],
},
],
});
validator.init();
eZ.fieldTypeValidators = eZ.fieldTypeValidators ?
[...eZ.fieldTypeValidators, validator] :
[validator];
Extension points for backend developers
Field Types
• Content editing is now powered by Symfony Forms,
• Developers have to provide mapping service between repository fieldtype and
Symfony Forms,
• Templating is easier,
• Customizable via EventListeners, DataTransformers, Type Extensions etc.
Field Types in YAML
tags:
- { name: ez.fieldFormMapper.definition, fieldType: ezboolean }
- { name: ez.fieldFormMapper.value, fieldType: ezboolean }
Field Types in PHP
class PageFormMapper implements FieldValueFormMapperInterface {
public function mapFieldValueForm(FormInterface $fieldForm, FieldData $data) {
$fieldDefinition = $data->fieldDefinition;
$formConfig = $fieldForm->getConfig();
$names = $fieldDefinition->getNames();
$label = $fieldDefinition->getName($formConfig->getOption('mainLanguageCode')) ?:
reset($names);
$fieldForm->add(
$formConfig->getFormFactory()->createBuilder()->create('value',
PageFieldType::class, [
'required' => $fieldDefinition->isRequired,
'label' => $label,
]
)
->setAutoInitialize(false)
->getForm()
);
}
}
ExtendingApplication Menu
The extension point is based on KNP Menu bundle.
It uses Event Listeners to extend existing menus.
ExtendingApplication Menu
class ConfigureMainMenuListener implements TranslationContainerInterface
{
public function onMenuConfigure(ConfigureMenuEvent $event)
{
$root = $event->getMenu();
$options = $event->getOptions();
// ...
$root->addChild(self::ITEM_PAGE, [
'extras' => [
'icon' => 'content-list',
'translation_domain' => 'ezplatform_page_builder_menu',
'routes' => [
'ezplatform.page_builder.location_preview',
'ezplatform.page_builder.url_preview',
],
],
]);
}
}
ExtendingApplication Menu– the result
The Location view tabs
Adding new tabs – the YAML code
EzSystemsEzPlatformAdminUiTabLocationViewContentTab:
public: true
autowire: true
arguments:
$siteAccessLanguages: '$languages$'
tags:
- { name: ezplatform.tab, group: location-view }
Adding new tabs – the Twig code
{{ ez_platform_tabs('location-view', {
'content': content,
'location': location
}, '@EzPlatformAdminUi/parts/tab/locationview.html.twig') }}
Other approaches of extendingAdminUI
• Overriding Twig templates,
• Overriding service definitions,
• Compiler passes,
• Bundle's extension class,
• Semantic configuration,
• Event listeners
What else?
• Custom Tags in the rich text editor,
• Notifications API
Performance comparison – Login page 1.x
Performance comparison – Login page 2.x
Login page summary
eZ Platform 1.x eZ Platform 2.x
Requests 158 7
Download size 6.5M 608KB
HTML load time 3.5s 681ms
Page ready time 16.13s 715ms
The Login page loads almost 23x faster in 2.x!
Performance comparison – Location view 1.x
Performance comparison – Location view 2.x
Location page summary
eZ Platform 1.x eZ Platform 2.x
Requests 190 22
Download size 6.7M 2.2M
HTML load time 24.6s 2.2s
Page ready time 40.99s 2.69s
The Location page loads almost 16x faster in 2.x!
Who are we?
Piotr Nalepa
Senior UI Developer @ eZ Systems
@sunpietro
Maciej Kobus
PHP Developer @ eZ Systems
THANK YOU!

More Related Content

What's hot

CouchDB for Web Applications - Erlang Factory London 2009
CouchDB for Web Applications - Erlang Factory London 2009CouchDB for Web Applications - Erlang Factory London 2009
CouchDB for Web Applications - Erlang Factory London 2009
Jason Davies
 
Bye bye $GLOBALS['TYPO3_DB']
Bye bye $GLOBALS['TYPO3_DB']Bye bye $GLOBALS['TYPO3_DB']
Bye bye $GLOBALS['TYPO3_DB']
Jan Helke
 
PHP BASIC PRESENTATION
PHP BASIC PRESENTATIONPHP BASIC PRESENTATION
PHP BASIC PRESENTATION
krutitrivedi
 
Phl mongo-philly-tornado-2011
Phl mongo-philly-tornado-2011Phl mongo-philly-tornado-2011
Phl mongo-philly-tornado-2011
hangxin1940
 
JWT - Sécurisez vos APIs
JWT - Sécurisez vos APIsJWT - Sécurisez vos APIs
JWT - Sécurisez vos APIs
André Tapia
 
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
Alberto Perdomo
 
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + ThymeleafDSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf
Tim Donohue
 
Extending eZ Platform v2 with Symfony and React
Extending eZ Platform v2 with Symfony and ReactExtending eZ Platform v2 with Symfony and React
Extending eZ Platform v2 with Symfony and React
eZ Systems
 
iOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful BackendiOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful Backend
Stefano Zanetti
 
Immutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS LambdaImmutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS Lambda
AOE
 
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha
 
Introduction to Advanced Custom Fields
Introduction to Advanced Custom FieldsIntroduction to Advanced Custom Fields
Introduction to Advanced Custom Fields
Zero Point Development
 
Expressjs
ExpressjsExpressjs
Symfony3 w duecie z Vue.js
Symfony3 w duecie z Vue.jsSymfony3 w duecie z Vue.js
Symfony3 w duecie z Vue.js
X-Coding IT Studio
 
About Data::ObjectDriver
About Data::ObjectDriverAbout Data::ObjectDriver
About Data::ObjectDriver
Yoshiki Kurihara
 
Sql killedserver
Sql killedserverSql killedserver
Sql killedserver
ColdFusionConference
 
Active scripting
Active scriptingActive scripting
Active scripting
Makoto Kato
 
Advanced WordPress Development Environments
Advanced WordPress Development EnvironmentsAdvanced WordPress Development Environments
Advanced WordPress Development Environments
Beau Lebens
 
Multi Tenancy With Python and Django
Multi Tenancy With Python and DjangoMulti Tenancy With Python and Django
Multi Tenancy With Python and Django
scottcrespo
 
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
Creating REST Applications with the Slim Micro-Framework by Vikram VaswaniCreating REST Applications with the Slim Micro-Framework by Vikram Vaswani
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
vvaswani
 

What's hot (20)

CouchDB for Web Applications - Erlang Factory London 2009
CouchDB for Web Applications - Erlang Factory London 2009CouchDB for Web Applications - Erlang Factory London 2009
CouchDB for Web Applications - Erlang Factory London 2009
 
Bye bye $GLOBALS['TYPO3_DB']
Bye bye $GLOBALS['TYPO3_DB']Bye bye $GLOBALS['TYPO3_DB']
Bye bye $GLOBALS['TYPO3_DB']
 
PHP BASIC PRESENTATION
PHP BASIC PRESENTATIONPHP BASIC PRESENTATION
PHP BASIC PRESENTATION
 
Phl mongo-philly-tornado-2011
Phl mongo-philly-tornado-2011Phl mongo-philly-tornado-2011
Phl mongo-philly-tornado-2011
 
JWT - Sécurisez vos APIs
JWT - Sécurisez vos APIsJWT - Sécurisez vos APIs
JWT - Sécurisez vos APIs
 
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
 
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + ThymeleafDSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf
 
Extending eZ Platform v2 with Symfony and React
Extending eZ Platform v2 with Symfony and ReactExtending eZ Platform v2 with Symfony and React
Extending eZ Platform v2 with Symfony and React
 
iOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful BackendiOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful Backend
 
Immutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS LambdaImmutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS Lambda
 
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
 
Introduction to Advanced Custom Fields
Introduction to Advanced Custom FieldsIntroduction to Advanced Custom Fields
Introduction to Advanced Custom Fields
 
Expressjs
ExpressjsExpressjs
Expressjs
 
Symfony3 w duecie z Vue.js
Symfony3 w duecie z Vue.jsSymfony3 w duecie z Vue.js
Symfony3 w duecie z Vue.js
 
About Data::ObjectDriver
About Data::ObjectDriverAbout Data::ObjectDriver
About Data::ObjectDriver
 
Sql killedserver
Sql killedserverSql killedserver
Sql killedserver
 
Active scripting
Active scriptingActive scripting
Active scripting
 
Advanced WordPress Development Environments
Advanced WordPress Development EnvironmentsAdvanced WordPress Development Environments
Advanced WordPress Development Environments
 
Multi Tenancy With Python and Django
Multi Tenancy With Python and DjangoMulti Tenancy With Python and Django
Multi Tenancy With Python and Django
 
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
Creating REST Applications with the Slim Micro-Framework by Vikram VaswaniCreating REST Applications with the Slim Micro-Framework by Vikram Vaswani
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
 

Similar to Extending eZ Platform 2.x with Symfony and React

Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
Francois Zaninotto
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
Fabio Franzini
 
Hexagonal architecture in PHP
Hexagonal architecture in PHPHexagonal architecture in PHP
Hexagonal architecture in PHP
Paulo Victor Gomes
 
RichFaces 4: Rich Ajax Components For Your JSF Applications
RichFaces 4: Rich Ajax Components For Your JSF ApplicationsRichFaces 4: Rich Ajax Components For Your JSF Applications
RichFaces 4: Rich Ajax Components For Your JSF Applications
Max Katz
 
An insight to microsoft platform
An insight to microsoft platformAn insight to microsoft platform
An insight to microsoft platform
Confiz
 
Ajax Applications with JSF 2 and New RichFaces 4 - TSSJS
Ajax Applications with JSF 2 and New RichFaces 4 - TSSJSAjax Applications with JSF 2 and New RichFaces 4 - TSSJS
Ajax Applications with JSF 2 and New RichFaces 4 - TSSJS
Max Katz
 
REST easy with API Platform
REST easy with API PlatformREST easy with API Platform
REST easy with API Platform
Antonio Peric-Mazar
 
Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011
Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011
Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011
Max Katz
 
Module, AMD, RequireJS
Module, AMD, RequireJSModule, AMD, RequireJS
Module, AMD, RequireJS
偉格 高
 
sMash at May NYPHP UG
sMash at May NYPHP UGsMash at May NYPHP UG
sMash at May NYPHP UG
Project Zero
 
GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App Engine
Yared Ayalew
 
Building Web Apps with Express
Building Web Apps with ExpressBuilding Web Apps with Express
Building Web Apps with Express
Aaron Stannard
 
Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011
Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011
Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011
Max Katz
 
nodejs_at_a_glance.ppt
nodejs_at_a_glance.pptnodejs_at_a_glance.ppt
nodejs_at_a_glance.ppt
WalaSidhom1
 
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF SummitAjax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
Max Katz
 
JS Essence
JS EssenceJS Essence
JS Essence
Uladzimir Piatryka
 
Titanium appcelerator my first app
Titanium appcelerator my first appTitanium appcelerator my first app
Titanium appcelerator my first app
Alessio Ricco
 
RichFaces 4 webinar #1: Everything You Need To Know
RichFaces 4 webinar #1: Everything You Need To KnowRichFaces 4 webinar #1: Everything You Need To Know
RichFaces 4 webinar #1: Everything You Need To Know
Max Katz
 
RichFaces 4 webinar #2: RichFaces 3 toRichFaces 4
RichFaces 4 webinar #2: RichFaces 3 toRichFaces 4RichFaces 4 webinar #2: RichFaces 3 toRichFaces 4
RichFaces 4 webinar #2: RichFaces 3 toRichFaces 4
Max Katz
 
WordPress Internationalization and Localization - WordPress Translation Day 3...
WordPress Internationalization and Localization - WordPress Translation Day 3...WordPress Internationalization and Localization - WordPress Translation Day 3...
WordPress Internationalization and Localization - WordPress Translation Day 3...
WordPress Trivandrum
 

Similar to Extending eZ Platform 2.x with Symfony and React (20)

Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Hexagonal architecture in PHP
Hexagonal architecture in PHPHexagonal architecture in PHP
Hexagonal architecture in PHP
 
RichFaces 4: Rich Ajax Components For Your JSF Applications
RichFaces 4: Rich Ajax Components For Your JSF ApplicationsRichFaces 4: Rich Ajax Components For Your JSF Applications
RichFaces 4: Rich Ajax Components For Your JSF Applications
 
An insight to microsoft platform
An insight to microsoft platformAn insight to microsoft platform
An insight to microsoft platform
 
Ajax Applications with JSF 2 and New RichFaces 4 - TSSJS
Ajax Applications with JSF 2 and New RichFaces 4 - TSSJSAjax Applications with JSF 2 and New RichFaces 4 - TSSJS
Ajax Applications with JSF 2 and New RichFaces 4 - TSSJS
 
REST easy with API Platform
REST easy with API PlatformREST easy with API Platform
REST easy with API Platform
 
Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011
Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011
Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011
 
Module, AMD, RequireJS
Module, AMD, RequireJSModule, AMD, RequireJS
Module, AMD, RequireJS
 
sMash at May NYPHP UG
sMash at May NYPHP UGsMash at May NYPHP UG
sMash at May NYPHP UG
 
GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App Engine
 
Building Web Apps with Express
Building Web Apps with ExpressBuilding Web Apps with Express
Building Web Apps with Express
 
Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011
Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011
Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011
 
nodejs_at_a_glance.ppt
nodejs_at_a_glance.pptnodejs_at_a_glance.ppt
nodejs_at_a_glance.ppt
 
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF SummitAjax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
 
JS Essence
JS EssenceJS Essence
JS Essence
 
Titanium appcelerator my first app
Titanium appcelerator my first appTitanium appcelerator my first app
Titanium appcelerator my first app
 
RichFaces 4 webinar #1: Everything You Need To Know
RichFaces 4 webinar #1: Everything You Need To KnowRichFaces 4 webinar #1: Everything You Need To Know
RichFaces 4 webinar #1: Everything You Need To Know
 
RichFaces 4 webinar #2: RichFaces 3 toRichFaces 4
RichFaces 4 webinar #2: RichFaces 3 toRichFaces 4RichFaces 4 webinar #2: RichFaces 3 toRichFaces 4
RichFaces 4 webinar #2: RichFaces 3 toRichFaces 4
 
WordPress Internationalization and Localization - WordPress Translation Day 3...
WordPress Internationalization and Localization - WordPress Translation Day 3...WordPress Internationalization and Localization - WordPress Translation Day 3...
WordPress Internationalization and Localization - WordPress Translation Day 3...
 

More from Piotr Nalepa

Building Framework Agnostic UI with Web Components
Building Framework Agnostic UI with Web ComponentsBuilding Framework Agnostic UI with Web Components
Building Framework Agnostic UI with Web Components
Piotr Nalepa
 
JAK TESTOWAĆ CZYSTY KOD JAVASCRIPT?
JAK TESTOWAĆ CZYSTY KOD JAVASCRIPT?JAK TESTOWAĆ CZYSTY KOD JAVASCRIPT?
JAK TESTOWAĆ CZYSTY KOD JAVASCRIPT?
Piotr Nalepa
 
Developing native-like Windows application using JavaScript, SSE, eZ Platform...
Developing native-like Windows application using JavaScript, SSE, eZ Platform...Developing native-like Windows application using JavaScript, SSE, eZ Platform...
Developing native-like Windows application using JavaScript, SSE, eZ Platform...
Piotr Nalepa
 
Perfomance w Joomla - Jak przyspieszyć działanie strony?
Perfomance w Joomla - Jak przyspieszyć działanie strony?Perfomance w Joomla - Jak przyspieszyć działanie strony?
Perfomance w Joomla - Jak przyspieszyć działanie strony?
Piotr Nalepa
 
ZOSTAŃ NINJA JOOMLA! DEVELOPEREM Automatyzacja zadań w procesie tworzenia sza...
ZOSTAŃ NINJA JOOMLA! DEVELOPEREM Automatyzacja zadań w procesie tworzenia sza...ZOSTAŃ NINJA JOOMLA! DEVELOPEREM Automatyzacja zadań w procesie tworzenia sza...
ZOSTAŃ NINJA JOOMLA! DEVELOPEREM Automatyzacja zadań w procesie tworzenia sza...
Piotr Nalepa
 
Semantyka w tworzeniu stron www prezentacja
Semantyka w tworzeniu stron www   prezentacjaSemantyka w tworzeniu stron www   prezentacja
Semantyka w tworzeniu stron www prezentacjaPiotr Nalepa
 

More from Piotr Nalepa (6)

Building Framework Agnostic UI with Web Components
Building Framework Agnostic UI with Web ComponentsBuilding Framework Agnostic UI with Web Components
Building Framework Agnostic UI with Web Components
 
JAK TESTOWAĆ CZYSTY KOD JAVASCRIPT?
JAK TESTOWAĆ CZYSTY KOD JAVASCRIPT?JAK TESTOWAĆ CZYSTY KOD JAVASCRIPT?
JAK TESTOWAĆ CZYSTY KOD JAVASCRIPT?
 
Developing native-like Windows application using JavaScript, SSE, eZ Platform...
Developing native-like Windows application using JavaScript, SSE, eZ Platform...Developing native-like Windows application using JavaScript, SSE, eZ Platform...
Developing native-like Windows application using JavaScript, SSE, eZ Platform...
 
Perfomance w Joomla - Jak przyspieszyć działanie strony?
Perfomance w Joomla - Jak przyspieszyć działanie strony?Perfomance w Joomla - Jak przyspieszyć działanie strony?
Perfomance w Joomla - Jak przyspieszyć działanie strony?
 
ZOSTAŃ NINJA JOOMLA! DEVELOPEREM Automatyzacja zadań w procesie tworzenia sza...
ZOSTAŃ NINJA JOOMLA! DEVELOPEREM Automatyzacja zadań w procesie tworzenia sza...ZOSTAŃ NINJA JOOMLA! DEVELOPEREM Automatyzacja zadań w procesie tworzenia sza...
ZOSTAŃ NINJA JOOMLA! DEVELOPEREM Automatyzacja zadań w procesie tworzenia sza...
 
Semantyka w tworzeniu stron www prezentacja
Semantyka w tworzeniu stron www   prezentacjaSemantyka w tworzeniu stron www   prezentacja
Semantyka w tworzeniu stron www prezentacja
 

Recently uploaded

20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 

Recently uploaded (20)

20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 

Extending eZ Platform 2.x with Symfony and React

  • 1. Extending eZ Platform 2.x with Symfony and React With the eZ Platform 2.x development case
  • 2. Who are we? Piotr Nalepa Senior UI Developer @ eZ Systems @sunpietro Maciej Kobus PHP Developer @ eZ Systems
  • 3. The Past The technology decisions, regarding eZ Platform 1.x were made at some point between 2013 and 2014
  • 4. Technology stack in eZ Platform 1.x • PHP 5.6, • Symfony 2.x, • YUI3, • No CSS pre-processors,
  • 5. Developing features in eZ Platform 1.x • Difficult, • Slow, • Lack of programmers resources
  • 7. The goals for eZ Platform 2.x
  • 8. Make editors/developers happy again • Increase app performance, • Eliminate the loading spinner headache, • Make it easy to extend
  • 9. Seeking a right solution
  • 10. The sources of inspirations • Community, • Meetups, • Conferences, • Our own experience
  • 11. AdminUI backend technology stack • PHP 7.1, • PHP Symfony framework 3.x, • Twig templates, • Symfony Forms, • KNP Menu Bundle, • Translations Bundle
  • 12. AdminUI frontend technology stack • JavaScript ES6+, • ReactJS 16.x, • Bootstrap 4.x, • SASS, • Webpack, • AlloyEditor
  • 14. Why ReactJS? • Mechanism of quick UI updates, • Easy way to manage state and data flow, • Easy to implement event handlers, • Paradigm of splitting code into smaller components, • No need to use any extra templating engines, like Handlebars, • Easy to combine with any other JS library or framework (if needed).
  • 15. Why not Web Components? • Difficult to extend existing Web Components when ShadowDOM is on, • Custom Elements are just another way of writing divs with CSS classes, • Not many good practices for Web Components development, • Slow to develop new features.
  • 16. Should you avoid using Web Components? No!
  • 17. Browsers support in theAdminUI The latest version of the following browsers: • Mozilla Firefox, • Google Chrome, • Microsoft Edge, • Safari, • Opera
  • 18. Why only the latest versions of browsers? • Latest JS features, • Latest CSS features, • HTML5 APIs
  • 19. What about mobile devices? The base Admin UI is mobile adapted. The Page Builder component is a desktop-first application, might be adapted later when needed.
  • 21. What can you extend in theAdminUI? Everything in AdminUI can be extended: • with PHP code (in most cases), • with JavaScript/ReactJS (in some cases).
  • 22. Extension points for frontend developers
  • 23. ReactJS modules • Universal Discovery (the only one loaded everywhere), • Sub-Items List, • Multi-File Upload
  • 24. Injecting stylesheets and scripts JS, CSS and Twig files can be injected by using YAML config and tags
  • 25. UI Component classes on backend EzSystemsEzPlatformAdminUiComponentTwigComponent EzSystemsEzPlatformAdminUiComponentScriptComponent EzSystemsEzPlatformAdminUiComponentLinkComponent
  • 26. Sample tag usage tags: - { name: ezplatform.admin_ui.component, group: 'script-head' }
  • 27. Injection points • stylesheet-head • script-head • custom-admin-ui-modules • custom-admin-ui-config • stylesheet-body • script-body • content-edit-form-before • content-edit-form-after • content-create-form-before • content-create-form-after • dashboard-blocks
  • 28. Extending Universal Discovery (function (global, eZ) { eZ = eZ || {}; eZ.adminUiConfig = eZ.adminUiConfig || {}; eZ.adminUiConfig.universalDiscoveryWidget = eZ.adminUiConfig.universalDiscoveryWidget || {}; eZ.adminUiConfig.universalDiscoveryWidget.extraTabs = eZ.adminUiConfig.universalDiscoveryWidget.extraTabs || []; eZ.adminUiConfig.universalDiscoveryWidget.extraTabs.push({ id: 'tab-identifier', title: 'tab-title', iconIdentifier: 'tab-icon-identifier', panel: CustomTabContentPanel, attrs: {} }); })(window, window.eZ);
  • 29. Universal Discovery – result of extension
  • 30. Extending Sub-Items List ReactDOM.render(React.createElement(eZ.modules.SubItems, { handleEditItem, generateLink, parentLocationId: container.dataset.location, sortClauses: {[sortField]: sortOrder}, restInfo: {token, siteaccess}, extraActions: [{ component: SomeCustomComponent, attrs: Object.assign({}, mfuAttrs, { onPopupClose: doSomethingOnClose, }) }], items, contentTypesMap, totalCount: subItemsList.ChildrenCount }), container);
  • 31. Sub-Items List – result of extension
  • 32. Extending Field Type validators – class class CustomFieldTypeValidator extends global.eZ.BaseFieldValidator { validateValue(event) { return { isError: false, errorMessage: '' }; } }
  • 33. Extending Field Type validators – implementation const validator = new CustomFieldTypeValidator({ classInvalid: 'is-invalid', fieldSelector: '.ez-field-edit--custom-field-type', eventsMap: [ { selector: '.ez-field-edit--custom-field-type input', eventName: 'blur', callback: 'validateValue', errorNodeSelectors: ['.ez-field-edit__label-wrapper'], }, ], }); validator.init(); eZ.fieldTypeValidators = eZ.fieldTypeValidators ? [...eZ.fieldTypeValidators, validator] : [validator];
  • 34. Extension points for backend developers
  • 35. Field Types • Content editing is now powered by Symfony Forms, • Developers have to provide mapping service between repository fieldtype and Symfony Forms, • Templating is easier, • Customizable via EventListeners, DataTransformers, Type Extensions etc.
  • 36. Field Types in YAML tags: - { name: ez.fieldFormMapper.definition, fieldType: ezboolean } - { name: ez.fieldFormMapper.value, fieldType: ezboolean }
  • 37. Field Types in PHP class PageFormMapper implements FieldValueFormMapperInterface { public function mapFieldValueForm(FormInterface $fieldForm, FieldData $data) { $fieldDefinition = $data->fieldDefinition; $formConfig = $fieldForm->getConfig(); $names = $fieldDefinition->getNames(); $label = $fieldDefinition->getName($formConfig->getOption('mainLanguageCode')) ?: reset($names); $fieldForm->add( $formConfig->getFormFactory()->createBuilder()->create('value', PageFieldType::class, [ 'required' => $fieldDefinition->isRequired, 'label' => $label, ] ) ->setAutoInitialize(false) ->getForm() ); } }
  • 38. ExtendingApplication Menu The extension point is based on KNP Menu bundle. It uses Event Listeners to extend existing menus.
  • 39. ExtendingApplication Menu class ConfigureMainMenuListener implements TranslationContainerInterface { public function onMenuConfigure(ConfigureMenuEvent $event) { $root = $event->getMenu(); $options = $event->getOptions(); // ... $root->addChild(self::ITEM_PAGE, [ 'extras' => [ 'icon' => 'content-list', 'translation_domain' => 'ezplatform_page_builder_menu', 'routes' => [ 'ezplatform.page_builder.location_preview', 'ezplatform.page_builder.url_preview', ], ], ]); } }
  • 42. Adding new tabs – the YAML code EzSystemsEzPlatformAdminUiTabLocationViewContentTab: public: true autowire: true arguments: $siteAccessLanguages: '$languages$' tags: - { name: ezplatform.tab, group: location-view }
  • 43. Adding new tabs – the Twig code {{ ez_platform_tabs('location-view', { 'content': content, 'location': location }, '@EzPlatformAdminUi/parts/tab/locationview.html.twig') }}
  • 44. Other approaches of extendingAdminUI • Overriding Twig templates, • Overriding service definitions, • Compiler passes, • Bundle's extension class, • Semantic configuration, • Event listeners
  • 45. What else? • Custom Tags in the rich text editor, • Notifications API
  • 46. Performance comparison – Login page 1.x
  • 47. Performance comparison – Login page 2.x
  • 48. Login page summary eZ Platform 1.x eZ Platform 2.x Requests 158 7 Download size 6.5M 608KB HTML load time 3.5s 681ms Page ready time 16.13s 715ms
  • 49. The Login page loads almost 23x faster in 2.x!
  • 50. Performance comparison – Location view 1.x
  • 51. Performance comparison – Location view 2.x
  • 52. Location page summary eZ Platform 1.x eZ Platform 2.x Requests 190 22 Download size 6.7M 2.2M HTML load time 24.6s 2.2s Page ready time 40.99s 2.69s
  • 53. The Location page loads almost 16x faster in 2.x!
  • 54. Who are we? Piotr Nalepa Senior UI Developer @ eZ Systems @sunpietro Maciej Kobus PHP Developer @ eZ Systems