Skip to content

Adding recognizers dynamically #1005

@OpherV

Description

@OpherV

Hi, I'm the author of #991 (SVG path trace recognizer)

tl;dr I suggest an enhancement to allow recognizer plugins for Hammer.js

Originally, and like I wrote in the PR comment, Hammer architecture currently does not easily allow adding recognizers dynamically. It assumes all recognizers are pre-packed with the lib, which makes it harder to write external modules. This means that extra functionality that might be relevant to some but not all use cases will either be deemed too out of scope and thus not included with hammer, or get included and bloat up the core lib.

Use case: Other than the SVG path follow I've already implemented, I'm also working on implementing an arbitrary shape/stroke recognizer based on $1 unistroke recognizer. This is a very specific use case that relies on an external library, with a different license than that of Hammerjs. It would be cool if Hammer could support it via external plugins, but without having to include both the implementation and the library in the source code.

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