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

Remove @astrojs/lit #11680

Merged
merged 9 commits into from
Aug 19, 2024
Merged

Remove @astrojs/lit #11680

merged 9 commits into from
Aug 19, 2024

Conversation

matthewp
Copy link
Contributor

@matthewp matthewp commented Aug 12, 2024

Changes

This removes the Lit integration as an official integration. The reasons for doing so in 5.0:

  • Only 1% of Astro users use this integration.
  • SSR support in Lit is at a lower-level of support due to be a Labs project: https://lit.dev/docs/libraries/labs/, and has been in this state since we added support a couple of years ago.
  • The maintenance cost of fixing bugs in this integration is too high given the low usage. Some PRs for upgrading Lit versions have taken quite a long time. We can't justify the core team being responsible for this going forward.
  • There used to be community contributions to fix bugs but this has fallen off for various reasons.

Given that, this PR removes the integration as one that is officially supported by the Astro core team. Interested community members are encouraged to fork the integration and continue the development in another repository.

Testing

  • Tests removed

Docs

This removes the Lit integration as an official integration. The reasons
for doing so in 5.0:

- Only 1% of Astro users use this integration.
- SSR support in Lit is at a lower-level of support due to be a Labs
project: https://lit.dev/docs/libraries/labs/, and has been in this
state since we added support a couple of years ago.
- The maintenance cost of fixing bugs in this integration is too high
given the low usage. Some PRs for upgrading Lit versions have taken
quite a long time. We can't justify the core team being responsible for
this going forward.
- There used to be community contributions to fix bugs but this has
fallen off for various reasons.

Given that, this PR removes the integration as one that is officially
supported by the Astro core team. Interested community members are
encouraged to fork the integration and continue the development in
another repository.
Copy link

changeset-bot bot commented Aug 12, 2024

⚠️ No Changeset found

Latest commit: 644f85c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

@github-actions github-actions bot added pkg: lit Related to Lit (scope) pkg: integration Related to any renderer integration (scope) pkg: astro Related to the core `astro` package (scope) labels Aug 12, 2024
@github-actions github-actions bot added the pkg: example Related to an example package (scope) label Aug 12, 2024
@Princesseuh
Copy link
Member

Princesseuh commented Aug 12, 2024

There's a hack here you might be able to remove too:

// HACK! The lit renderer doesn't include a clientEntrypoint for custom elements, allow it

