This is not possible for a render()test-helper function since essentially we are passing down a glimmer templateOnlyComponent. I would appreciate if we could figure out a way to allow this in the glimmerx package or compiler level, so this context can be set directly in the renderComponent API:
return renderComponent(hbs`
<h1>{{this.someProperty}}</h1>
`, {
element: document.getElementById('ember-testing'),
// thisContext or context or owner(which sets a context if thats what it does)
args: argsContext
services: servicesContextAssignedToThisContext
});
I've done more investigation after my PR: https://github.com/glimmerjs/glimmer-experimental/pull/88 . I found that even my PR doesn't completely solve this problem, it seems like this is a limitation of our current compiler.
If I understood correctly our glimmerx babel plugin/compiler compiles the components with their
scope:
andservices
concatenated:This is not possible for a
render()
test-helper
function since essentially we are passing down a glimmertemplateOnlyComponent
. I would appreciate if we could figure out a way to allow this in theglimmerx
package or compiler level, sothis
context can be set directly in therenderComponent
API: