Showing results for 
Search instead for 
Did you mean: 

Decoupling of layout definitions

Decoupling of layout definitions

Feature request from EliasZ, posted on GitHub Oct 20, 2014

With the whole new spirit of loosely coupling the Magento 2 code base, maybe a good look can be taken at the layout definitions and its dependencies. For example, opening Magento/Backend/view/adminhtml/layout/default.xml reveals the following definitions which can be moved:

<link src="Magento_Rule::rules.js"/> <!--Magento_Rule can take care of this--> 

The following can be moved to Magento_RequireJS:

    <link src="requirejs/require.js"/>
    <link src="mage/requirejs/resolver.js"/>
<block name="require.js" class="Magento\Backend\Block\Page\RequireJs" template="Magento_Backend::page/js/require_js.phtml" />
<referenceContainer name="after.body.start">
    <block class="Magento\RequireJs\Block\Html\Head\Config" name="requirejs-config"/>

More in after.body.start:

<block class="Magento\Translation\Block\Js" name="translate" template="Magento_Translation::translate.phtml"/> <!--Magento_Translation can take care of this-->

And so forth.

New Member
Status changed to: Investigating
New Member

Comment from verklov, posted on GitHub Nov 08, 2014

Thank you for reporting this issue! We will have to look at this and get back to you once we have an answer.

New Member

Comment from vkorotun, posted on GitHub Nov 10, 2014

Good catch.. Thank you, for the valid suggestion. We are going to resolve this within one of the following sprints.

New Member

Comment from vpelipenko, posted on GitHub Jan 29, 2015

Internal ticket: MAGETWO-30486