ember-inspector icon indicating copy to clipboard operation
ember-inspector copied to clipboard

Support engines

Open knownasilya opened this issue 7 years ago • 36 comments

Currently there is no way to debug anything in an engine. None of the containers show up if defined in an engine.

knownasilya avatar Feb 11 '17 04:02 knownasilya

waiting with bated breath for this one.

thedig avatar Mar 06 '17 17:03 thedig

What do you mean by anything?

Beside the data tab, what else doesn't work?

cyril-sf avatar Apr 21 '17 16:04 cyril-sf

Nothing shows up in Containers, so services and any custom objects that get registered on the container.

knownasilya avatar Apr 21 '17 16:04 knownasilya

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?

rmachielse avatar May 01 '17 21:05 rmachielse

Is there anything recent about the fix for this issue?

Leooo avatar Jan 19 '18 13:01 Leooo

Would anyone here like to help implement engines support? We would love the help!

RobbieTheWagner avatar Feb 27 '18 14:02 RobbieTheWagner

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?

ghost avatar Apr 16 '18 17:04 ghost

@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.

RobbieTheWagner avatar Apr 16 '18 20:04 RobbieTheWagner

Finally having some available time, I'll take a look at it.

cyril-sf avatar Aug 27 '18 22:08 cyril-sf

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.

RobbieTheWagner avatar Aug 28 '18 00:08 RobbieTheWagner

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 avatar Aug 28 '18 01:08 cyril-sf

@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?

RobbieTheWagner avatar Sep 21 '18 18:09 RobbieTheWagner

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.

cyril-sf avatar Sep 22 '18 07:09 cyril-sf

I started looking at the issue and to talk about it on Discord.

cyril-sf avatar Oct 02 '18 19:10 cyril-sf

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):

screen shot 2018-10-08 at 8 02 54 pm

cyril-sf avatar Oct 09 '18 03:10 cyril-sf

@cyril-sf are you saying there is no public API that grabs these for us?

@rwjblue can you confirm?

RobbieTheWagner avatar Oct 09 '18 11:10 RobbieTheWagner

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.

rwjblue avatar Oct 09 '18 12:10 rwjblue

@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.

RobbieTheWagner avatar Oct 09 '18 14:10 RobbieTheWagner

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).

rwjblue avatar Oct 09 '18 14:10 rwjblue

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 avatar Oct 09 '18 15:10 cyril-sf

@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 😃

RobbieTheWagner avatar Oct 09 '18 15:10 RobbieTheWagner

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...

rwjblue avatar Oct 09 '18 15:10 rwjblue

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.

cyril-sf avatar Oct 09 '18 15:10 cyril-sf

@rwwagner90 👍 I need to clean a few things before. I'll push something before the end of the week.

cyril-sf avatar Oct 09 '18 16:10 cyril-sf

@cyril-sf sounds great!

RobbieTheWagner avatar Oct 09 '18 20:10 RobbieTheWagner

Awesome, thank you @cyril-sf!

rwjblue avatar Oct 10 '18 01:10 rwjblue

Sorry for the delay, I'm back to it and will make sure I get it through the finish line now.

ember-engines

I need to clean the code, write tests and work on the API in engines., but the functionality is here for routable engines

cyril-sf avatar Jan 31 '19 21:01 cyril-sf

Looks great! What is the automated test story like for Engines and is there a live example we can use to click test?

nummi avatar Jan 31 '19 23:01 nummi

@cyril-sf, would you be okay with pushing a work in progress PR?

nummi avatar Jan 31 '19 23:01 nummi

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.

cyril-sf avatar Jan 31 '19 23:01 cyril-sf

don't judge the code as it's WIP

Of course not. I haven't used engines before so I'm curious!

nummi avatar Feb 01 '19 00:02 nummi

A WIP PR would be awesome, and please let us know what we can do to help!

RobbieTheWagner avatar Feb 01 '19 18:02 RobbieTheWagner

@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!

sumeetattree avatar Apr 13 '19 07:04 sumeetattree

@cyril-sf do you mind opening a PR with your WIP changes?

RobbieTheWagner avatar Apr 13 '19 13:04 RobbieTheWagner

@cyril-sf would you mind pushing your code please? Would really love to work on this!

RobbieTheWagner avatar Aug 19 '19 23:08 RobbieTheWagner

@rwwagner90 might be worth doing manually, see https://github.com/cyril-sf/ember-inspector/tree/cyril/engines-support

knownasilya avatar Aug 19 '19 23:08 knownasilya