Skip to content

Component Registration #68

@ForbesLindesay

Description

@ForbesLindesay

I've been looking at trying to improve the "self registration process". I have two thoughts on how we can improve this:

  1. Don't use self registration for core components - it makes perfect sense for plugins where they can access the glimpse API to register themselves, but very little sense for core components where they are explicitly loaded from somewhere. Wherever possible, a module should provide an external API and loading it should be side effect free. By having calling code explicitly register the components, we can achieve this.
  2. We seem to have one more level of indirection than we're actually using. We have applications self registering into the shell and "tabs" self registering into the "request". The second of these makes perfect sense, but I'm not sure I can see a strong use case for plugins registering additional applications into the shell?
  3. It seems to me like request/request.js (which is responsible for telling the repositories to fetch data) is really just a dependency of request-user-view.jsx and request-summary-view.jsx. We could move the relevant code to there and remove that awkward self-registration.

These changes should also make it easier to test components in isolation.

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