Open pgross41 opened 4 years ago
XFC should provide a way to disable logging at run-time instead of build-time. Apps that don't use webpack have no way to disable the logging. Theoretically they could add process.env.NODE_ENV = 'production'
to their source code but setting a global isn't good practice.
You also can't assume all users are importing XFC as an ES6 module. Another lib such as cerner-smart-embeddable-lib is pre-building itself with XFC and providing a .min.js version which does not get updated by the DefinePlugin.
Description of Issue
F-Twelve adds a JS console to the DOM i.e. whenever
console.log
is called, it writes that message to the DOM. However, when the DOM mutates, XFC writes toconsole.log
so F-Twelve writes the message to the DOM and the cycle repeats. This causes an endless loop, freezing the browser.System Configuration
Project Version
1.8.1
Additional Details (optional)
I would fix this on the F-Twelve side if I could but I don't think I can. The whole tool is designed around outputing
console.log
messages to the DOM.Steps to Reproduce the Issue
\example\embedded_app_lifecycle
head
tag in2_c_provider_embedded_app.html
FTwelve.show();
in the body'sscript
tag after XFC.Provider.init in2_c_provider_embedded_app.html
Adding a breakpoint to the
console.log
inlogger.js
shows theself.requestResize()
inapplication.js
at the bottom of the stack.It seems like this is meant to be called only on a resize, so maybe it needs to be smarter about detecting if the event is actually a resize or not. Another idea is add a special exception class (
xfc-exclude-mutation-observer
for example) which I would add to the root element of f-twelve:The
parentHasClass
helper function used above would be like:Expected Outcomes
It is common for an MPage developer to use F-Twelve as well as cerner-smart-embeddable-lib, they should able to use them both at the same time.