NTR: frontend cleanup - JS files - #1419
Merged
BlackScorp merged 1 commit intoJul 24, 2026
Merged
Conversation
cxo-jutz
force-pushed
the
users/ju/ntr/js-plugin-clean-up
branch
from
July 24, 2026 12:27
0d95d16 to
45a866c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small, behavior-preserving cleanups of the storefront JavaScript. No change to the
custom plugin base or the runtime-decoupling strategy.
Changes
http-client: fixed a broken error callback.
xhr.onerrorcheckedcallbackSuccessinstead ofcallbackError, so the error handler never fired.Also guarded
onloadagainst a missingcontent-typeheader (getResponseHeaderreturns
null, and.indexOf()on it would throw).Plugin base: added listener lifecycle. Introduced
_addListener()(tracks eachregistered listener) and
destroy()(removes them all).phone-pluginandsubscribe-buttonnow register through it. Shopware may re-initialize plugins onDOM updates (off-canvas cart, bfcache restore); without teardown this leaves
duplicate listeners and leaks. Behavior is unchanged — the capture flag is passed
through to both add/removeEventListener.
js-hook decoupling. Split styling classes from JS/test hooks (matches theproject's existing stylelint rule that bans
.js-classes from styling):.mollie-paypal-button(styled) → JS now selects.js-mollie-paypal-button;the styling class stays on the element.
observed→js-mollie-observed.Removed dead IE / legacy-Edge detection. Dropped
isIEBrowser,isEdgeBrowser,isNativeWindowsBrowserandgetListfrom the device-detection helper, plus theIE-only TOS-checkbox workaround in the credit-card components (and its now-unused
import).
Why: IE is end-of-life, and
isEdgeBrowser()matched theEdge/UA token, whichis legacy (EdgeHTML) Edge only — also discontinued. Modern Edge is Chromium and
sends
Edg/, so it was never matched by this code and needs none of theseworkarounds. No coverage lost for current browsers.
Notes / non-changes
querySelector/getElementByIdinstead of Shopware'sDomAccess:the storefront intentionally touches Shopware only via runtime globals
(
window.PluginManager,window.csrf) and avoids build-time imports from theShopware source tree, to stay decoupled across SW 6.4–6.7.