This entry is part 12 of 13 in the series Magento 2 UI Components. Earlier posts include Magento 2: Introducing UI Components, Magento 2: Simplest UI Component, Magento 2: Simplest UI Knockout Component, Magento 2: Simplest XSD Valid UI Component, Magento 2: ES6 Template Literals, Magento 2: uiClass Data Features, Magento 2: UI Component [...]
astorm
In <a href="http://magento-quickies.alanstorm.com/post/147052601955/magentos-knockoutjs-templates-arent-knockoutjs“>two previous articles, we talked a bit about Magento’s remote Knockout.js template files, and their customer tags/attributes. I’ve been doing a bit more exploring around this feature, and [...]
astorm
Tips for Running Magento 2’s Test Suite A quick writeup of some issues you’ll run into if you’re trying to run Magento’s test suite.
astorm
Magento CE 2.1.3 database diagram – Anna Völkl Community Stalwart @rescueann just released the Magento 2 follow-up to her popular Magento 1 database diagram post. Beyond the super useful utility of having something like this pre-generated, Ann’s also spent a significant amount of time grouping related tables together. Even [...]
astorm
Documentation and Code Quality As the above StackExchange answer attests to, I finally know what the Magento_Ui/js/lib/knockout/extender/bound-nodes registry is for. If you’ve got a view model, it lets you figure out which nodes that model is bound to via the scope Knockout.js binding. Part of the reason it was so hard to get an [...]
astorm
I was helping a developer recently, (Want this sort of help? My Patreon beckons), who wanted to know how Magento determines if /pub needs to be on the end of URLs for static files. The short version? The default folders can be found here #File: vendor/magento/framework/App/Filesystem/DirectoryList.php public static function [...]
astorm
If you’ve been reading through my Advanced Javascript, UI Components, and uiElement Internals series, you’re aware that Magento have extended the Knockout.js template system such that Templates can be Loaded via ajax/HTTP Knockout’s “tag-less” bindings have tag equivalents The remote HTTP templates are a [...]
astorm
Back when Magento 2 was released, I noticed the much touted API didn’t have a method for fetching a product’s canonical URL. A year later that’s still the case. Magento’s reasoning and response, both from an engineering perspective and a product perspective points to a big cultural problem that goes beyond this [...]
astorm
Magento 2: Are uiClass/uiElement Imports/Exports order sensitive? The answer is mostly no. Imports/Exports values are fetched via the uiRegistry.get’s asynchronous callback method which means if the imports or exports attempts to access an item that doesn’t exist yet in the registry, the system will “wait” until [...]
astorm
Magento 2: Extract Currently Selected Product ID or SKU on Product Page Rian managed to dig up most of the data embedded in a Magento 2 product listing page that would let a programmer extract the Product ID of the currently selected product on a configurable product page. I threw together this quick RequireJS program that shows how you [...]
astorm
If you’re following along with my UI Component and uiElement Internals series, you know about Magento’s uiRegistry module. You can use this module to fetch the scoped Knockout.js view models by registered name requirejs(['uiRegistry'], function(reg){ console.log( reg.get('customer') ); }); or by using a callback function to [...]
astorm
That I’m posting this as a quickie probably points to the amount of time I’m spending with Magento 2’s internals vs. building out client sites, but I still haven’t internalized that Magento moved the the Design configuration options from Stores -> Configuration -> Design to Content -> Design -> [...]
astorm
Time to Report Bug: Two Weeks Over on alanstorm.com we’re in the middle of a series covering the internal implementation of uiElement objects. This series was prompted by some strange behavior in the default value system w/r/t observable objects. The linked bug report covers the details of why this happens, and why it’s a [...]
astorm
This entry is part 6 of 6 in the series Magento 2: uiElement Internals. Earlier posts include Magento 2: Defaults, uiElement, Observables, and the Fundamental Problem of Userland Object Systems, Magento 2: Javascript Primer for uiElement Internals, Tracing Javascript's Prototype Chain, Magento 2: uiElement Standard Library Primer, and [...]
astorm
Be Careful with the “new-less” form of uiClass object instantiation Last time we said Magento’s uiClass based objects don’t require the new keyword. This is true. However, when you’re using the inheritance features of these objects its possible to supply a custom constructor. If you do this, and your custom [...]
astorm
This entry is part 5 of 6 in the series Magento 2: uiElement Internals. Earlier posts include Magento 2: Defaults, uiElement, Observables, and the Fundamental Problem of Userland Object Systems, Magento 2: Javascript Primer for uiElement Internals, Tracing Javascript's Prototype Chain, and Magento 2: uiElement Standard Library Primer. [...]
astorm
This entry is part 4 of 6 in the series Magento 2: uiElement Internals. Earlier posts include Magento 2: Defaults, uiElement, Observables, and the Fundamental Problem of Userland Object Systems, Magento 2: Javascript Primer for uiElement Internals, and Tracing Javascript's Prototype Chain. Later posts include Magento 2: Using the uiClass [...]
astorm
In doing research for the new uElement Internals series, I discovered that Magento’s UI Component object constructors (uiClass, uiElement, uiCollection, etc) can create new objects without the use of the new keyword. //both return a new `UiElement` object object = new UiElement; object = UiElement(); This makes these constructor [...]
astorm
This entry is part 3 of 6 in the series Magento 2: uiElement Internals. Earlier posts include Magento 2: Defaults, uiElement, Observables, and the Fundamental Problem of Userland Object Systems, and Magento 2: Javascript Primer for uiElement Internals. Later posts include Magento 2: uiElement Standard Library Primer, Magento 2: Using the [...]
astorm
This entry is part 2 of 6 in the series Magento 2: uiElement Internals. Earlier posts include Magento 2: Defaults, uiElement, Observables, and the Fundamental Problem of Userland Object Systems. Later posts include Tracing Javascript's Prototype Chain, Magento 2: uiElement Standard Library Primer, Magento 2: Using the uiClass Object [...]
astorm