ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

[Regression] render helper not targetable by render({into:...})

Open alexdiliberto opened this issue 11 years ago • 6 comments

Possible regression here...Here's a JSBin, works in 1.10 release but not in beta or canary

http://emberjs.jsbin.com/pefuki/1/edit?html,js,output

Running into an issue in the appendLiveRoute function when I explicitly pass into as an optional parameter to this.render()

https://github.com/emberjs/ember.js/blob/c10362b973f7b311115eafd39fa2b01deb4561ed/packages/ember-routing/lib/system/router.js#L1023

alexdiliberto avatar Mar 10 '15 18:03 alexdiliberto

As currently set up the only way I can get this to work is to change the this.render() to render into: application

      this.render(template, {
        into: 'application',
        outlet: 'modal-box'
      });

But it still doesn't hold parity with latest release, If I do that then it will error

TypeError: Cannot read property 'connectOutlet' of undefined

alexdiliberto avatar Mar 12 '15 14:03 alexdiliberto

Thanks for putting together the JSBin. This is indeed a regression.

@rwjblue, this should probably go in the 1.11.0 milestone but I leave that up to you.

I can see how to fix it, but it will be kinda gross. render is a thorn in our side that I will be very happy to axe in 2.0.

ef4 avatar Mar 20 '15 08:03 ef4

Sketch of how we can tack this old behavior onto the new infrastructure:

  • the outlet view will need to notice occurrences of the render helper in its ancestors (probably by looking at helperName), and if it finds one, grab its outlet state from there instead of going up to the next outlet.
  • the router will use _activeViews to inject the appropriate outlet state into the render-inserted view.

ef4 avatar Mar 20 '15 10:03 ef4

@ef4 Thanks!

alexdiliberto avatar Mar 23 '15 22:03 alexdiliberto

@ef4 Running into an issue since upgrading to 1.11 regarding code that changed in this area. I'm using the ember-modals addon which makes a call to this.render from a route with a template name and some options specifying how to render the template. The issue is that appendOrphan gets called but impersonateAnOutlet does not get called at all which is what sets the wasUsed value. I think this may be because impersonateAnOutlet only gets called in the renderHelper and not when calling this.render from a route. Is this an issue with the addon not setting things up correctly or a regression? Is there any other details I can provide for you?

drobannx avatar Mar 30 '15 20:03 drobannx

@drobannx please file a new issue, that sounds like a different problem.

ef4 avatar Mar 31 '15 07:03 ef4