ember-inspector
ember-inspector copied to clipboard
Support engines
Currently there is no way to debug anything in an engine. None of the containers show up if defined in an engine.
waiting with bated breath for this one.
What do you mean by anything?
Beside the data tab, what else doesn't work?
Nothing shows up in Containers, so services and any custom objects that get registered on the container.
I think the biggest issue is that the routes tab crashes completely with engines (see ember-engines/ember-engines#385) because the route handler is being resolved asynchronously. Would a pr be desired?
Is there anything recent about the fix for this issue?
Would anyone here like to help implement engines support? We would love the help!
I was a bit confused by this when trying engines locally. I can possibly help given I secure some internal dev time for this. @rwwagner90 and/or whoever knows what is needed, would you mind specifying the needed changes?
@efx I have no idea what is needed. Just have to investigate all of the parts of inspector that are broken with engines and figure out some fixes. I would be glad to try to help out, but I don't have much knowledge into the inner workings of engines.
Finally having some available time, I'll take a look at it.
Thanks @cyril-sf! I've spoken with several people about engines support and I think a good first step is to have a dropdown to let you switch between containers, so inspector would just show things from one at a time, instead of merging all into one view, but it is a start.
That’s what I would shoot for. I’m discovering that part of the code, we’ll see how it goes.
Sent from my iPhone
On Aug 27, 2018, at 5:52 PM, Robert Wagner [email protected] wrote:
Thanks @cyril-sf! I've spoken with several people about engines support and I think a good first step is to have a dropdown to let you switch between containers, so inspector would just show things from one at a time, instead of merging all into one view, but it is a start.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
@cyril-sf any updates on this? We've prioritized this as one of the most important things we need to fix now. Does anyone have a good test app that uses engines we can develop against?
I’m on vacation. Coming back next week and will start looking at it (I finished pushing an outstanding PR for another repo before my break).
Sent from my iPhone
On Sep 21, 2018, at 8:11 PM, Robert Wagner [email protected] wrote:
@cyril-sf any updates on this? We've prioritized this as one of the most important things we need to fix now. Does anyone have a good test app that uses engines we can develop against?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
I started looking at the issue and to talk about it on Discord.
Status update: I'm done with the investigation phase, at least for routable engines. I need to propose a public API to access the list of instances of engines.
So far, I use that UI as WIP (will need to change to take into account instances of the same engine):
@cyril-sf are you saying there is no public API that grabs these for us?
@rwjblue can you confirm?
I need to propose a public API to access the list of instances of engines.
@cyril-sf are you saying there is no public API that grabs these for us?
Ya, I don't think there is a public API though it should be possible (at least via private APIs). I definitely agree / support making some public inspecting API.
@cyril-sf @rwjblue so we probably need to go through the RFC process before we can support engines? Just want to make sure I am fully understanding here.
If that is correct, @cyril-sf let me know what you need from me in composing the RFC.
We can detect the new public API (that we propose) and fallback to using the private API while we wait for the RFC process. IMHO, we don't need to wait (as long as we handle failures gracefully).
Based on what I found, for routable engines, we rely on private variables on the router for bookkeeping and there's no public API to access it.
_engineInstances
_engineInfoByRoute
See https://github.com/emberjs/ember.js/blob/bef860222ac1ce8b86c9e2ed129e24beb0c07132/packages/%40ember/-internals/routing/lib/system/router.ts#L512-L513
I need to look at routeless engines (I suspect this will be the same).
I understand the need to ship clean code, I also understand that shipping something in the Ember Inspector while we improve ember engines would unblock many developers. I'd go with the same recommendation as @rwjblue
@cyril-sf sounds good. Do you want to start a PR with some of your workarounds then? We can ship engines support piece by piece. Anything we can get in, would be a huge win. No need to wait until we have it everywhere or anything 😃
FWIW, routeless engines will be much harder. Because there isn't a singleton that we can inspect to grab the state. I'll try to poke at the internals of {{mount
(what routeless engines use to render) to see what bookkeeping we do...
I'm happy to investigate and I'll ping you if I'm not successful. I'm just putting a breakpoint where we instantiate a container and then look at the callstack to find a good entry point.
@rwwagner90 👍 I need to clean a few things before. I'll push something before the end of the week.
@cyril-sf sounds great!
Awesome, thank you @cyril-sf!
Sorry for the delay, I'm back to it and will make sure I get it through the finish line now.
I need to clean the code, write tests and work on the API in engines., but the functionality is here for routable engines
Looks great! What is the automated test story like for Engines and is there a live example we can use to click test?
@cyril-sf, would you be okay with pushing a work in progress PR?
Looks great! What is the automated test story like for Engines and is there a live example we can use to click test?
This is a good question and I don't have the answer. I'm using this project to get familiar with engines, so I'll have to find the answer 😄
@cyril-sf, would you be okay with pushing a work in progress PR?
@nummi Will do today or tomorrow if you don't judge the code as it's WIP 😉 Definitely not the quality I intend of pushing but I'm happy to have feedback in case you find problems.
don't judge the code as it's WIP
Of course not. I haven't used engines before so I'm curious!
A WIP PR would be awesome, and please let us know what we can do to help!
@rwwagner90 @cyril-sf I am heavily using engines in my project. I would be glad to test drive these features. I have 3 engines in my app 😅 at the moment. Let me know where I can start with the latest build!
@cyril-sf do you mind opening a PR with your WIP changes?
@cyril-sf would you mind pushing your code please? Would really love to work on this!
@rwwagner90 might be worth doing manually, see https://github.com/cyril-sf/ember-inspector/tree/cyril/engines-support