Loki_Base
Core
PHP
8.1 - 8.4
Magento
2.4.7 | 2.4.8
CSP
Yes
Integration Tests
3
PHPStan
5
Magento PHPCS
7
Latest Release
1.3.0
This Magento 2 module forms the base of various other Loki solutions: Loki Checkout, Loki Admin Components, Loki Theme for Luma. It adds Alpine.js to the page, adds container-blocks for other scripts to be added, it adds its own frontend messaging component and its adds an Alpine store for both localStorage and messaging.
Notice: Most likely you do not install this module on its own, but require it through other modules.
Installation
composer require loki/magento2-base
bin/magento module:enable Loki_Base
Current status
Support
For getting support, create an Issue under the following project URL:
https://github.com/LokiExtensions/Loki_Base
Configuration Options
The following options of this module can be configured via the Store Configuration:
Messages > Timeout
loki_base/messages/timeout
Whenever messages are popping up, they are automatically after this timeout. This is by default 5000ms (5 seconds).
Module Dependencies
The following dependencies are declared in the module its `etc/module.xml` file:
Loki_CssUtils
Magento_Backend
Magento_Csp
Magento_Directory
Magento_Store
Magento_Theme
Composer details
Magento module name
Loki_BaseComposer name
loki/magento2-baseComposer version
1.3.0
Default branch
master
Requirements
ext-pcre: *
loki/magento2-css-utils: ^1.0
magento/framework: ^103.0
magento/module-backend: ^102.0
magento/module-store: ^101.0
php: >=8.2 <8.6
Releases
| 1.3.0 | 16 September 2026 |
| 1.2.2 | 16 September 2026 |
| 1.2.1 | 16 September 2026 |
| 1.2.0 | 16 September 2026 |
| 1.1.29 | 16 September 2026 |
| 1.1.28 | 16 September 2026 |
| 1.1.27 | 16 September 2026 |
| 1.1.26 | 16 September 2026 |
| 1.1.25 | 16 September 2026 |
| 1.1.24 | 16 September 2026 |
| 1.1.23 | 16 September 2026 |
| 1.1.22 | 16 September 2026 |
| 1.1.21 | 16 September 2026 |
| 1.1.20 | 16 September 2026 |
| 1.1.19 | 16 September 2026 |
| 1.1.18 | 16 September 2026 |
| 1.1.17 | 16 September 2026 |
| 1.1.16 | 16 September 2026 |
| 1.1.15 | 16 September 2026 |
| 1.1.14 | 16 September 2026 |
| 1.1.13 | 16 September 2026 |
| 1.1.12 | 16 September 2026 |
| 1.1.11 | 16 September 2026 |
| 1.1.10 | 16 September 2026 |
| 1.1.9 | 16 September 2026 |
| 1.1.8 | 16 September 2026 |
| 1.1.7 | 16 September 2026 |
| 1.1.6 | 16 September 2026 |
| 1.1.5 | 16 September 2026 |
| 1.1.4 | 16 September 2026 |
| 1.1.3 | 16 September 2026 |
| 1.1.2 | 16 September 2026 |
| 1.1.1 | 16 September 2026 |
| 1.1.0 | 16 September 2026 |
| 1.0.4 | 16 September 2026 |
| 1.0.3 | 16 September 2026 |
| 1.0.2 | 16 September 2026 |
| 1.0.1 | 16 September 2026 |
| 1.0.0 | 16 September 2026 |
Changelog
[1.3.0] - 28 August 2026
Fixed
- Render containers via
ChildRenderer::html()as well
Added
- Add new
ChildRenderer::any()to allow for bothasandgroupchild references
[1.2.2] - 12 August 2026
Fixed
- Rename
alpine-csp.jstoalpine-csp.min.jsto avoidjshrinkissue - Add Loki icon to store configuration
- Change
Textfactory to constructor method - Guard
MageCookies.getAll()against non-JSON cookies @Maksold
[1.2.1] - 08 August 2026
Security
- Rewrite
x-htmltox-textbecause of CSP
[1.2.0] - 06 August 2026
Fixed
- Add new container
loki.script.post - Add message CSS class that is compatible with admin panel
[1.1.29] - 21 May 2026
Fixed
- Make sure multiple calls to
refresh()do not trigger multiple AJAX calls
[1.1.28] - 08 May 2026
Fixed
- Fix bug in Alpine localStorage when it is out of sync
[1.1.27] - 06 May 2026
Fixed
- Move data-child-name attribute to
LokiCheckout_Coreobserver
[1.1.26] - 06 May 2026
Fixed
- Add
data-child-nameattribute to blocks rendered via ChildRenderer
[1.1.25] - 06 May 2026
Fixed
- Do not reset sortOrder because of other mechanisms using previous values
- Reset sortOrder of childRenderer to avoid negatives
[1.1.24] - 28 March 2026
- Move TransferableAncestorBlockProperties from components to base
[1.1.23] - 27 March 2026
Fixed
- Allow properties of ancestor block to populate child block
[1.1.22] - 02 March 2026
Fixed
- Fix infinite loop and page freeze caused by async Alpine.effect
- Messages with timeout 0 were removed right away, instead of kept forever
[1.1.21] - 25 February 2026
Fixed
- Make call to LocalStorage.get async
[1.1.20] - 19 February 2026
Fixed
- Better way of rendering containers via ChildRenderer::all()
- Remove trailing slash from
customer/section/loadURL
[1.1.19] - 16 February 2026
Fixed
- Make
Alpine.store('LocalStorage').get()andrefresh()asynchronous
[1.1.18] - 12 February 2026
Fixed
- Allow PHP Config to read from current store level
- Allow filtering of child blocks by prefix
- Add ancestor block to children
[1.1.17] - 23 January 2026
Fixed
- Prevent empty cookie from causing JS error
[1.1.16] - 12 January 2026
Fixed
- Remove debugging console log
- Add new GitHub Action workflows
- Copy generic CI/CD files
- Copy generic CI/CD files
[1.1.15] - 06 January 2026
Fixed
- Disable messages if
MageOS_AlpineMessagesis enabled
[1.1.14] - 19 December 2025
Fixed
- Upgrade tests
- Cleanup duplicates in CHANGELOG
[1.1.13] - 11 December 2025
Fixed
- Move dependency ComponentViewModelInterface from
Loki_BasetoLoki_Components
[1.1.12] - 11 December 2025
Fixed
- Rename
LOKI_BASE_URLtoBASE_URL
[1.1.11] - 21 November 2025
Fixed
- Add compatibility with
MageOS_AlpineLoader - Replace
$block->getChildHtml()with$childRenderer->all()including better sorting - Automatically sync localStorage.setItem to Alpine store
[1.1.10] - 12 November 2025
Fixed
- Make sure component scripts are loaded after all other scripts
[1.1.9] - 12 November 2025
Fixed
- Rename LokiMessageStore to Message
- Only load MageCookies if
MageOS_AlpineLocalStorageis not enabled - Fix wrong template variable
- Rename LokiLocalStorage to LocalStorage
- Check for duplicate
MageOS_AlpineLocalStorage - Move layout that is duplicate to Mage-OS Alpine to separate handles
- Remove temporarily Tailwind LESS attempt
[1.1.8] - 03 November 2025
Fixed
- Change z-index for messages from 100 to 5
- Update composer keywords
[1.1.7] - 22 October 2025
Fixed
- Do not escape
$css()withescapeHtmlAttr()butescapeHtml()
[1.1.6] - 09 October 2025
Fixed
- Adjust messages under Luma from z-index:300 to 100 to prevent clash with minicart
[1.1.5] - 08 October 2025
Fixed
- Remove cookies by stripping all non-relevant cookie parts
- Change messages to position:sticky in Luma
[1.1.4] - 07 October 2025
Fixed
- Allow for JS translations of dates
[1.1.3] - 30 September 2025
Fixed
- Use new LOKI_THEME_URL variable in JS
[1.1.2] - 30 September 2025
Fixed
- Remove block cache lifetime
[1.1.1] - 29 September 2025
Fixed
- When removing cookies, ignore the domain-value
[1.1.0] - 23 September 2025
Added
- Add Loki Component exception as complex message
- Move messages timeout configuration from
Loki_ComponentstoLoki_Base - Add custom Block class that adds layout-name to cache key info
- Move frontend assets to base to allow for admin features
- Add custom event "loki:init:localstorage-store"
Fixed
- Remove redundant CSS classes from icon containers
- Reset message timeout to 5000
- Rename
loki.scriptfrom container to block to allow caching - Skip handling messages via cookies and localStorage under Hyva
- Rewrite transfer of global messages from components to be a lot simpler
- Rename loki-directive to loki.script.directive
- Rename loki-store to loki.script.store
- Rename loki-components to loki.script.component
- Rename loki-component-types to loki.script.component-type
- Rename loki-component-partials to loki.script.component-partial
- Cleanup duplicate containers, move to
Loki_Base
[1.0.4] - 17 September 2025
Fixed
- Re-add styling of buttons
[1.0.3] - 17 September 2025
Fixed
- Really move all LESS away from CSS folder
[1.0.2] - 17 September 2025
Fixed
- Move experimental LESS sources away from compilation
- Remove console.log message
- Remove dep with
Loki_Components
[1.0.1] - 17 September 2025
Fixed
- Disable Tailwind for LESS for now (experimental)
[1.0.0] - 17 September 2025
Fixed
- Add LESS sources
- Prevent weird mage-messages cookie value from breaking things
- New ViewModel
- Properly implement section invalidation from Luma customerData JS
- Always use get('messages') when retrieving message section from store
- Remove expired sections in localStorage
- Remove messages with ESC
- Add box shadow to messages
- Sef long lifetime on
user_allowed_save_cookiecookie - Fix CSP compliance of message timeout
- Better notice colors under Luma
- Better API for cookies and messaging
- Fix mobile menu
- Correct padding of message close button under Luma
- Set timeout to 10000
- Move LokiComponents global messages to regular messages template
- Add to both Hyva and Luma
- Add SVG and click button to remove message
- Add close X
- Autoremove messages or double-click to remove
- Copy generic CI/CD files
- Adding all files to git via Yireo Command
[0.0.1] - 13 September 2025
Added
- Initial release
Last modified: June 1, 2026