You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor ReactInjectPlugin to include MsApplicationTileImage as a nullable parameter in the constructor. Introduce a new Gallery block for product images with image preloading functionality. Update README.md with JavaScript optimization configuration details and add support for base64 image encoding in product configuration. Enhance tests with shared mock classes to streamline testing process.
To optimize JavaScript performance with existing Magento JS no JS changes needed!!, configure the following settings:
42
+
43
+
**Important:** This module uses native Magento JavaScript methods and APIs. No custom JavaScript modifications are required - all optimizations work with Magento's existing JavaScript implementation out of the box. The module leverages Magento's built-in JavaScript functionality (`requirejs`, `mage/requirejs/mixins.js`, `requirejs-config.js`, etc.) without replacing or modifying core Magento JS files. The module leverages Magento's built-in JavaScript functionality (`requirejs`, `mage/requirejs/mixins.js`, `requirejs-config.js`, etc.) without replacing or modifying core Magento JS files.
44
+
45
+
### 1. Move JS to Bottom (Defer JS)
46
+
Enable the module's "Defer JS" feature to move JavaScript files to the bottom of the page for better performance. Scripts with `no-defer` attribute are preserved in their original position.
47
+
48
+
**Via Admin Panel:**
49
+
- Go to: Stores > Configuration > React-Luma integration > Configuration > Magento JS configuration
50
+
- Set "Defer JS (Move Scripts to Bottom)" to "Yes"
- Add `?defer-js=true` to any URL to enable temporarily
61
+
- Add `?defer-js=false` to disable temporarily
62
+
63
+
### 2. Disable JavaScript Bundling (!Important)
64
+
**Important:** Disable Magento's JavaScript bundling to prevent conflicts and ensure proper script loading order.
65
+
66
+
**Why disable bundling?**
67
+
Magento's JavaScript bundling or any other MAgento bundlings creates large combined JavaScript files that block page rendering and increase blocking time. When bundling is enabled:
68
+
- Multiple JavaScript files are combined into large bundles that must be downloaded and parsed before the page can become interactive
69
+
- This increases **Total Blocking Time (TBT)** and delays **Time to Interactive (TTI)**
70
+
- Large bundles prevent parallel script loading and caching optimization
71
+
- Scripts that could load asynchronously are forced to load synchronously in the bundle
72
+
- Individual script updates require re-downloading the entire bundle
73
+
74
+
By disabling bundling:
75
+
- Scripts can load in parallel, reducing blocking time
76
+
- Individual scripts can be cached independently
77
+
- Smaller files load faster and parse quicker
78
+
- Better browser caching - only changed scripts need to be re-downloaded
0 commit comments