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

[WIP] lit cheat sheet #1355

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

[WIP] lit cheat sheet #1355

wants to merge 5 commits into from

Conversation

e111077
Copy link
Contributor

@e111077 e111077 commented Jul 19, 2024

See it here:

https://pr1355-6a15f47---lit-dev-5ftespv5na-uc.a.run.app/articles/lit-cheat-sheet/

This PR also adds lazy loading to lit-example via intersection observer so that we do not load the 300kb TS worker a million times per page and so that it can cache.

Copy link

github-actions bot commented Jul 19, 2024

A live preview of this PR will be available at the URL(s) below.
The latest URL will be appended to this comment on each push.
Each build takes ~5-10 minutes, and will 404 until finished.

https://pr1355-18538bf---lit-dev-5ftespv5na-uc.a.run.app/
https://pr1355-e59a623---lit-dev-5ftespv5na-uc.a.run.app/
https://pr1355-6a15f47---lit-dev-5ftespv5na-uc.a.run.app/
https://pr1355-a8a295e---lit-dev-5ftespv5na-uc.a.run.app/
https://pr1355-e9dfe0e---lit-dev-5ftespv5na-uc.a.run.app/
https://pr1355-e2f12bc---lit-dev-5ftespv5na-uc.a.run.app/
https://pr1355-cf5f9c1---lit-dev-5ftespv5na-uc.a.run.app/

@justinfagnani
Copy link
Contributor

Whoa, awesome!!!

I'm reading through now and my first/only comment is that some of the example are really long compared to their main topic. I think the Templating section has the most of this. eg, the event listener expression example could just be a single button and an output element (similar to the common counter example) without validation, etc.

It would be great to get in small Task and Context example too, and may an ElementInternals thing (custom state?).

@e111077
Copy link
Contributor Author

e111077 commented Jul 19, 2024

I was uploading this in hopes of getting something up and running in the live preview. Also I'm not sure how much I can contribute to this because coming up with and subsequently plowing through the boilerplate for example takes up a lot more time than expected and my calendar is getting filled up with other work. My plan forward was either of the following:

  1. get this reviewed and in and make it a living document with other contributors adding to it
  2. keep this up and have someone else fork it and pick it up from there

@justinfagnani
Copy link
Contributor

I can definitely contribute to refining this branch! This is such a good start.

@e111077
Copy link
Contributor Author

e111077 commented Jul 19, 2024

let me debug get this working in the preview first!

@e111077
Copy link
Contributor Author

e111077 commented Jul 20, 2024

lol it was a real bug and not a flake. good job, tests!

@e111077 e111077 marked this pull request as ready for review July 20, 2024 00:49
@filimon-danopoulos
Copy link

I've read through it and it will be a gold mine. I have the same thought as Justin about section length.

One thing that stod out was the mention of running on the server in the lifecycle section. Seems a little premature given that the SSR package is still in labs. I think that the lifecycle section could be compacted into a table instead.

Would it be reasonable to include a short glossary section?

I have a couple of smaller suggestions with the text but I get the impression that we don't want to put these here but in a separate PR.

@e111077
Copy link
Contributor Author

e111077 commented Jul 23, 2024

Thanks for the look-over Filimon! The nice thing about articles is that they have more of a chance to live as a living document, so lifecycle reference can change over time. Though I do think that this information is very useful for people trying to actually use our SSR package and we should strive to make it easier to use. I also agree with you and think that there needs to be some sort of "labs" warning near that

@JosefJezek
Copy link

Could you write a page about Lit vs React? With comparisons all Lit + Signal solutions instead of React hooks.

resources:

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.

4 participants