First off, congratulations. It's been a heck of a year so far. Breaking away from eBay, the engineering release of Magento 2, and the coordinated launch of real businesses on your new platform. Most organizations would be lucky to pull off one of these
astorm
Another high level first pass at an important topic for Magento 2 developers. Corrections and clarifications are more than welcome. Magento 2, like Magento 1, has a “web” API. This has nothing to do with the @api notation on classes, methods, and interfaces. The Web API is a way for programmers to programmatically interact [...]
astorm
Another Shell Scripts for M2 Setup This time from Karen over at Web Shop Apps. It’s slower than we’d all like, but things are starting to consolidate around Magento 2 development.
astorm
Shell Script to Install Magento 2 Havne’t tried it yet, but this shell script purports to offer a simplified Magento 2 installer experience. Glad to see these sorts of things bubbling up to the surface.
astorm
Magento Travis Build Starter Travis is a popular, hosted system for automatically creating test environments for open source projects hosted on a GitHub. The word automatic can be a little misleading though – Travis hooks up to the GitHub API, handles spawning new virtual machines (presumably at AWS/EC2), and has a simple domain [...]
astorm
Removing a Block from Magento 2 Layouts I’ve dug into the Magento 2 layout enough to discover that On the PHP level, there are methods for removing/unsetting a block from the layout That these methods are not exposed via the Layout DSL
astorm
If you’ve read previous articles on the subject, you know that every URL in Magento 2 corresponds to a single controller file, and each controller file has a single execute method. This execute method is responsible for returning a “result” object (i.e. an object that implements the [...]
astorm
Thanks to Magento 2’s MVVM approach the traditional responsibilities of a controller object have been pushed into the “view model” layer (i.e. a block’s _prepareLayout method). The main job a controller performs in Magento 2 is to Determine what sort of response is needed (HTML page, JSON, Redirect) Create an [...]
astorm
Magento 2 validates most, if not all, of its XML configuration files via a schema document. If you’re dealing with someone else’s code and you need to jump to the source of a schema problems, here’s a debugging snippet. #File: vendor/magento/framework/Config/Dom.php public function validate($schemaFileName, &$errors [...]
astorm
A quick primer on running Magento 2’s development tests. Most of this is just reworded information from Vinai Kopp guiding me through. If you’re working with the Magento 2 GitHub repository, you can run the project’s unit tests with vendor/bin/phpunit -c dev/tests/unit/phpunit.xml This assumes you’ve copied [...]
astorm
PHP – Object equivalent of array_slice(); PHP’s built in interfaces for advanced object functionality remain a hidden feature of the language that too many developers don’t understand. In this Stack Exchange answer I outline the basics of how Magento 1 uses those interfaces for collection functionality, and why you [...]
astorm
I’m working on a few projects converting old Magento 1 extensions to Magento 2. One extension I was working on had a “frontend area checker” in an observer that would return early if the request didn’t happen on the frontend. Like any good refactoring programmer, rather than spend days trying to piece together why [...]
astorm
Alternate Magento 1 Configuration Model There’s a handful of classes you can’t rewrite in Magento 1, but more modern version of Magento provide a way to slot in your own configuration class. I still wish I lived in the alternate universe where Varien had the resources to take the brilliant parts of Magento 1 and refine them [...]
astorm
One interesting thing about Magento 2’s refactored layout system is how it enables multiple XML trees modifying one global structure object. The layout builder for page objects #File: vendor/magento/framework/View/Page/Builder.php protected function generateLayoutBlocks() { $this->readPageLayout(); return [...]
astorm
Magento 2’s remove Tag Stack Exchange answer covering where Magento 2’s layout remove=“1” attribute tag is implemented. Short version – the block/container reader/scheduler classes look for it, and then tell the scheduler there’s an item to remove from the layout. Then, when the Generator pool builds [...]
astorm
One recent Magento 2 discovery that caught me off guard is, per the dev docs site, the <action/> method tag is depreciated The <action> instruction is deprecated. If the method implementation allows, use the <argument> for <block> or <referenceBlock> to access block public API. Given this, it sort of makes [...]
astorm
I’m starting to get a handle on how Magento 2 renders a layout and how those changes will impact folks to spend their day in layout handle XML files. This one’s mainly for myself – posting it here to get it out of my head. The first step of layout rendering in Magento 2 is still building a “package layout” [...]
astorm
The app/etc/config.php file contains a list of all the modules in Magento that have been enabled/disabled. It’s also the master list for module ordering – i.e. Magento references this file when deciding what order to load configuration files in. The order of modules in app/etc/config.php is, itself, determined by the [...]
astorm
Magento 2: Sequence Gotcha A little bit of the old derp form yours truly. Magento 2’s module.xml file contain a <sequence/> node that acts like the old <depends/> from Magento 1’s app/etc/modules declaration files. There’s a small catch though – in order to make Magento recognize changes to your [...]
astorm
Mage2Katas Screencast demonstrations from Vinai Kopp covering TDD methods in Magento 2. Watching an experienced developer work (the “code katas” approach) can be super useful – it’s one thing to read “you should do X”, but when you watch someone “do X” understanding can rapidly click in.
astorm