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

Custom lit converter not being called #11670

Closed
1 task
lp247 opened this issue Aug 11, 2024 · 2 comments
Closed
1 task

Custom lit converter not being called #11670

lp247 opened this issue Aug 11, 2024 · 2 comments
Labels
pkg: lit Related to Lit (scope)

Comments

@lp247
Copy link

lp247 commented Aug 11, 2024

Astro Info

Astro                    v4.13.3
Node                     v18.20.3
System                   Linux (x64)
Package Manager          unknown
Output                   static
Adapter                  none
Integrations             @astrojs/lit

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

File src/components/A.js is a lit component with a custom converter for the attribute 'text'. This converter should convert the attribute given as text to the length of the text. This converter is not called.

What's the expected result?

The converter should be called and the rendered text should be "6" instead of "AAAAAA".

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-kwbwgy?file=src%2Fcomponents%2FA.js

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Aug 11, 2024
@matthewp matthewp added pkg: lit Related to Lit (scope) and removed needs triage Issue needs to be triaged labels Aug 12, 2024
@JulianCataldo
Copy link

JulianCataldo commented Aug 21, 2024

Screenshot 2024-08-21 at 21 16 26 Screenshot 2024-08-21 at 21 17 45

Quick and dirty test. Sorry for the screenshots.

Some observations:

  • Properties are not serialized at all, independently of the Lit converter thing. This is weird, I don't remember such a glaring issue.
  • Loading MyTest once, and subsequently, <my-test> will me picked up and rendered as such.
  • Removing MyTest import, restart server, Astro's Custom Element Registry implementation doesn't pick up <my-test> anymore.
  • Import the component in a client script tag, and the client component is picked up again, this time with the serialized attributes. Wut?

This is not very scientific, just poking around. I don't fully understand what is going with these discrepancies.

@florian-lefebvre
Copy link
Member

In 5.0, we removed the Lit integration so we don't plan to address this issue. If you’re interested in maintaining a Lit integration yourself, you may wish to use the last published version of @astrojs/lit as a starting point and upgrade the relevant packages.

@florian-lefebvre florian-lefebvre closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: lit Related to Lit (scope)
Projects
None yet
Development

No branches or pull requests

4 participants