Skip to content

Compound packages #910

Open
Open

Description

@dantleech

Currently Phpactor packages are, ideally, divided according to package design principles, for example:

  • phpactor/reference-finder: policy for models
  • phpactor/reference-finder-extension: Phpactor extension for reference finder (provide collectors and provide chain implementations)
  • phpactor/reference-finder-rpc: integrate the reference finder with Phpactor RPC
  • phpactor/reference-finder-language-server: integrate the reference finder with Phpactor Language Server
  • phpactor/reference-finder-worse-reflection: implementation of policy
  • phpactor/reference-finder-worse-reflection-extension: provide tagged implementations of the policy

This provides a perfect separation of concerns, but makes it difficult to maintain and contribute to.

We can improve this by combining extensions with implementations/policy, e.g.

  • phpactor/reference-finder: policy and extension
  • phpactor/reference-finder-rpc: handlers and extension
  • phpactor/reference-finder-language-server: handlers and extension
  • phpactor/reference-finder-worse-reflection: implementation of policy and extension

Possibly we can also combine the rpc and language-server packages in reference-finder and going further - err, we can put everything in reference-finder.

The same could be applied to f.e. completion.

The downside is that you either get "optional" dependencies (code in the package is implicitly depdendent on external code without a version constraint) or you bundle unrequired depdencies (e.g. include reference-finder and get a language server free even though you only use RPC).

Currently, the chances of anybody using any of these packages in isolation is minimal, and I wouldn't encourage it. At the same time having individual packages provides a good separation of concerns. But the cost of maintainence is unacceptable (too much mental overhead, lack of tooling, waiting for composer to update, inter-package dependency management).

So at least initially, a reasonable first step would be to combine extensions with implementation/policy packages and not have "standalone" extensions - it probably needs some more thought, but it can probably half the number of packages in some domains.

Activity

  1. changed the title [-]Packages: Combine Phpactor integrations in implementation pacakges[/-] [+]Compound packages[/+] on Mar 10, 2020
  2. camilledejoye commented on Mar 14, 2020

    @camilledejoye
    Contributor

    We can improve this by combining extensions with implementations/policy, e.g.
    phpactor/reference-finder: policy and extension
    phpactor/reference-finder-rpc: handlers and extension
    phpactor/reference-finder-language-server: handlers and extension
    phpactor/reference-finder-worse-reflection: implementation of policy and extension

    I like this one more but it's still a lot of packages.
    So we could try one package but with clear directory structure:

    • phpactor/reference-finder: policy and extension
    • phpactor/reference-finder/protocols/rpc: handlers and extension
    • phpactor/reference-finder/protocols/language-server: handlers and extension
    • phpactor/reference-finder/adapters/worse-reflection: implementation of policy and extension

    So we benefit from having only one package but still keeping a clear separation so if it was a bad idea it will be really easy to split it into independent packages ?

  3. dantleech commented on Mar 14, 2020

    @dantleech
    CollaboratorAuthor

    Problem is that we then pull in a huge number of dependencies and I think increase risk of cross-package contamination.

    Merging implementation extensions into implementation packages is still keeping strong separation between policy and implementation - it's also easier.

  4. mamazu commented on Mar 17, 2024

    @mamazu
    Contributor

    This could probably be closed as those packages have all been merged into the core. Right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions