[wp-trac] [WordPress Trac] #36335: Next generation: core autoloader proposal

WordPress Trac noreply at wordpress.org
Mon Jun 6 03:56:50 UTC 2016


#36335: Next generation: core autoloader proposal
-----------------------------+-----------------------------
 Reporter:  dnaber-de        |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Future Release
Component:  General          |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  2nd-opinion      |     Focuses:
-----------------------------+-----------------------------
Changes (by rmccue):

 * keywords:   => 2nd-opinion


Comment:

 We had a long chat about this in the Post Status Slack
 ([https://gist.github.com/rmccue/7dd244d0201c41e45c12fc3b198265c5 raw log]
 for posterity). The main arguments for Composer appear to be:

 * We wouldn't have to maintain an autoloader ourselves.
 * Composer can generate classmaps automatically, so we wouldn't have to
 edit the classmap if/when we add new classes.

 The main arguments against my proposal:

 * Adding autoloader support could be a blocker against adding Composer
 later. (It removes some of the need for Composer.)
 * Having our own autoloader reinvents the wheel, as we're maintaining the
 code ourselves.

 My response to these:

 * Adding Composer is an entirely separate issue that needs agreement from
 the leads, whereas just adding basic autoloaders is a smaller discussion,
 and mostly a technical one.
 * Maintaining our own autoloaders is not unreasonable. The code I've
 attached is 47 lines of autoloader code in 3 classes.
 * The classmap is temporary, with the long-term goal being to eliminate it
 and move our code to match the WP standard of `Some_Class_Name -> class-
 some-class-name.php`.

 Let me know if I missed any key arguments either way there. :)

 I'd like to keep the Composer discussion happening, but I think it's a
 separate discussion. I don't believe implementing our own autoloaders
 holds back supporting Composer later in any way.

 I don't think we managed to convince each other either way, so I think
 another committer or a lead should chime in to steer the conversation. :)

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


More information about the wp-trac mailing list