-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to use bv-ui-core modules in place of local modules. #35
Conversation
// | ||
// Other code may have a reference to the object, so we can't do anything | ||
// more drastic such as replacing it. | ||
if (!(global[name] instanceof Namespace)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My first instinct is to error out here. If window.APP
is already defined, for example, but not a Namespace, then who knows what expectations the originator has about it? For example, window.APP.name
and other properties are about to be assigned and might overwrite existing properties. The whole thing could even be deleted.
That said, it may be fair to make this assumption a part of the deal to namespacer users if it buys some convenience. Is there a specific scenario we care about in which it does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scenario we're accommodating here is that other, older BV code created window.APP = {};
as the shared namespace. We then have to play nice with that.
The method used below to decorate that object literal is probably terrible and would need improvement in the bv-ui-core version of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thanks.
I really like this approach. It definitely looks like something that's |
99cd523
to
4c24789
Compare
For added clarity, the automated tests are failing pending a |
* on global.NS using the application name, and exposes a render | ||
* method on an object there. | ||
* A module for registering an application. It creates a property on global.NS | ||
* using the application name, and exposes a render method on an object there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still accurate? I don't see the render
method provided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, I think I mis-read this. But it does seem weird to mention the render
method here when it isn't actually provided here. A more generic comment may still be desirable even if this one is accurate.
4c24789
to
8da0863
Compare
@rmurphey Good catch, rewrote those few lines of docs. |
I'm otherwise good with this. Probably bears mentioning here that you opened #36. |
👍 |
This PR updates code and documentation for the use of bv-ui-core modules rather than scoutfile modules.