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

Add back support for multiple apps #930

Merged
merged 21 commits into from
Apr 26, 2019
Merged

Conversation

RobbieTheWagner
Copy link
Member

No description provided.

@RobbieTheWagner
Copy link
Member Author

@rwjblue I was unable to get anything close to functioning here, but hopefully this shows you what I was going for. Perhaps you could help me figure out where I went wrong?

app/port.js Outdated Show resolved Hide resolved
@RobbieTheWagner RobbieTheWagner requested a review from nummi January 29, 2019 18:17
@RobbieTheWagner RobbieTheWagner changed the title [WIP] Trying to fix names issue [WIP] Add back support for multiple apps Jan 31, 2019
@RobbieTheWagner
Copy link
Member Author

@rwjblue @teddyzeenny @nummi @alexhancock this code seems to work for iframes and multiple apps, but @teddyzeenny was saying the uniqueId stuff was necessary because guidFor has no guarantee of being unique across iframes.

It would be awesome if you guys could take a look at this PR and maybe help with ways to clean things up, thoughts, suggestions etc.

I was hoping we could move some of the manual applicationId and applicationName stuff to be stored on the app instances, which I did in one spot with Object.assign.

@alexhancock
Copy link
Contributor

but @teddyzeenny was saying the uniqueId stuff was necessary because guidFor has no guarantee of being unique across iframes.

That makes sense to me if we actually have code running across multiple execution contexts that guidFor wouldn't be guaranteed to generic unique IDs across them. I'm still learning how the whole architecture works.

Does the logic in ember_debug/port.js actually run in the context of multiple iframes if there are apps in iframes on the page, or is it all run centrally in one context?

@RobbieTheWagner
Copy link
Member Author

@alexhancock the ember_debug code is injected into the iframes, and run in their context, I believe.

chrome.devtools.inspectedWindow.eval(emberDebug, { frameURL: url });

@alexhancock
Copy link
Contributor

@rwwagner90 Ahh, I see. Thanks for clarifying that!

@nummi
Copy link
Collaborator

nummi commented Feb 2, 2019

Seems to be working on the Square Dashboard with an iframe inserted into the markup:

image

My test app has a blank <option> but it still functions:

image

@alexhancock
Copy link
Contributor

@rwwagner90 Any interest in re-starting this? I think where we left off you wanted a code review from @teddyzeenny?

Seems like we had the solution pretty close in code. I would love to finish it if there is interest.

@RobbieTheWagner
Copy link
Member Author

@alexhancock I do plan to wrap this up soon. I spoke to @teddyzeenny and he is in favor of us shipping more code and worrying about it less. If it breaks things for anyone, hopefully they will report bugs. We currently have a lot of other issues to work through for inspector, and we have to work through those and get the tests passing again, before we can merge any PRs. Would you be interested in looking into some of the issues with us?

@alexhancock
Copy link
Contributor

@rwwagner90 Sounds good. I am happy to spend some time looking into those issues. What's the best way for me to help? Is there a branch I should check out and try to debug things on my own, or should I join to discuss on discord at some time?

I am wrapping up my work day soon today, but should be able to help look into things tomorrow.

@RobbieTheWagner
Copy link
Member Author

@alexhancock I just rebased this with master. Would you mind testing to make sure it works for you?

@RobbieTheWagner RobbieTheWagner changed the title [WIP] Add back support for multiple apps Add back support for multiple apps Apr 17, 2019
@alexhancock
Copy link
Contributor

@rwwagner90 sure thing - will test shortly

@alexhancock
Copy link
Contributor

@rwwagner90 Seemed to work well for me. I tested our case where we have two ember apps on the page, and then I dropped an iframe in the page to a third ember app running on my computer, and they all showed up in the picker. When switching back and forth between the apps, I got this error on occasion (not every time):

Screen Shot 2019-04-17 at 2 56 04 PM

... but even though I got the error, everything continued to work.

@RobbieTheWagner
Copy link
Member Author

@alexhancock would you possibly be interested in debugging that error and trying to determine what is causing it?

@alexhancock
Copy link
Contributor

@rwwagner90 sure - will look tomorrow.

@RobbieTheWagner
Copy link
Member Author

@alexhancock sounds good! Please keep me posted 😃

@RobbieTheWagner
Copy link
Member Author

@alexhancock any luck?

@alexhancock
Copy link
Contributor

Got a little more clarity on what the error is, but didn't find a solution yet. Had limited time to look at it so far, but will try to figure it out today/tomorrow.

@RobbieTheWagner
Copy link
Member Author

@alexhancock just keep me posted! I would like to get this in soon, and release a new version 😃

Copy link
Collaborator

@nummi nummi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Embedded iframe is working for me. We just need someone with multiple apps on one page to test.

@alexhancock
Copy link
Contributor

@nummi @rwwagner90 I tested on our site (https://squareup.com/dashboard/). It works well from what I can see.

If we know of any other cases we should test them, but otherwise I suppose we just go for it?

@RobbieTheWagner RobbieTheWagner merged commit 2237dc1 into master Apr 26, 2019
@RobbieTheWagner RobbieTheWagner deleted the application-id-fix branch April 26, 2019 20:39
@RobbieTheWagner
Copy link
Member Author

Merged. Thanks so much guys! If anything breaks, I'm sure people will let us know 😝

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

Successfully merging this pull request may close these issues.

4 participants