Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support engines #632

Open
knownasilya opened this issue Feb 11, 2017 · 34 comments

Comments

Projects
None yet
10 participants
@knownasilya
Copy link

commented Feb 11, 2017

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

@thedig

This comment has been minimized.

Copy link

commented Mar 6, 2017

waiting with bated breath for this one.

@cyril-sf

This comment has been minimized.

Copy link
Contributor

commented Apr 21, 2017

What do you mean by anything?

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

@knownasilya

This comment has been minimized.

Copy link
Author

commented Apr 21, 2017

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

@rmachielse

This comment has been minimized.

Copy link
Contributor

commented May 1, 2017

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?

@Leooo

This comment has been minimized.

Copy link

commented Jan 19, 2018

Is there anything recent about the fix for this issue?

@rwwagner90

This comment has been minimized.

Copy link
Member

commented Feb 27, 2018

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

@efx

This comment has been minimized.

Copy link
Contributor

commented Apr 16, 2018

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?

@rwwagner90

This comment has been minimized.

Copy link
Member

commented Apr 16, 2018

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

@cyril-sf

This comment has been minimized.

Copy link
Contributor

commented Aug 27, 2018

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

@rwwagner90

This comment has been minimized.

Copy link
Member

commented Aug 28, 2018

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.

@cyril-sf

This comment has been minimized.

Copy link
Contributor

commented Aug 28, 2018

@rwwagner90

This comment has been minimized.

Copy link
Member

commented Sep 21, 2018

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

@cyril-sf

This comment has been minimized.

Copy link
Contributor

commented Sep 22, 2018

@cyril-sf

This comment has been minimized.

Copy link
Contributor

commented Oct 2, 2018

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

cyril-sf added a commit to cyril-sf/ember-inspector that referenced this issue Oct 2, 2018

cyril-sf added a commit to cyril-sf/ember-inspector that referenced this issue Oct 2, 2018

@cyril-sf

This comment has been minimized.

Copy link
Contributor

commented Oct 9, 2018

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

@rwwagner90

This comment has been minimized.

Copy link
Member

commented Oct 9, 2018

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

@rwjblue can you confirm?

@rwjblue

This comment has been minimized.

Copy link
Member

commented Oct 9, 2018

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.

@rwwagner90

This comment has been minimized.

Copy link
Member

commented Oct 9, 2018

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

@rwjblue

This comment has been minimized.

Copy link
Member

commented Oct 9, 2018

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

@cyril-sf

This comment has been minimized.

Copy link
Contributor

commented Oct 9, 2018

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

@rwwagner90

This comment has been minimized.

Copy link
Member

commented Oct 9, 2018

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

@rwjblue

This comment has been minimized.

Copy link
Member

commented Oct 9, 2018

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

@cyril-sf

This comment has been minimized.

Copy link
Contributor

commented Oct 9, 2018

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

This comment has been minimized.

Copy link
Contributor

commented Oct 9, 2018

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

@rwwagner90

This comment has been minimized.

Copy link
Member

commented Oct 9, 2018

@cyril-sf sounds great!

@rwjblue

This comment has been minimized.

Copy link
Member

commented Oct 10, 2018

Awesome, thank you @cyril-sf!

@cyril-sf

This comment has been minimized.

Copy link
Contributor

commented Jan 31, 2019

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

@nummi

This comment has been minimized.

Copy link
Contributor

commented Jan 31, 2019

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

@nummi

This comment has been minimized.

Copy link
Contributor

commented Jan 31, 2019

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

@cyril-sf

This comment has been minimized.

Copy link
Contributor

commented Jan 31, 2019

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 added a commit to cyril-sf/ember-inspector that referenced this issue Feb 1, 2019

@nummi

This comment has been minimized.

Copy link
Contributor

commented Feb 1, 2019

don't judge the code as it's WIP

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

cyril-sf added a commit to cyril-sf/ember-inspector that referenced this issue Feb 1, 2019

@rwwagner90

This comment has been minimized.

Copy link
Member

commented Feb 1, 2019

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

@sumeetattree

This comment has been minimized.

Copy link

commented Apr 13, 2019

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

@rwwagner90

This comment has been minimized.

Copy link
Member

commented Apr 13, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.