Skip to content

Composer roadmap #1890

Description

@Rarst

Hi! I am your resident Composer menace.

I am working to make WP SEO have awesome Composer support. Because Composer is what keeps developers happy and managing dependencies reliable (audience cheers).

As well as hopefully simplifying development and build processes away from Git Submodules (audience moans).

The current state

  1. Present composer.json in main plugin, but broken due to submodule use
  2. Two submodules without Composer support

Decision points

Is it time for submodules to go?

Should the submodules be retained in parallel? Or should Composer become main and preferable mechanism with submodule structure deprecated?

How will we handle autoload?

The tricky part is to enable end result to work seamlessly with PHP 5.2 (audience moans).

While you can use Composer to build for PHP 5.2 target without issue, its autoload is inherently 5.3.

From my research so far I see two approaches:

  1. Ignore Composer autoload, rely on known dependency locations in tree to load files. Vendor directory can be discarded in build process. As part of the site stack the built in load should be ignored in favor of global Composer autoload.
  2. Use the intermediary classmap, generated by Composer. While that "magic" autoload in Composer requires 5.3, it also generates intermediary files which seem not too. One of those can provide classmap, mapping classes to their filesystem locations. This file can be used in internal autoloader, over hardcoding the locations.
  3. composer-php52 was brought to my attention as an option for autoload compatibility layer, h/t @coenjacobs

There might be more options to explore here as well.

Progress

  • implement Composer in libraries used
  • add libraries to Packagist
  • require libraries in plugin
  • fix Composer installation to work
  • document
  • update build process (see Update deploy implementation #1961 )

Relevant pull requests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions