Section 2: Magento JavaScript Basics (25%) Previous Section | Next Section 2.1 Demonstrate understanding of the modular structure of Magento Demonstrate understanding of the JavaScript file organization in Magento What file structure is used to organize JavaScript modules? Where does Magento locate a module’s JavaScript file? Where does Magento store the JavaScript library? Describe how static content is organized in Magento How does Magento expose a module's static content to the web requests? What are the different ways to deploy static content? 2.2 Describe how to use JavaScript modules in Magento Use requirejs-config.js files to create JavaScript customizations How do you ensure that a module will be executed before other modules? How can an alias for a module be declared? What is the purpose of requirejs-config.js callbacks? Describe different types of Magento JavaScript modules Plain modules jQuery UI widgets UiComponents 2.3 Demonstrate ability to execute JavaScript modules Demonstrate the ability to use the data-mage-init attribute to run JavaScript modules What is the purpose and syntax of the data-mage-init attribute? How is it used to execute JavaScript modules? Demonstrate the ability to use text/x-magento-init scripts to execute JavaScript modules What is the purpose and syntax of the text/x-magento-init script tag? What is the difference between the text/x-magento-init and the data-mage-init methods of JavaScript module execution? Describe advanced methods of executing JavaScript modules How do you execute a JavaScript module in an AJAX response and in dynamic code stored in a string? 2.4 Describe jQuery UI widgets in Magento Describe how Magento uses jQuery widgets, and demonstrate an understanding of the $.mage object What is the role of jQuery widgets in Magento? What are typical widgets? How are Magento jQuery widget modules structured? Describe how Magento executes jQuery widgets How are Magento jQuery widgets executed with data-mage-init and text/x-magento-init? 2.5 Demonstrate ability to customize JavaScript modules Use Magento JavaScript mixins for customizations Describe advantages and limitations of using mixins. What are cases where mixins cannot be used? Describe how to customize jQuery widgets in Magento How can a new method be added to a jQuery widget? How can an existing method of a jQuery widget be overridden? What is the difference in approach to customizating jQuery widgets compared to other Magento JavaScript module types?