Skip to content

feat (labs/analyzer): support custom element analysis#3621

Merged
kevinpschaaf merged 3 commits intolit:mainfrom
43081j:acee
Feb 4, 2023
Merged

feat (labs/analyzer): support custom element analysis#3621
kevinpschaaf merged 3 commits intolit:mainfrom
43081j:acee

Conversation

@43081j
Copy link
Copy Markdown
Collaborator

@43081j 43081j commented Jan 30, 2023

This separates the current lit-element analysis into two layers:

  • custom elements
  • lit

Primarily this is so we can detect non-lit elements we may depend on inside a lit project, giving the user full coverage of all the elements they're consuming.


@kevinpschaaf i had to do a lot of conflict resolution when getting this based onto master. so in the end i just made a new branch and cherry picked it out

if you could re-review to be sure all looks good still, that'd be appreciated

we also still need to figure out how to properly test this... roughly the same tests could be run against both lit and vanilla in theory. for now its the existing tests mostly, but maybe another pr can improve that

This separates the current lit-element analysis into two layers:

* custom elements
* lit

Primarily this is so we can detect non-lit elements we may depend on
inside a lit project, giving the user full coverage of all the elements
they're consuming.
@43081j 43081j requested a review from justinfagnani as a code owner January 30, 2023 20:36
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 30, 2023

🦋 Changeset detected

Latest commit: b239042

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@lit-labs/analyzer Minor
@lit-labs/cli Patch
@lit-labs/gen-manifest Patch
@lit-labs/gen-utils Patch
@lit-labs/gen-wrapper-angular Patch
@lit-labs/gen-wrapper-react Patch
@lit-labs/gen-wrapper-vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown
Member

@kevinpschaaf kevinpschaaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks James!


export class LitElementDeclaration extends ClassDeclaration {
interface LitElementDeclarationInit extends CustomElementDeclarationInit {
reactiveProperties: Map<string, ReactiveProperty>;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll do this in a separate PR, but I want to figure out how to reconcile reactiveProperties here with ClassField... Feels like one should just be a subtype of the other (or just a CustomElementClassField).

@kevinpschaaf
Copy link
Copy Markdown
Member

I'm looking into the CI failures...

@kevinpschaaf
Copy link
Copy Markdown
Member

we also still need to figure out how to properly test this...

Yeah, it would be nice to refactor the tests a bit to dedupe them down, but we can handle that separately. For now I just aligned the (mostly duplicate) vanilla tests to the JSDoc-related changes I made at the end of my last PR.

@kevinpschaaf kevinpschaaf merged commit dfdc3f7 into lit:main Feb 4, 2023
@lit-robot lit-robot mentioned this pull request Mar 10, 2023
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.

2 participants