Skip to content

Debugger injection #226

Merged
merged 3 commits into from Apr 9, 2013

3 participants

@dotcypress
aurajs member

I think i found proper functionality for Debug extension.

Example of use in client code:

window.attachDebugger = function(app){
        // Do cool stuff with app object
        console.log(app);

        // Maybe you want to have access to Aura app via developer console?
        window.aura = app;
    };
@addyosmani
aurajs member

So if I've understood correctly, this is just an opt-in extension that any user can use. It's not to be considered as a default extension that you get without asking for it, right? Nice work!

@dotcypress
aurajs member

Yep, if user don't need this feature, hi don't need to write any code.

@sindresorhus
aurajs member

@dotCypress looks good. Can you make sure to put the above example in the code as a comment or in the docs?

Also not sure it's worth requiring Underscore for this. typeof should work ok in most cases.

@dotcypress
aurajs member

Ready.
Readme has updated in pull request 228

@sindresorhus sindresorhus commented on an outdated diff Mar 29, 2013
lib/ext/debug.js
name: 'debug',
- initialize: function(app) {}
+ initialize: function(app) {
+ if(typeof window.attachDebugger === 'function'){
@sindresorhus
aurajs member
sindresorhus added a note Mar 29, 2013

if (typeof window.attachDebugger === 'function') {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@sindresorhus
aurajs member

How about attaching the attachDebugger to the aura namespace instead, so not to pollute window and prevent conflicts?

@dotcypress
aurajs member

@sindresorhus actually no, because we can to attach to Aura app without direct access to aura namespace (for example: we can create some kind of Google Chrome extension, like a AngularJS Batarang )

@addyosmani
aurajs member

@sbellity are we ready to merge this in? Any changes you want to see here.

@sindresorhus
aurajs member

@dotCypress good point. lgtm

@addyosmani addyosmani merged commit d808593 into aurajs:master Apr 9, 2013

1 check passed

Details default The Travis build passed
@dotcypress dotcypress deleted the dotcypress:Degugger branch Apr 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.