-
Notifications
You must be signed in to change notification settings - Fork 81
Closed
Labels
Bug 🪲Something isn't workingSomething isn't working
Description
Description
There's some code in the MzpDetails component that tries to auto-initialize some common selectors as soon as the code is parsed by the browser. This can cause issues now that we're explicitly importing/exporting JS as modules, since at the time this auto-initializing code runs global dependencies such as window.MzpSupports may not yet be available to reference.
Steps to reproduce
Given the following code, the auto-initializing code will fail:
import MzpSupports from '@mozilla-protocol/core/protocol/js/supports';
import MzpUtils from '@mozilla-protocol/core/protocol/js/utils';
import MzpDetails from '@mozilla-protocol/core/protocol/js/details';
window.MzpSupports = MzpSupports;
window.MzpUtils = MzpUtils;
window.MzpDetails = MzpDetails;Expected result
MzpDetails should initialize on the class .mzp-c-details.
Actual result
The component is not initialized.
Instead of trying to run this code silently/automatically, we should probably make it explicit/manual instead
Environment
N/A
Metadata
Metadata
Assignees
Labels
Bug 🪲Something isn't workingSomething isn't working