Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate the ability to define static observedAttributes as a map of attribute names to attribute handlers for non-decorator users, and instead create a new static observedAttributeHandlers for that purpose. #27

Merged
merged 1 commit into from
Sep 15, 2024

Conversation

trusktr
Copy link
Member

@trusktr trusktr commented Sep 15, 2024

This keeps the type of static observedAttributes clean and aligned with the DOM spec, while the new static observedAttributeHandlers has the type definition for the library-specific feature. Plus this prevents type issues downstream because the @element decorator (callable as a function when not using decorators) coerces the object format into the standard array format, yet the object type will still sppear in subclasses despite that it is never an object in subclasses.

  • deprecation: static observedAttributes = {} is deprecated, and only the standard static observedAttributes = [] should be used. The object format will be removed in a breaking version bump.

  • infra: Unrestrict the typescript version so we can keep it updated with other packages in the lume repo.

…s a map of attribute names to attribute handlers for non-decorator users, and instead create a new `static observedAttributeHandlers` for that purpose. This keeps the type of `static observedAttributes` clean and aligned with the DOM spec, while the new `static observedAttributeHandlers` has the type definition for the library-specific feature. Plus this prevents type issues downstream because the `@element` decorator (callable as a function when not using decorators) coerces the object format into the standard array format, yet the object type will still sppear in subclasses despite that it is never an object in subclasses.

    - deprecation: `static observedAttributes = {}` is deprecated, and only the standard `static observedAttributes = []` should be used. The object format will be removed in a breaking version bump.
- infra: Unrestrict the `typescript` version so we can keep it updated with other packages in the lume repo.
@trusktr trusktr merged commit 8287981 into main Sep 15, 2024
0 of 3 checks passed
@trusktr trusktr deleted the improve-observedAttributes-type branch September 15, 2024 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant