lit / lit/lit.dev

Add doc for getPropertyDescriptor

Open
#215 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
142
Forks
230
PR merge metrics
No merged PRs in 30d

Description

Currently we cover custom property accessors, but not overriding `getPropertyDescriptor`, which lets you customize the way accessors are generated for all properties, among other things. This is something you'd be likely to do when creating a new base class that extends either ReactiveElement or LitElement.

This is kind of an advanced use case. Need to figure out whether it goes in the properties section, or whether there's a set of advanced topics related to creating your own base class.

"There's some examples in the tests. The idea is you can use it in combination with customizing property options to add features via creating a base class...

https://github.com/Polymer/lit-html/blob/lit-next/packages/reactive-element/src/test/reactive-element_test.ts#L1766-L1967

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the examples in packages/reactive-element/src/test/reactive-element_test.ts, especially lines 1766-1967, to understand getPropertyDescriptor and its use with customized property options. Then determine whether the explanation belongs in the properties section or in advanced guidance for creating a base class. Done means documenting this use case and its relationship to ReactiveElement and LitElement.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.