marionette.inspector
marionette.inspector copied to clipboard
Inspector should function without a Marionette.Application
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.
:+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:
- Does it extend from Marionette.Object?
- Does it have a
rootView
orlayout
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 :)
The Radio Tab and Data Tab should also probably work to a degree.
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:
- Knowing the app is loaded (face palm)
- 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 ...