Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Conversation

@rictic
Copy link
Contributor

@rictic rictic commented Dec 15, 2019

@ExportDecoratedItemsIfPublic is a new decorator modifier for fields which should only be exported if public. When private or protected they are renamable and may be eliminated as dead code. This is more optimal version of @ExportDecoratedItems for fields which can only be accessed by reflection if they're public.

Our use case ExportDecoratedItemsIfPublic is the LitElement @Property decorator, where public properties are accessible as HTML attributes and may be written by raw HTML files or various template languages (lit-html, soy, angular templates, etc). This obviously is taking place outside of the class hierarchy of the element and so is only valid for public properties, but it is still useful for private properties to participate in the update lifecycle that comes along with @Property.

This change, combined with the already-landed #1125 we'll be able to remove the final @ExportDecoratedItems annotation from the LitElement decorators.

@ExportDecoratedItemsIfPublic is a new decorator modifier for fields which should only be exported if public. When private or protected they are renamable and may be eliminated as dead code. This is more optimal version of @ExportDecoratedItems for fields which can only be accessed by reflection if they're public.

Our use case ExportDecoratedItemsIfPublic is the LitElement @Property decorator, where public properties are accessible as HTML attributes and may be written by raw HTML files or various template languages (lit-html, soy, angular templates, etc). This obviously is taking place outside of the class hierarchy of the element and so is only valid for public properties, but it is still useful for private properties to participate in the update lifecycle that comes along with @Property.

This change, combined with the already-landed angular#1125 we'll be able to remove the final @ExportDecoratedItems annotation from the LitElement decorators.
@rictic
Copy link
Contributor Author

rictic commented Dec 15, 2019

Internal CL (with global presubmit): cl/285597256

@mprobst
Copy link
Contributor

mprobst commented Mar 5, 2020

We've decided not to go ahead with this, and instead have the library use different decorators.

@mprobst mprobst closed this Mar 5, 2020
@rictic
Copy link
Contributor Author

rictic commented Mar 5, 2020

See lit/lit-element#881 for the approach we're taking with LitElement

@rictic rictic deleted the export-if-public branch March 5, 2020 23:24
@rictic rictic restored the export-if-public branch March 5, 2020 23:24
@rictic rictic deleted the export-if-public branch March 5, 2020 23:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants