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
{{ message }}
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.
Forcing Phosphor to be a singleton on the page is "not nice" for projects which consume Phosphor. It means new functionality in Phosphor is not available for the users of those downstream projects until those projects update their dependencies. For Phosphor 2.0 (which should hopefully be the last major version of Phosphor) I think we can do better.
One idea that I have is to leverage Symbol.for('@phosphor/[email protected]') and tag the Widget prototype with that Symbol for each minor release. Since the Symbol is guaranteed to be global on the page, it would let duplicate prototypes function just fine, because we could guarantee they have the needed API. Instead of using the instanceof operator, we could have some convenience functions for checking the presence of the symbols.
This idea may have holes, but it's a good starting point I think.
Forcing Phosphor to be a singleton on the page is "not nice" for projects which consume Phosphor. It means new functionality in Phosphor is not available for the users of those downstream projects until those projects update their dependencies. For Phosphor 2.0 (which should hopefully be the last major version of Phosphor) I think we can do better.
One idea that I have is to leverage
Symbol.for('@phosphor/[email protected]')
and tag theWidget
prototype with that Symbol for each minor release. Since the Symbol is guaranteed to be global on the page, it would let duplicate prototypes function just fine, because we could guarantee they have the needed API. Instead of using theinstanceof
operator, we could have some convenience functions for checking the presence of the symbols.This idea may have holes, but it's a good starting point I think.
CC @afshin @blink1073 @jasongrout
The text was updated successfully, but these errors were encountered: