How Can I Resolve a RequireJS Alias in Magento 2? A quick command line that will, usually, resolve those RequireJS map/shim/alias things that often obscure where a file lives in Magento 2. Spoilers find vendor/magento/ -name requirejs-config.js -exec grep addToCart '{}' +
astorm
While KnockoutJS bills itself as an MVVM (model, view, view model) framework, PHP developers will find the model portion a little thin. KnockoutJS itself has no native concept of data storage, and like many modern javascript frameworks it was designed to work best with
astorm
I was investigating Magento 2’s TinyMCE implementation the other day, and came across this #File: vendor/magento//magento2-base/lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js define([ 'jquery', 'underscore', 'tinymce', 'mage/translate', 'prototype', 'mage/adminhtml/events', 'mage/adminhtml/browser' ], function(jQuery, _, tinyMCE) [...]
astorm
Before we can continue our exploration of Magento's advanced javascript features, we need to take a crash course in KnockoutJS. KnockoutJS bills itself as a javascript MVVM system, and its the dominant DOM manipulation framework in Magento 2.
astorm
Magento 2, KnockoutJS ViewModels, and Scope Binding A self answer from me over on the Magento StackExchange. The short version – Magento applies knockout bindings without a default view model. The Magento_Ui/js/core/app module/program, embeded via x-magento-init, adds view model objects to the uiRegistry. Finally, Magento has [...]
astorm
Magento 2’s core javascript library ships with a basic implementation of a class based object system, and the uiComponent feature uses these classes and objects extensively. The base class is the Magento_Ui/js/lib/core/class module/object/function, and you create a new instance of the class using javascript build-in new keyword. [...]
astorm
Today we're starting a new series that will cover advanced Javascript systems in Magento 2. This series is sponsored by my patreon campaign. If you like what you see here, please consider donating to keep the tutorials coming.
astorm
KnockoutJS: What Does Calling applyBindings Without Arguments do? Getting into Magento 2’s KnockoutJS implementation, and being slightly annoyed at the JS world. Knockout’s a great framework, but by positioning themselves as an MVVM framework they create the impression that Knockout itself is enough to contain your entire [...]
astorm
First, lets bask in the awful yet accurate glory of my original title for this quickie: Dependency Injection Argument Specific Instance Objects. If you’ve worked your way through my Magento 2 Object Manager series, you know its possible to tell Magento’s object system that a particular object should be instantiated every time [...]
astorm
Rackspace Magento Hosting Post Mortem – Dev Notes Rackspace has fallen a long way from the days of the defacto preferred Magento host.
astorm
The short version: I've started a Patreon. Donating will help me take on less consulting projects, giving me more time to write, which means I can start diving into the new features of Magento 2.
astorm
Magento 2 Mock Fixing Speaking of Vinai, here’s a nice how to on adjusting Magento’s test mocks, and then some good typing on what would really fix them.
astorm
Magento’s documentation tells you to run tests with the following php bin/magento dev:tests:run unit This isn’t wrong, but it pretty time consuming. You’re running every test in the suite. This one liner will let you run an individual test vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist [...]
astorm
Today's a slight change of pace. We're going to a review a new Magento 2 book, Theme Web Page Assets: Getting Stuff Done with Magento 2.
astorm
Today we're going to cover a few of the advanced features of Magento's routing system, and discuss the history of some seemingly acute sharp edges. While all the techniques available in this article may not be the best way to achieve your goals, as
astorm
Magento 2: Set a PHP umask It sounds like the latest version of Magento adds the ability to set a umask for PHP, which means another barrier to getting Magento up and running in industry standard, mod_php system (i.e. shared hosting and your laptop) has been knocked down. Looking forward to giving this a try when I have a moment. I know [...]
astorm
Now that we know how to create Access Control List Rules, and how to generate Admin Menu Items with Magento 2's CSFR protection, we're ready to create an MVC/MVVM URL endpoint (i.e. an HTML page) in Magento 2's admin.
astorm
Magento 2: Sort Order gets Weird for “Around” Plugins Interesting bit of insight from Anton Kril on plugin firing order. My naive assumption on how this would work was All before plugins fire The around plugin chaining happens All after plugins fire However, based on what Anton’s said here, it sounds like an around [...]
astorm
If you grab the latest version of pestle (updated minutes ago) you should be able to use the following set of commands to create a base module with a working admin route. $ pestle.phar generate_module Pulsestorm HelloAdminPestle2 0.0.1 $ php bin/magento module:enable Pulsestorm_HelloAdminPestle2 $ php bin/magento setup:upgrade $ [...]
astorm
Magestead – The Vagrant Solution for Magento Developers Magestead just released version 2.0, with support for Magento 2. Another vagrant box to checkout if you’re looking for a way to get a sane Magento 2 enviornment up and running.
astorm