Türchen 05: What’s new in Magento 2?

I would like with a small disclaimer, to point out that I’m not connected in any way to Magento. So every information in here are my personal thoughts, might change due to some changes from Magento as the scope is still not final, or even be wrong as I trusted the wrong sources or made the wrong assumptions. So feel free to blame or quote me, but don’t take this as an official information neither from Magento nor from my employer Sitewards.

History

As you might already know: The final version of Magento 2 is at the time of publishing the article not released yet. But when was the first time you heard from Magento 2? On my research I stumbled over the keynote of Yoav Kutner, the former CTO of Magento, announcing a new version of Magento at the keynote of Developers Paradise 2010. If you want to watch this iconic moment there’s even a recording available on Youtube:

Ok so that’s over 4 years ago, but why isn’t it released yet? What happened in this time? A major date in the history of Magento is definitely the 6th June 2011. On a side note: also known as the release date of Duke Nukem Forever, which has seen the light after 14 years of development. Anyway, on this day eBay acquired 100% of Magento. From an open source developer point of view that was a very shaky situation. That big company, with no experience in open source, takes over our beloved Magento? What will happen? Will it get closed source or even be turned down?

Luckily in the same year in October there was a version control repository made public available. That was the first moment when every developer had the chance to look into the current state of code for Magento 2.

Unfortunately that was the last significant life-sign of Magento 2 for a very long time. The public repository had less activities than new X-Men movies were released. And also announcements got very seldom and silent, expect of some vague timelines which have been postponed from time to time.

I personally remember a Q&A session from a Magento representative at the Developers Paradise in 2013, which was more a question from Magento to the community. Asking us what we think about the event/observer technique, EAV-Model, Services, Plugins or the template engine Twig. So for me it looked like they definitely want to have something new, but when they have conceptual questions like these after all this time, either not much has been done yet, or they’re doing a reset. It was very clear that it’s still a long way to a final Magento 2 release.

But then we had the 4th of October in 2013. Magento made another Magento 2 repository (https://github.com/magento/magento2) publicly available on github. Ok, we had that before, but since then they’re pushing new releases every week. So we can track and see the changes which are going on right now.

So in the following paragraphs I would like to give an overview of the current changes, which could as already mentioned all be changed until the final release. So be patient trying all that 1:1 in your version.

Frontend

The frontend will get an up-to-date technology stack including HTML5 and CSS3. Besides that the CSS files will be generated by a CSS-pre-processor using less which allows easier maintenance and much more reusability of styles.

The JavaScript stack will be updated to use jQuery instead of Prototype and besides that making use of require.js and AMD to manage the dependencies.

Especially CSS3 means also getting rid of Internet Explorer 8 support. Which sounds great from a developer point of view, might also get a problem for shops with more conservative customers. E.g. for B2B shops where it sometimes needs decades to update to a newer (in no way the latest) browser version.

Layout configuration

Also the well-known and at the same amount hated layout configuration gets a lot of updates. One of the biggest disadvantages of this is definitely that these layout.xml files get extremely big. In Magento 2 we’ll have different layout files for each layout-handle which helps a lot to get a better overview of what is actually happening.

The fallbacks mechanism for themes which was already back ported to Magento CE 1.9 is also coming initially from Magento 2. So we’re no longer bound to the hardcoded base/default fallbacks, which allows more modularized themes.

Magento 2 will also get some new XML-elements, one of my favorite is definitely the -handle which is a better replacement for the old core/text_list block which was needed to bundle multiple blocks in one name.

<container name="product.info.extrahint" as="extrahint" label="Product View Extra Hint">
    <container name="product.info.social" label="Product social links container" htmlTag="div" htmlClass="product-social-links" after="product.info.overview">
        <block class="Magento\Catalog\Block\Product\View" name="product.info.addto" as="addto" template="product/view/addto.phtml"/>
        <block class="Magento\Catalog\Block\Product\View" name="product.info.mailto" template="product/view/mailto.phtml"/>
    </container>
</container>

Another very nice new feature is the -handle. While it was previously a pain to move one block from one column into the other, by using an -handle in the one column and the -handle in another, this can now be done in an easy to read and less error prone way.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" label="All Two-Column Layout Pages (Left Column)" design_abstraction="page_layout">
    <body>
        <move element="catalog.leftnav" destination="sidebar.main" before="-"/>



Ein Beitrag von Tobias Zander
Tobias's avatar

Tobias Zander is the CTO at Sitewards in Frankfurt, who specialize in e-commerce solutions. Previously he was well regarded as a freelance consultant and software architect. Over the past years he has built up a development team at Sitewards that thrives to be at the cutting edge of web development. With passion of inspiring people he takes part in and speaks at conferences worldwide. He also publishes articles in a wide range of magazines, several blogs and has written books about web security.

Alle Beiträge von Tobias

Kommentare
olivedev am

I read a news on Magenticians blog that Magento 2 will be using KnockoutJS framework. If that is true, then it will be really cool. I find KnockoutJS really easy to use and implement in projects.

Magento-Neuigkeiten der Wochen 49/50 2014 am

[…] 05: What’s new in Magento2? – geht auf die Änderungen in einem breiten Themenspektrum […]

Flyingmana am

"expect of some vague timelines which have been postponed from time to time." Thats just a myth created by the community, or did you find any evidence of a official mentioned timeline before this year? I dont think you will find one since the eBay took over

Dein Kommentar