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

WordPress Trac noreply at wordpress.org
Sun Sep 4 09:35:31 UTC 2016


#36335: Next generation: core autoloader proposal
-----------------------------+------------------
 Reporter:  dnaber-de        |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  4.7
Component:  General          |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:
-----------------------------+------------------

Comment (by MikeSchinkel):

 Since I don't think I will have much time over the next week I am going to
 go ahead adiscuss my concerns with it.

 I am definitely in favor of add `composer.json` to WordPress. It does not
 make anything complicated for people who do not use Composer but for those
 who do use it having it in core makes their lives easier.

 Beyond that it seems the primary short-term benefit of using Composer is
 to generate the classmap? ''(It can't be because of autoloader generation
 because if you have a classmap the autoloader is trivial.)''  Is there not
 any other benefit?

 Check me here if I am wrong, but is generating a classmap really that
 hard? I do it for WPLib and it seems pretty trivial. What am I missing?

 -------
 And then there is the idea of bunding Composer with WordPress. What would
 be benefit of that? For people who use composer already, or for end-users
 who download and install plugins and themes from WP.org?

 If they use Composer already, why would they want to have to worry about
 incompatible versions?

 If they are end-users how would you get Composer to handle the dynamic
 load scenario of plugins and themes?

 -------

 Further, if plugins and themes wanted to use an autoloader would they
 using their own directories for code storaage, or in the `wp-vendor`
 directory? Would they be responsible to create a project on
 `packagist.org` to point to their code for their plugin, and then the
 plugin file in the plugins directory would just be a loader for the real
 plugin in vendors?

 Or would each plugin need to define its own package type so they can each
 map their own includes directory inside `composer.json` so that Composer
 will know to place their autoload files in the right plugin or theme
 directory?, e.g.

 {{{
 type:yoast-seo => `wp-content/plugins/wordpress-seo/inc
 }}}

 Frankly, quoting @rmccue:

  ''I still think this seems to be a solution (Composer) searching for a
 problem.''

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


More information about the wp-trac mailing list