Category: Programming Quickies
Back in they day, I ran a Tumblr blog named Magento Quickies where I’d post shorter, less in-depth posts about my travels through Magento’s source code. This Programming Quickies categories is the successor to that Tumblr blog. You’ll find all the old Magento Quickies content here, as well as new short posts about programming in general.
This section has its own RSS feed, the old Magento Quickies feed should should be redirecting, and we’re cross posting notifications for new posts over to magento-quickies.tumblr.com. In other words, you shouldn’t need to know any of this, but the duct tape that keeps the internet held together isn’t aging well, so your mileage may vary.
Below you'll find all the Programming Quickies articles on the site,
followed by a chronological listing of the same.
You may also browse the
7
series directly via the following links.
Pestle, Four Steps to Async Iterators, Checking in on OpenMage and Magento in 2020, Text Encoding and Unicode, Shopware's Development Environment, A Sentimental Gen-X Programmer Culls his Tech Books, and, Containers, Containers, Containers.
While PHP production environments have long made use of extra systems like memcache, varnish, and redis, most successful PHP projects also let developers and technically savvy folks drop an archive of files on a server, point the web server at those files, configure the application to point to a traditional RDMS/database, and have a [...]
astorm
Tangentially Magento related: Magento uses the lusitanian/oauth composer package to handle some oAuth related tasks. In addition to the usual “create the cryptic Authorization: headers” code you’d expect to find in an oAuth library, there’s also these two folders of code [...]
astorm
In a typical adminhtml UI Form Component, each individual form element has a corresponding view model object. For text input fields, these view models come from the constructor function returned by the Magento_Ui/js/form/element/abstract RequireJS module. The view model’s value property, an Knockout observable object, contains the [...]
astorm
GitHub – DavidLambauer/awesome-magento2: Curated list of awesome Magento 2 Extensions, Resources and other Highlights I haven’t reviewed these, but a working developer’s take on what makes an “awesome” module is always worth investigating.
astorm
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
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