The customElement decorator was failing to work when used in add-ons that were using it. This PR makes it possible to use the decorator on entities inside an add-on.
It was failing to work for add-ons because the Babel transform used to support module evaluation was not being applied to add-ons, and the initializer was not written to check dependencies of modules under app/. Both of these issues are intended to be resolved in this PR.
EDIT: It also fixes a failure in the add-on to work properly in production builds. That problem was occurring because of a few factors, the main being that bare strings and such are stripped out in production, and a bug in one of the functions used to detect whether a module is supported by the decorator. Ultimately, I chose to ditch the Babel plugin approach in favor of checking whether this add-on is a dependency of a module and then checking the code to see if the decorator function is called.
The
customElement
decorator was failing to work when used in add-ons that were using it. This PR makes it possible to use the decorator on entities inside an add-on.It was failing to work for add-ons because the Babel transform used to support module evaluation was not being applied to add-ons, and the initializer was not written to check dependencies of modules underapp/
. Both of these issues are intended to be resolved in this PR.EDIT: It also fixes a failure in the add-on to work properly in production builds. That problem was occurring because of a few factors, the main being that bare strings and such are stripped out in production, and a bug in one of the functions used to detect whether a module is supported by the decorator. Ultimately, I chose to ditch the Babel plugin approach in favor of checking whether this add-on is a dependency of a module and then checking the code to see if the decorator function is called.
Closes: #6 #9