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

BUG/Requirement: render() test-helper: currently impossible to set services & this context for templateOnlyComponents #89

Open
izelnakri opened this issue Nov 8, 2020 · 0 comments

Comments

@izelnakri
Copy link

I've done more investigation after my PR: #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: and services concatenated:

(compiledOutputWithScopesObj, serviceOne, serviceTwo)

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
  });
@izelnakri izelnakri changed the title Required for render() test-helper: currently impossible to set services & this context for templateOnlyComponents BUG/Requirement: render() test-helper: currently impossible to set services & this context for templateOnlyComponents Nov 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant