Skip to content

Replace @internal with @not-config and remove @config #128

Open
@GuySartorelli

Description

@GuySartorelli

As mentioned in #59, currently @internal on a private static property makes it not configuration, but that annotation also means "this is not included in our public API and may change at any time"

To have configuration that isn't part of our public API, we have to have @internal and @config which cancel each other out. That is the only use case for @config.

@internal doesn't semantically mean "this isn't configuration", so using it to stop a property from being configuration is confusing. Many developers may not be aware that it's causing that side effect.

Because of all of this, we should deprecate the logic that makes @internal stop being config, and replace it with a new @not-config annotation. That does a few things:

  1. Makes it easy to tell (even for someone not familiar with the intimate details of this library) when a private static property is not config
  2. Allows us to use @internal for configuration without having to also add @config
  3. Simplifies the code (slightly)

Obviously for backwards compatibility the existing logic will have to sit along-side the new, to be removed in a future major release.

Acceptance Criteria

  • Using @internal with @config results in a deprecation warning
  • New @not-config annotation results in false returning from PrivateStaticTransformer::isConfigProperty()
  • There are clear comments in the code to ensure that in a future major release the @internal and @config annotations are no longer handled in PrivateStaticTransformer

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions