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 · 36 comments
Open

Support engines #632

knownasilya opened this issue Feb 11, 2017 · 36 comments

Comments

@knownasilya
Copy link

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

@thedig
Copy link

thedig commented Mar 6, 2017

waiting with bated breath for this one.

@cyril-sf
Copy link
Contributor

What do you mean by anything?

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

@knownasilya
Copy link
Author

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

@rmachielse
Copy link
Contributor

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
Copy link

Leooo commented Jan 19, 2018

Is there anything recent about the fix for this issue?

@RobbieTheWagner
Copy link
Member

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

@ghost
Copy link

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

@RobbieTheWagner
Copy link
Member

@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
Copy link
Contributor

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

@RobbieTheWagner
Copy link
Member

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
Copy link
Contributor

cyril-sf commented Aug 28, 2018 via email

@RobbieTheWagner
Copy link
Member

@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
Copy link
Contributor

cyril-sf commented Sep 22, 2018 via email

@cyril-sf
Copy link
Contributor

cyril-sf 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
Copy link
Contributor

cyril-sf 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

@RobbieTheWagner
Copy link
Member

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

@rwjblue can you confirm?

@rwjblue
Copy link
Member

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

@RobbieTheWagner
Copy link
Member

@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
Copy link
Member

rwjblue 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
Copy link
Contributor

cyril-sf 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

@RobbieTheWagner
Copy link
Member

@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
Copy link
Member

rwjblue 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
Copy link
Contributor

cyril-sf 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
Copy link
Contributor

cyril-sf commented Oct 9, 2018

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

@RobbieTheWagner
Copy link
Member

@cyril-sf sounds great!

@rwjblue
Copy link
Member

rwjblue commented Oct 10, 2018

Awesome, thank you @cyril-sf!

@cyril-sf
Copy link
Contributor

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
Copy link
Collaborator

nummi 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
Copy link
Collaborator

nummi commented Jan 31, 2019

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

@cyril-sf
Copy link
Contributor

cyril-sf 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
Copy link
Collaborator

nummi 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
@RobbieTheWagner
Copy link
Member

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

@sumeetattree
Copy link

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

@RobbieTheWagner
Copy link
Member

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

@RobbieTheWagner
Copy link
Member

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

@knownasilya
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants