Skip to content

Idea: allowing multiple point cuts per join point. #37

@TomStrepsil

Description

@TomStrepsil

Whilst it is possible to have multiple features targeting the same join point for a particular point cut configuration, it is not currently possible to have multiple point cut configurations pointing to the same join point.

When this happens, the first configured point cut configuration "wins", as is described in the documentation:

N.B. when setting up multiple pointcuts, the path matched by the globs must be mutually exclusive. Otherwise, the pointcut defined earlier in the array "wins", and a warning is emitted into the compilation indicating that the subsequent cuts are neutered for those matching files.

It should technically be possible to allow for each point cut to be tested in turn, via a more complex join point setup. This would allow for a single file to be varied for different reasons, or for the same reason but using specific toggle point code depending on feature state.

Currently, each point cut either serves a variation, or falls back to the "control" or base module. This is then used in the join point as the runtime code.

Instead, the join point could have the responsibility of serving the "control" or base module directly, having queried an array of potential point cuts, to see if a variation applies. As soon as a candidate produces a variation, the remaining point cuts would be ignored.

However, the react-pointcuts toggle points accept plugins that include a onCodeSelected hook, which currently fires whatever choice is made (variant, or control) - this enables proper reporting in Optimizely. Would need to consider if that needs to apply for all the potential point cuts, even if an earlier one has identified a variation.

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