Skip to content

Consider hiding the merged interface #8

Closed
@vRallev

Description

@vRallev

Right now the API for components looks like this:

@Component
@MergeComponent
@SingleInAppScope
abstract class AppComponent(
  @get:Provides val input: Input,
) : AppComponentMerged

We could turn it into the follow and generate the real component ourselves:

@MergeComponent
@SingleInAppScope
abstract class AppComponent(
  @get:Provides val input: Input,
)

That saves a step in the setup and avoids running an initial build to generate AppComponentMerged. The downside is that the IDE doesn't know that AppComponent will implement the contributed components and inheritance in the IDE doesn't work properly. The inheritance chain from:

ContributedComponent -> AppComponentMerged -> AppComponent

To this:

ContributedComponent -> GeneratedAppComponent
                      ^
AppComponent --------/

There is no connection between ContributedComponent and AppComponent.

I personally prefer giving the IDE more power and add the interface manually.

Note that the situation for Anvil itself is different, because it's able to modify source code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions