[wp-trac] [WordPress Trac] #21170: JavaScript actions and filters

WordPress Trac noreply at wordpress.org
Tue Sep 26 15:12:00 UTC 2017


#21170: JavaScript actions and filters
-----------------------------+-------------------------
 Reporter:  koopersmith      |       Owner:
     Type:  feature request  |      Status:  assigned
 Priority:  normal           |   Milestone:  4.9
Component:  General          |     Version:  3.4
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:  javascript
-----------------------------+-------------------------

Comment (by azaozz):

 Replying to [comment:181 adamsilverstein]:
 > Having a single global `wp.hooks` now feels like an anti-pattern in the
 age of packages and modules, whereas including an instance of `wp.Hooks`
 in each component feels very much in-line with standard practice in JS.

 I actually think this is the opposite. The greatest strength of wp.hooks
 is that it is "above" any/all modules, packages, components, libraries,
 etc. and enables easy interoperability for all of them. Each library has
 its own native signalling methods that usually fit internal use best. We
 can, of course, enable wp.hooks to be used internally in modules, but
 thinking this will diminish its best user case: make it possible to use
 any library at any time with all plugins.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/21170#comment:183>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list