Skip to content

Add before/after properties to allow modules to specify default prioritization #27

Description

@ruipin

As it stands, modules are unable to signal a desired prioritization other than "WRAPPER", "MIXED", and "OVERRIDE".

A suggestion that has come my way is to add optional before and after constraints that will be used to decide on default prioritization. These would be lists of module IDs (or a single module ID), which would run by default before/after the given wrapper.

Example:

libWrapper.register("module-a", "Foo.prototype.bar", "MIXED", {before: "module-b", after: ["module-c", "module-d"]});

Optionally, we could have the dictionary be the third parameter (when it is not a string, for backward compatibility), and have the wrapper type be one of the dictionary values:

libWrapper.register("module-a", "Foo.prototype.bar", {type: "MIXED", before: "module-b", after: ["module-c", "module-d"]});

The user could then be warned if these constraints conflict (including when it's because the users themselves changed prioritization).

Activity

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions