Binds / Bindables v1

Please provide feedback on the current hook/hookability system for future improvement.

  1. ! Must finalize terminology to differentiate between execution points and binds being added.
  2. Are CustomEvent a viable refactor alternative to current code? Does it fulfill the same functionality, perf and ease of use? What are pros/cons.
  3. Need easier method to override 'default' binds, currently need to know ID #, which isn't static. Disable by function name?
  4. "Global" binds feel gross in a hard to define way. What could it be?
  5. bindExec
    • security Because bindExec uses interface names, it can run hooks outside their 'native scope', ex. executing EVENT hooks outside the core EVENT module. What are the repercussions of allowing this and what's the alternative?
    • Allowing execution points to have a default function seems practical at face value...
      • I'm unsure if it should run only when none exist? If always, does it run before or after existing binds?
    • Is there a non-convoluted way to generate a default filter function name based on destination interface? Should every interface be forced to create its own filter from scratch?
      • Current default bind filter matches either an exact string, OR at least one string in an array ([].some). Is this a sane default?
    • Should it return the number of bind fns executed, instead of a boolean?
    • Should there be some sort of enforcement of allowed types? Ex. perhaps an execution point only wants 'transformer' for a particular piece of data...
  6. Ease of use
    • In an older revision the destination object dstObj was unnecessary (inferred via this) because all HOOK functions were applied locally. What if we force destructuring to local scope? What's are gotchas?
    • Aside for seeing bindExec(...) within source code, how can we improve visibility that "yes, this function has available bind points"?
      • Perhaps a JSDOC-like @binds ['foo','bar']?
      • Build function to scan code and generate listing?
  7. bind() should it continue converting/splitting strings into arrays?
    • Is ['foo','bar'] that much harder to type than 'foo bar'?
  8. Should optional add and disable have a return value? Would requiring boolean to signify continued processing be a positive change?
  9. Perf: Can't use a Set if we want easy bind 'removal' (eg. by priority ID), what advantage does Map provide?
  10. Are there any additional stats they should provide?
Edited by Lorin Halpert