LokiTheme_LumaComponents

PHP 8.1 - 8.4
Magento 2.4.7 | 2.4.8
CSP Yes
Latest Release 0.0.13

LokiTheme_LumaComponents module

Module for Magento 2 to remove legacy Luma JavaScript and adds JS components or Alpine.js components where needed

Installation

composer require loki-theme/magento2-luma-components
bin/magento module:enable LokiTheme_LumaComponents

What this is

This module removes legacy Luma JavaScript (RequireJS, Knockout.js, jQuery, jQuery UI) and replaces it with custom JavaScript where needed. The following variations for this rewrite exist - taking in mind that this module tries to make as little template override as possible:

  • No JavaScript, just plain HTML and CSS;
  • Simple JavaScript functions;
  • Alpine.js components (with or without custom template);

Currently, the following components are built-in:

  • Messages
  • Cookie notice
  • Top navigation
  • Mobile navigation
  • Top links (customer welcome)
  • Minicart
  • Newsletter subscribe
  • Add-to-cart (product page)
  • Add-to-cart (category page)
  • Add-to-wishlist (category page)
  • Add-to-compare (category page)
  • Tabs (product page)
  • Currency switcher

Make sure to carefully read the docs at https://loki-extensions.com/docs/theme

Support

For getting support, create an Issue under the following project URL:

https://github.com/LokiExtensions/LokiTheme_LumaComponents

Configuration Options

The following options of this module can be configured via the Store Configuration:

Generic settings > Applied Themes
LokiTheme_LumaComponents/general/themes
By applying Loki Theme to a configured theme, its legacy JavaScript will be removed and replaced. Make sure to have tested this properly.
Module Dependencies

The following dependencies are declared in the module its `etc/module.xml` file:

Loki_Base Loki_CssUtils Magento_Backend Magento_Csp Magento_Directory Magento_Store Magento_Theme
Composer details
Magento module name
LokiTheme_LumaComponents
Composer name
loki-theme/magento2-luma-components
Composer version
0.0.13
Default branch
master
Requirements
ext-pcre: *
loki/magento2-base: ^1.0
magento/framework: ^103.0
magento/module-backend: ^102.0
magento/module-csp: ^100.0
magento/module-store: ^101.1
Releases
dev-master#f16bc63205246ded3da5bf109c0b7bb487ac89fb 19 October 2025
0.0.13 19 October 2025
0.0.12 19 October 2025
0.0.11 19 October 2025
0.0.10 19 October 2025
0.0.9 19 October 2025
0.0.8 19 October 2025
0.0.7 19 October 2025
0.0.6 19 October 2025
0.0.5 19 October 2025
0.0.4 19 October 2025
0.0.3 19 October 2025
0.0.2 19 October 2025
Changelog

[0.0.13] - 01 October 2025

Fixed

  • Move HTML hints from LokiTheme_LumaComponents to Loki_Debugger
  • Fix currency switcher breaking store switcher

[0.0.12] - 30 September 2025

Fixed

  • Wipe out customer-section on logout success page

[0.0.11] - 30 September 2025

Fixed

  • Replace redirect script on customer/account/logoutSuccess page
  • Show greeting properly when sectionData has a fullname
  • Add DOM ID to all blocks being converted to Alpine component

[0.0.10] - 24 September 2025

Fixed

  • Fix wrong container name for minicart component type
  • Rename loki.script from container to block to allow caching
  • Add .prevent modifier to @click event handler
  • Rename minicart to minicart-content
  • Move scripts in right loki.script.component container

[0.0.9] - 17 September 2025

Fixed

  • Remove legacy messaging
  • Add new section refresh to add-to-cart components
  • Renew message section when renewing cart section
  • Fix error when customer section is undefined

[0.0.8] - 16 September 2025

Fixed

  • Add wishlist counter to top links
  • Apply LumaTopLinks to both top.links and header.links
  • Set long lifetime on user_allowed_save_cookie cookie
  • Apply right handle names
  • Rename namespaces
  • Update README
  • Multiple add to compare and add to wishlist
  • Simplify add to wishlist with LokiDataPost(element)
  • Fix toggle
  • Skip non-frontend themes in config option
  • Configure applied theme via store config, not DI type
  • Fixes in cookies, minicart, newsletter and styling
  • Cleanup
  • Fix mobile menu
  • Cleanup after merge
  • Add new Loki_Base as dependency and move over common logic

[0.0.7] - 12 September 2025

Fixed

  • Do not display empty minicart
  • WIP with add-to-wishlist
  • Fix cookie notice
  • Simple toggling in layered navigation
  • WIP with add-to-compare

[0.0.6] - 11 September 2025

Fixed

  • Fix messages not being fetched when FPC is enabled
  • Fix inline block

[0.0.5] - 11 September 2025

Fixed

  • Add LokiCookies API and cookie notice
  • Add top links component
  • Add-to-cart for both PDP and PLP
  • Add any layout handle with LokiTheme_LumaComponents_ prefix
  • Reuse loki.alpinejs block name
  • Obviously remove mage/calendar.css
  • Only add component definitions once
  • Update README

[0.0.4] - 10 September 2025

Fixed

  • Add minicart

[0.0.3] - 10 September 2025

Fixed

  • Remove additional legacy JS in checkout
  • Prevent error when message is already removed
  • Add dep with CSP

[0.0.2] - 10 September 2025

Fixed

  • Refactor API for messages and add timeout
  • Rewrite messages from Alpine.js component to plain JS component
  • Turn single click to remove message into double click
  • Add icons to message
  • Failsafe to prevent error
  • Highlight selected menu
  • Alpine.js component for main navigation menu
  • Move component logic from Loki/luma to LokiTheme_LumaComponents
  • Conditionally apply layout handles
  • Move theme config to separate config class
  • Move Alpine CSP and JS removal via layout to LokiTheme_LumaComponents module
  • Move component definitions from constructor to DI XML
  • Move patterns and themes into DI XML
  • Only add x-title and HTML hints in Developer Mode
  • Only apply to configured themes
  • Remove require() script
  • Adding all files to git via Yireo Command

[0.0.1] - 2 September 2025

Added

  • Initial release

Last modified: September 16, 2025