Skip to content

Avoid multiple component registrations #5

Closed

Description

@rmorshea

Since one can use the same component more than once we should avoid calling _register_component more than once if it's already been done. A simple containment check in IDOM_REGISTERED_COMPONENTS should work here.

Activity

  1. Archmonger commented on Aug 19, 2021

    @Archmonger
    Contributor

    Accidentally commented on the wrong issue before, so I'm reposting here


    Caching the register function with functools.cache would provide the same ability to skip re-registration, and would allow us to skip the sys.modules check. Could be slightly more performant than checking IDOM_REGISTERED_COMPONENTS.

  2. Archmonger commented on Aug 31, 2021

    @Archmonger
    Contributor

    Note: recently discovered there is no performance penalty for importing a module more than one time. Apparently importlib already does a sys.modules check. Which means we can remove this LOC.

    See here for more details.

  3. added a commit that references this issue on Sep 22, 2021
    f17ba96
  4. linked a pull request that will close this issueAdvanced Websocket Features #17on Sep 22, 2021
  5. linked a pull request that will close this issueAuto populate IDOM component registry #24on Oct 30, 2021
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