Skip to content

Dynamically wire()'ed scopes are not made resolvable #121

Open

Description

@AnAppAMonth

Objects (components and scopes) are made resolvable by calling Scope.prototype._makeResolvable(). This method is called in the following places:

  1. Scope.prototype._createScopeItem()
  2. scope.componentFactory.initInstance()
  3. pluginApi.addComponent()
  4. pluginApi.addInstance()

The first call causes _makeResolvable() to be called for each statically created component and scope (those created by wiring a spec); and the second call causes it to be called for each component, either statically or dynamically created. By "dynamically created" I mean it's created by calling wire() in a plugin method.

So for statically created components, _makeResolvable() is called twice (both 1 and 2 are called); for statically created scopes, 1 is called; for dynamically created components, 2 is called; and for dynamically created scopes, none is called, so the scope isn't resolvable.

For example, if I have the following statement in a plugin method:
wire({example:{literal:'example'}}, 'myscope');
This scope is created but not made resolvable.

Additionally, pluginApi.addComponent() calls scope.componentFactory.processComponent(), which in turn calls scope.componentFactory.initInstance(). So in this case _makeResolvable is also called twice (2 and 3).

Activity

  1. AnAppAMonth commented on Jul 15, 2013

    @AnAppAMonth
    Author

    Additionally, components that are dynamically wired and are plain values or reference another component, for example, by calling wire(3, 'newcomp') or wire({$ref: 'another'}, 'newcomp') in a plugin, are not made resolvable.

  2. briancavalier commented on Jul 15, 2013

    @briancavalier
    Member

    Thanks for the detailed report, @halfninety. I'll look into this today and report back with more info.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions