Closed philidem closed 8 years ago
There are two possible implementations to fix this that I think we should consider:
window
object.require('marko-widgets').setWidgetIdPrefix(...)
function.After testing these two implementations, I am actually leaning toward implementing both. I don't think it hurts to give developers control over the ID prefix and since older builds of marko-widgets didn't use the shared global, there's no way to make sure your new project doesn't have a conflict (unless you rebuild the old project so that it uses the new marko-widgets
after this fix).
I have a page that uses
marko-widgets
and also include a JavaScript API that also usesmarko-widgets
. This causes the same unique ID (e.g.wc0
,wc1
, etc.) to be generated for widgets on the client-side which breaks both applications.