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

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

Merged
merged 3 commits into from Feb 4, 2023

Conversation

43081j
Copy link
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.
@changeset-bot
Copy link

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
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!

events: Map<string, Event>;
slots: Map<string, NamedDescribed>;
cssProperties: Map<string, NamedDescribed>;
cssParts: Map<string, NamedDescribed>;
}

export class LitElementDeclaration extends ClassDeclaration {
interface LitElementDeclarationInit extends CustomElementDeclarationInit {
reactiveProperties: Map<string, ReactiveProperty>;
Copy link
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
Member

I'm looking into the CI failures...

@kevinpschaaf
Copy link
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.

None yet

2 participants