(there's also a mention of the integration in that same file)

@Princesseuh
Copy link
Member

in packages/astro/src/runtime/server/render/component.ts there's also a mention of the integration for the error message

@matthewp matthewp marked this pull request as ready for review August 13, 2024 12:42
@matthewp matthewp merged commit 3822e57 into next Aug 19, 2024
12 of 14 checks passed
@matthewp matthewp deleted the rm-lit-int branch August 19, 2024 12:12
@JosefJezek
Copy link

Please don't remove Lit, this small lib has not alternative. SSR support is on the way.

FYI @justinfagnani

@kr05
Copy link

kr05 commented Oct 9, 2024

That's unfortunate, I have been actively using this integration for the past 2 years. Lit support was the main reason for choosing to try out Astro in the first place. Does that mean we won't be able to use lit with Astro 5?

@leo29plns
Copy link

I was drawn to Astro because of Lit and its philosophy, so it's a bit unfortunate to see Lit support phased out in Astro 5, though I understand the reasons behind it :/ Now, let's create some extremely exciting code with React (yes, irony ahah)

@Princesseuh
Copy link
Member

Note that it's most definitely allowed and encouraged to fork the integration and continue using it in Astro 5, it should work just fine.

@metagrapher
Copy link

Changes

This removes the Lit integration as an official integration. The reasons for doing so in 5.0:

  • Only 1% of Astro users use this integration.

You cannot know this for certain, your telemetry of usage can only see what is reported.

The ratio of people who choose not to provide telemetry data, to those who do allow telemetry reporting, is probably quite high among the demographic of people who would use Lit instead of React, Svelte, or Vue, all of whom have privacy implications built in to them. A great number of EU users, and an increasing number of US users, are not keen on allowing Facebook a backdoor to their website just to compile React, for example.

Just as well, 1% of 100,000 users is 1000 users.
That is 1000 web devs who you did consider, simply by virtue of having their needs on the roadmap at all, even if slow, and of whom you choose to no longer consider the needs because you have deemed them insignificant.

  • The maintenance cost of fixing bugs in this integration is too high given the low usage. Some PRs for upgrading Lit versions have taken quite a long time. We can't justify the core team being responsible for this going forward.

There is a community for these things, and you all used to operate as a nice open source stack community, but is that no longer happening?

  • There used to be community contributions to fix bugs but this has fallen off for various reasons.

I'm guessing then is it time to fork the whole project, now that this has become official?

It seems that there are legitimate concerns that would go unaddressed without some dedicated people working on it--those people could be volunteers, or if there are companies who depend on the integration, they could put dev resources into maintaining the parts that suit them--, in the least the community could have been asked to support this before killing it, as is the tradition in open source software dev.

@Princesseuh
Copy link
Member

Princesseuh commented Dec 4, 2024

The Lit integration gets 2-3k downloads per week on npm, stat which you cannot opt-out of, outside of complex setups. Matthew also summarised our numbers at 1%, but it's in truth lower than that. A 1000 active users would be amazing. Last month, @astrojs/image, an integration we deprecated two majors versions ago had more downloads than the Lit integration.

The Lit integration is fairly small (something like 300 lines roughly, I believe) and we have asked around for people to fork and support it in the community, it should definitely be doable for anyone motivated enough. Bonus point for any companies using it. A few years ago the Lit team was interested and used to send PRs, but I'm not sure if those people still work at Google.

Anedoctally, from asking around and support threads, we've also found that people sometimes used the Lit integration only for the Lit part and not really the SSR, making the integration not useful (and actually making the components made with it worse, as they went through an unnecessary wrapper). In both cases however, you can still use Lit and Lit SSR directly without a dedicated integration, though for the latter it might be less ergonomic.

We're sorry for the inconvenience, in a perfect world, we'd maintain everything.

@kr05
Copy link

kr05 commented Dec 4, 2024

I think it's mainly the feeling of disappointment about yet another project that drops support for Lit. I've been a staunch Lit advocate for many years now and it always feels like we are swimming against the current. I really wish more people saw the value proposition Lit provides and that more people used it, but that's unfortunately not the case and I completely understand when projects don't want to dedicate resources for such a small user base. The only thing I will say is, that small user base greatly appreciates the work you have done to give Lit a home within Astro, and although it does hurt to lose official support, hopefully we can figure out a path forward to ensure Lit keeps its place within Astro.

@metagrapher
Copy link

metagrapher commented Dec 6, 2024

Thank you @Princesseuh

Anedoctally, from asking around and support threads, we've also found that people sometimes used the Lit integration only for the Lit part and not really the SSR, making the integration not useful (and actually making the components made with it worse, as they went through an unnecessary wrapper). In both cases however, you can still use Lit and Lit SSR directly without a dedicated integration, though for the latter it might be less ergonomic.

I understand, and this makes sense. There's probably not that much benefit to the SSR integration, agreed. Since Lit is basically web components made ergonomic, I do think that it could still be seen as a baseline way to deal with client-side script without resorting to suggesting loading React or Vue, which do seem to somewhat undermine the whole point of Astro. So, this is a super pertinent point you make.

We're sorry for the inconvenience, in a perfect world, we'd maintain everything.

I understand and appreciate that you've at least put a lot of thought and consideration into the decision. It probably isn't as inconvenient as I initially suspected, as you pointed out; and as @kr05 mentioned, it's probably mostly just the disappointment of yet another project dropping support for Lit.

🔭...At risk of tangenting into ticket-scope-creep....

I think it would be ideal that Lit be the de facto method of demonstrating islands and client side interaction in Astro, given its lightweight nature and that you don't need to know or understand React or Vue to get there. That adjustment might even have a complementary effect of making Astro more approachable generally, especially to people who don't prefer React. Then the use of Vue and React become dressing, and not default. As well, it would highlight the framework agnostic nature of Astro better than demoing React.

I'd note that a lot of UI libraries and templates for Astro are really just React and so don't take advantage of Astro very well, and still require me to load React into my project, and that's frustrating.

(I'm specifically using Astro because it is not React and Vue, and I don't often need to reach for Lit... but there are times when client-side interaction is necessary, so I find the tutorials referencing React to be cumbersome and prevalent. This is verging on a whole other issue. I'm happy to create a new ticket if this is not the place for this documentation discussion, but it felt relevant. 🙏🏼)

@matthewp
Copy link
Contributor Author

matthewp commented Dec 6, 2024

I like and use Lit often. I never personally used it in Astro though. If I did I would be maintaining an integration for it. It's really not that difficult, just a small amount of code, and you already have the existing code to start from. The fact that there isn't one already is because no one is motivated enough to do the very small amount of work required. Such is life.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) pkg: example Related to an example package (scope) pkg: integration Related to any renderer integration (scope) pkg: lit Related to Lit (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants