Magento 2 Summary
Me
Anton Kril
Magento 2 Lead Architect
@AntonKril
akril@magento.com
Communication &
Documentation
☞ github.com/magento/
magento2
☞ devdocs.magento.com
☞ community.magento.com
☞ alankent.me
$ composer install
Console Application
$ bin/magento setup:upgrade
Configuration
☞ Configuration file per sub-system (events.xml, cache.xml)
☞ All xml validated
☞ 3 Stages of configuration loading:
➀ primary (app/etc/*)
➁ global (<ModuleDir>/etc/*)
➂ area (<ModuleDir>/etc/<areaCode>/*)
Dependency Injection
class MyClass
{
public function __construct(MagentoFrameworkEventManager $eventManager)
{
$this->eventManager = $eventManager;
}
public function someFunc()
{
// …
$this->eventManager->dispatch(‘some_event’);
// …
}
}
Interception
Ability to observe public method calls:
class eventManagerPlugin
{
public function beforeDispatch(EventManager $subject, $eventName, $arguments)
{
$this->log->put(“Event ‘$eventName’ was dispatched“);
}
}
Service Contracts
Public API of a module:
namespace MagentoCustomerApi;
interface AccountManagementInterface
{
public function createAccount(CustomerInterface $customer, $password = null);
public function activate($email, $confirmationKey);
public function changePassword($email, $currentPassword, $newPassword);
}
WebAPI
Easy WebAPI creation (REST & SOAP)
<routes>
<route url="/V1/customerGroups/:id" method="GET">
<service class="MagentoCustomerApiGroupRepositoryInterface" method="getById"/>
<resources>
<resource ref="Magento_Customer::group"/>
</resources>
</route>
</routes>
Themes
☞ More granular templates
☞ View file fallback
☞ LESS imports
UI Library
RequireJS Loader
define(
[
'Magento_Checkout/js/model/address-converter'
],
function(addressConverter) {
"use strict";
return function(addressData) {
return addressConverter.formAddressDataToQuoteAddress(addressData);
};
}
);
JS Mixins
var config = {
mixins: {
‘Magento_Checkout/js/model/address-converter’: {
‘My_Module/js/model/address-converter-mixin’: true
}
}
};
UI Components
☞ JS & CSS & HTML
☞ New forms & grids in admin and storefront
PageCache
☞ built-in cache in CE
☞ Varnish support in CE
☞ Private content rendered in browser
Asynchronous processing
☞ delayed execution
☞ ee-only
Magento 2 Seminar - Anton Kril - Magento 2 Summary

Magento 2 Seminar - Anton Kril - Magento 2 Summary