marionette.inspector icon indicating copy to clipboard operation
marionette.inspector copied to clipboard

Inspector should function without a Marionette.Application

Open ianmstew opened this issue 9 years ago • 3 comments

Currently, the Inspector will not load without a Marionette.Application on the page. At minimum the Inspector should start without an application, at best it should fully function.

ianmstew avatar Dec 06 '14 16:12 ianmstew

:+1:

What all does it gather from the Application? My understanding is that it forms the view tree from the app, but perhaps it does more?

If it does nothing more, then it could simply look for anything named window.app. If it exists, it should determine whether it's a Marionette application or not.

The following things could be tested for:

  1. Does it extend from Marionette.Object?
  2. Does it have a rootView or layout property?

If either of those things are true, then it can go ahead with serializing the tree and displaying it.

And if there's more to an app than the views, then surely there must be a way to make it work :)

jamesplease avatar Jan 08 '15 05:01 jamesplease

The Radio Tab and Data Tab should also probably work to a degree.

cmaher avatar Jan 08 '15 18:01 cmaher

Detecting the app is easy. We've parched Mn.App so that's all good.

The two things we use the app object got are:

  1. Knowing the app is loaded (face palm)
  2. Building the view tree. There's already a card for a view forest and that discusses the future, but in short if you don't know the root (app) then you need to dynamically build the trees by going through the list and getting their children ...

jasonLaster avatar Jan 08 '15 18:01 jasonLaster