lwc
lwc copied to clipboard
Convert warnings logged from Unexpected LWC stylesheet content to errors
Description
https://github.com/salesforce/lwc/pull/3443 adds logging and reporting when an unregistered stylesheet is evaluated by the engine. The end goal here is to lock this functionality down completely and throw an error when an invalid stylesheet is detected. This is potentially a breaking a change, so we'll evaluate the risk of breakage through the reporting API.
End Goal
// Check that this stylesheet was generated by our compiler
if (!isStylesheetRegistered(stylesheet)) {
throw new Error(TypeError, `Unexpected LWC stylesheet content found for component <${vm.tagName.toLowerCase()}>.`);
}