Skip to content

Using Lit & TypeScript guide #110

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

Merged
merged 15 commits into from
May 7, 2025
Merged

Using Lit & TypeScript guide #110

merged 15 commits into from
May 7, 2025

Conversation

hollyschinsky
Copy link
Collaborator

New Guide for Developing with Lit & TypeScript

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Collaborator

@undavide undavide left a comment

Choose a reason for hiding this comment

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

Great work, Holly!! ❤️

Comment on lines 398 to 404
Next, you can explore more advanced features of Lit and TypeScript to enhance your components. Some areas to explore include:

- **Event Handling**: Learn how to handle events in Lit components and communicate between components.
- **Component Composition**: Explore how to compose multiple components together to create complex UIs.
- **State Management**: Implement state management solutions like Redux or MobX to manage the state of your components.
- **Performance Optimization**: Optimize your components for performance by using memoization, lazy loading, and other techniques.
- **Testing**: Write unit tests for your components using tools like Jest or Mocha to ensure their correctness and reliability.
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be great to have links for all the next steps, like

- [**Event Handling**](https://lit.dev/docs/v1/components/events/): Learn how to handle events in Lit components and communicate between components.
- [**Component Composition**](https://lit.dev/docs/composition/component-composition/): Explore how to compose multiple components together to create complex UIs.

@undavide
Copy link
Collaborator

I also see that the Linter is complaining... 🙄

Copy link
Collaborator

@nimithajalal nimithajalal left a comment

Choose a reason for hiding this comment

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

This is a tech core guide. I love the content. Can we make some minor tweaks to improve the flow of the content and make it result-oriented?

@@ -17,6 +17,10 @@ An example of how this works in Visual Studio Code is shown in this short clip b
<iframe src="https://drive.google.com/file/d/1FzUaPZMjPD9k0ANQNibqRMiZRrSAIChg/preview" width="800" height="450" allow="autoplay"></iframe>
</div>

<InlineAlert slots="text" variant="info"/>

Make sure you check out the [Using Lit & Typescript Guide](./lit-guide.md) for a more detailed explanation of how to use TypeScript with the Add-on SDK.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Check out the Using Lit & Typescript Guide for a more detailed explanation of using TypeScript with the Add-on SDK.

@@ -61,6 +65,13 @@ new CopyWebpackPlugin({

The CLI supports two different [react-based templates](../getting_started/dev_tooling.md#templates), and the [code samples](../../samples.md) repository contains various add-ons built with React for you to use as a reference.

## Lit Framework

The CLI provides [starter template options](../getting_started/dev_tooling.md#templates) which provide a basic setup to allow you to use the Lit framework, a lightweight library for building fast, lightweight web components. There are currently template options available for either using basic JavaScript (`swc-javascript`) with Lit or TypeScript (`swc-typescript`), preconfigured to help you get started.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Build fast, lightweight web components using the Lit framework. Our CLI offers [starter templates(../getting_started/dev_tooling.md#templates) to help you get started:

  • swc-javascript: For building with Lit and JavaScript
  • swc-typescript: For building with Lit and TypeScript

Both templates come pre-configured with the necessary setup and dependencies.

For detailed guidance on using Lit with TypeScript, you can check out our [Using Lit & TypeScript Guide](./using-lit-typescript.md).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we have section headers similar to these?

  • What can you do with this guide? And why should you use this?
  • Prerequisites
  • Getting Started
  • Core Concepts - Required for achieving the end result.
  • Component Development
  • Advanced features- If any
  • Integration with Adobe Add-on SDK
    • Testing and Debugging
    • Deployment
  • End-to-end sample code
  • Troubleshooting


When you develop add-ons with a combination of [Lit](https://lit.dev/) and [TypeScript](https://https://www.typescriptlang.org/), you get the benefits of both worlds; a lightweight component library with reactive properties and templating capabilities, which help you build fast and efficient components, and the robust type system provided by TypeScript.

## Lit Key Features
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these general features specific to us?

If these are generic, we can put in the pre-req and say, we assume, you know these.

}
```

## Create a new Lit Component
Copy link
Collaborator

Choose a reason for hiding this comment

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

I assume this is the end goal of this document. If yes, then, we should call it out in the beginning, mentioning, this is what we are teaching you.

@hollyschinsky hollyschinsky merged commit 583d891 into main May 7, 2025
4 checks passed
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.

3 participants