You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As observed in #114 coming over from ProjectEvergreen/greenwood#1079, the current design of WCC in particular around determining metadata for entry points, conveniently wrapping renderToString calls in a wrapping HTML element starts to fall apart when multiple customElement.define statements are in a single file.
As we can see <wcc-navigation> is considered the entry point, though technically that should belong to original moduleURL passed in, right?
Also, technically isn't the default export always going to be the entry point? This seems to substantiate #23 I suppose?
So it seems like the default export should be the entry point. And from there, if the class definition aligns with a customElements.define call, then that should decided if it is safe to wrap, or at least what the right tag to use is if wrapping is still desired.
Another call out though is that if there is only export default XXXX but no customElements.define how do we tracking this in metadata? Currently we use the tag name as a key, so will need to solve for that too.
Not sure if this is the same thing, or supplemental to #23 so should review them both as part of doing either these tasks.
This an acknowledged defect, but also requires a bit of rearchitecting I think so flagging as both since I don't the final solution here could be reasonably published as a "patch" fix in the spirit of the definition.
The text was updated successfully, but these errors were encountered:
thescientist13
changed the title
refactor how definitions and entry points are determined
refactor how definitions and entry points are determined (leverage default exportMar 29, 2023
thescientist13
changed the title
refactor how definitions and entry points are determined (leverage default export
refactor how definitions and entry points are determined (leverage default export)
Mar 29, 2023
Type of Change
Enhancement / Bug
Summary
As observed in #114 coming over from ProjectEvergreen/greenwood#1079, the current design of WCC in particular around determining metadata for entry points, conveniently wrapping
renderToString
calls in a wrapping HTML element starts to fall apart when multiplecustomElement.define
statements are in a single file.So given this input
This is the current metadata output
Details
As we can see
<wcc-navigation>
is considered the entry point, though technically that should belong to originalmoduleURL
passed in, right?Also, technically isn't the
default export
always going to be the entry point? This seems to substantiate #23 I suppose?So it seems like the
default export
should be the entry point. And from there, if the class definition aligns with acustomElements.define
call, then that should decided if it is safe to wrap, or at least what the right tag to use is if wrapping is still desired.Another call out though is that if there is only
export default XXXX
but nocustomElements.define
how do we tracking this in metadata? Currently we use the tag name as a key, so will need to solve for that too.This an acknowledged defect, but also requires a bit of rearchitecting I think so flagging as both since I don't the final solution here could be reasonably published as a "patch" fix in the spirit of the definition.
The text was updated successfully, but these errors were encountered: