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

WordPress Trac noreply at wordpress.org
Thu Sep 14 14:49:37 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 sudar):

 I have been following this ticket for years. I got excited when it was
 finally merged it, I even tweeted about it. But when I woke up the next
 day it was reverted and I was very sad. I felt like a kid who’s birthday
 gift got snatched before they could use it.

 I am just an ordinary developer who works on mostly plugins and this would
 be extremely valuable for me personally. All these years there have been
 numerous occasions when I could have made use of it, if it was available
 in core.

 The event based approached (actions & filters) in PHP has worked really
 well for WordPress and most developers who work in WordPress understand
 it. If it is extended to JavaScript it would benefit lot of (ordinary)
 developers like me. If I remember correctly WordPress has always preferred
 to keep the barrier to entry low and make it easy for developers to
 understand the code instead of just chasing the latest and greatest. (We
 still haven't used namespaces in PHP)

 > Also, what exactly about wp.hooks is "legacy"? Just the fact that it's
 been around a while? The notion that "there may be a better approach in
 the future" is NOT a good reason to keep kicking the can, especially since
 (A) there's no specifics about an alternative, and (B) there's been a need
 for this utility for years.

 Exactly!

 > Choosing what we use in core today based on the needs of Gutenberg is a
 mistake. The decorators, slot & fill patterns, and middlewares being
 explored there are React/Redux based approaches that are unlikely to be
 helpful for extending legacy JavaScript.

 Denying developers an easy to use and simple to understand library that
 they could use today (could have used all these years if it was merged) on
 the basis that something that _might_ get merged in the future (who knows
 how long it is going to take) may not need it is a very bad mistake,
 especially when it is not mutually exclusive.

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


More information about the wp-trac mailing list