Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

reason-bv
Copy link
Contributor

This PR updates code and documentation for the use of bv-ui-core modules rather than scoutfile modules.

//
// 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)) {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks.

@tnunamak
Copy link
Contributor

tnunamak commented Sep 3, 2015

I really like this approach. It definitely looks like something that's bv-ui-core appropriate, in this form.

@reason-bv
Copy link
Contributor Author

@tnunamak @rmurphey This PR is updated with the final proposal, pending bv-ui-core 0.5.0.

@taylormck
Copy link

For added clarity, the automated tests are failing pending a 0.5.0 release of the bv-ui-core module, which is waiting on one more PR. Once that release is out, we just need to rerun the tests here.

@reason-bv reason-bv changed the title Refactor namespace code. Update to use bv-ui-core modules in place of local modules. Sep 8, 2015
* 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.
Copy link
Contributor

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.

Copy link
Contributor

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.

@reason-bv
Copy link
Contributor Author

@rmurphey Good catch, rewrote those few lines of docs.

@rmurphey
Copy link
Contributor

rmurphey commented Sep 8, 2015

I'm otherwise good with this. Probably bears mentioning here that you opened #36.

@tnunamak
Copy link
Contributor

tnunamak commented Sep 8, 2015

👍

@reason-bv reason-bv closed this in d8c2f28 Sep 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants