Keeping with UI Component form theme but drawing a wider circle, if you take a look at HTML source of a button on a backend Magento 2 HTML form, you’ll see something like the following <button id="back" title="Back" type="button" class="action- scalable back" onclick="location.href = [...]
astorm
Merged Layout schema validation error in Magento 2 A peek at the complexity deep in Magento 2’s layout rendering engine.
astorm
It surprised me that over a year after Magento 2’s introduction I haven’t had an opportunity to create a new form component using the UI Component system. In the extensions and themes I’ve helped folks port over it made a lot more sense to just convert the old PHP rendered HTML to the new extension. When time is money [...]
astorm
For backend UI Components, the rendered x-magento-init JSON argument contains two top level keys: types and components { "*": { "Magento_Ui/js/core/app": { "types": {/*...*/}, "components": {/*...*/} } } } The Magento_Ui/js/core/app module/application uses the data in components to instantiated a nested tree of uiClass based objets and [...]
astorm
mattwellss/magento-composer-autoloader For folks still playing “wait and see” with Magento 2, (i.e. most current Magento systems), and who are using some sort of Composer workflow (not most Magento 1 systems), this is a small autoloader optimization that fixes Magento 1’s selfish “if I try to load someone [...]
astorm
So, over the summer I covered how to invoke a function returning RequireJS modules via an x-magento-init script. Today I discovered there’s a syntax for doing this with an object returning RequireJS module. If you’ve got an x-magento-init that looks like this <script type="text/x-magento-init"> { "*": { [...]
astorm
One of the challenges Magento 2, (and all “full stack” oriented frameworks), face is data synchronization between the front end and the server. Server data will always represent the “source of truth” for any particular piece of data, but good front end developers will always be looking to reduce to number of round [...]
astorm
How to clear billing form validation errors when using Magento UI components A “quick” (har har) answer from me on how to reset a form field’s validation state in the Magento 2 checkout application. This is also a nice example of how, no matter how far we progress with computers doing things for us, it’s always [...]
astorm
A useful code snippet that came out of a discussion on the Patreon slack today. requirejs([ 'Magento_Checkout/js/model/quote', 'Magento_Checkout/js/model/shipping-rate-registry' ], function(quote, rateRegistry){ //get address from quote observable var address = quote.shippingAddress(); //changes the object so observable sees it as [...]
astorm
One the curious/frustrating bits of approaching Magento 2 as a traditional, full-stack Magento 1 developer, is the seemingly incomplete php bin/magento. While this command allows you to clear your Magento cache php bin/magento cache:clean and a command to generate “static content” (front end javascript, css, etc. files not [...]
astorm
Progress continues on No Frills Magento 2 Layout, with Patrons receiving full access to the rough draft and initial source code samples. I just finished the section on Magento 2’s Less handling – basically an update to my article on the same topic last year. Here’s an excerpt that wraps up the section. For folks working [...]
astorm
After update from 2.1.2 to 2.1.3 causes store to redirect to wrong domain · Issue #8245 · magento/magento2 On the other end of the spectrum, it sounds like Magento 2.1.3 broke how the System Configure system handles fallback values. The lack of a clear response from Magento means we don’t know if they consider this new behavior a [...]
astorm
Magento’s response to the uiElement Observable Cloning Problem One of the first responses in Magento 2’s GitHub issues that hasn’t injured my eyes from the eye rolls. More like this please.
astorm
This entry is part 1 of 1 in the series Accelerated Mobile Pages. This is the first post in the series. I’m working on a few articles related to Google’s AMP format, and I’ve noticed one of the big gripes people have with AMP, as well as the AMP CDN that serves content for the Google News carousel, is how it’s [...]
astorm
How to Respond to and Fix A Bug Here’s a small highlight from pestle’s issue tracker. A user ran into a situation I hadn’t considered when I created a command. I wrote my command assuming there wasn’t already a di.xml file in place, or if there was that it would already have a certain set of nodes. This user [...]
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