Top Banner
17

Mage Titans - Magento 2 Frontend Framework - UI Components

Jan 11, 2017

Download

Internet

vkorotun
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Mage Titans - Magento 2 Frontend Framework - UI Components
Page 2: Mage Titans - Magento 2 Frontend Framework - UI Components

Building pretty anything with Magento 2 frontend framework

Vitaliy Korotun, Magento, Architect

complex forms

UI Components

Page 3: Mage Titans - Magento 2 Frontend Framework - UI Components

853 PRs closed and 277+1 open

Open-source software may be developed in a collaborative public manner

Page 4: Mage Titans - Magento 2 Frontend Framework - UI Components

JS: 386 VS 12KPHP: 12K VS 24KXML: 4K VS 4K

Files

Page 5: Mage Titans - Magento 2 Frontend Framework - UI Components

JS: 165K VS 250KPHP: 930K VS 1.8MXML: 915K VS 727K

LOC

Page 6: Mage Titans - Magento 2 Frontend Framework - UI Components

Standardization

MODULAR RequireJS

GRANULAR 386 VS 12K

CONFIGURABLE RequireJS

EXTENSIBLE RequireJS + Module

Interceptors

REUSABLE UI Components + (no

inline JS)

DI RequireJS +

Module Interceptors

aka mixins

Page 7: Mage Titans - Magento 2 Frontend Framework - UI Components

Sync

Async

Shared

Private

Server-side

Client-side

Classic

Single Page

One-Flush

Progressive

Backend

Storefront

PHTML

(X)HTML

Unification

AND

Page 8: Mage Titans - Magento 2 Frontend Framework - UI Components

WHAT

WHERE

WHEN

devdocs.magento.comDevelopers -> UI Components Guide

Page 9: Mage Titans - Magento 2 Frontend Framework - UI Components

WHAT

WHERE

WHEN

4400 vs 19403

everywhere

anytime

Page 10: Mage Titans - Magento 2 Frontend Framework - UI Components

IsolationNo standard <form> tag

Each component instance in separate namespace

Bare HTML includes are allowed (“data-form-part” attribute is required)

Page 11: Mage Titans - Magento 2 Frontend Framework - UI Components

Interaction2-way Data Binding (with KnockoutJS)

uiRegistry – is a components locator. Methods: get/set/has/promise

Comprehensive linking capabilities (with links/imports/exports/tracks properties)

Page 12: Mage Titans - Magento 2 Frontend Framework - UI Components

Performance

Collapsed tabs are initializedbut not rendered

JavaScript files bundling

Optimized rendering flow both for forms (>2.1.3) and grids (>2.0.0)

Values updated but not base grid markup

Page 13: Mage Titans - Magento 2 Frontend Framework - UI Components

Extensibility

UIC XML declaration/configuration files merged across all modules and themes

RequireJS “Mixins” (aka Module Interceptors) to customize original modules constructors

$.async to manipulate with DOM within the asynchronous rendering environment

Page 14: Mage Titans - Magento 2 Frontend Framework - UI Components

Down the road

XML Layout

Blocks

PHTML Templates

Inline JavaScript

Course grain JavaScript

XML UIC Layout

UI Components

Unified Templates

Modular JavaScript

Fine grain JavaScript

Page 15: Mage Titans - Magento 2 Frontend Framework - UI Components

Futureability

PHTML | XHTML | TWIG | ELSE

LESS | SASS | POST CSS | ELSE

REACT | ANGULAR2 | AURELIA | ELSE

REQUIREJS | WEBPACK | ELSE

ES6 + NODE JS | NOTHING ELSE

Page 16: Mage Titans - Magento 2 Frontend Framework - UI Components

Q&A

devdocs.magento.com

Vitaliy Korotun, Magento, Architect

Page 17: Mage Titans - Magento 2 Frontend Framework - UI Components