Skip to content

Commit 583d891

Browse files
Merge pull request #110 from AdobeDocs/lit-guide
Using Lit & TypeScript guide
2 parents 55e7d09 + d6e2326 commit 583d891

File tree

4 files changed

+464
-4
lines changed

4 files changed

+464
-4
lines changed

gatsby-config.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,11 @@ module.exports = {
838838
{
839839
title: "Frameworks, Libraries and Bundling",
840840
path: "guides/develop/frameworks-libraries-bundling.md",
841-
},
841+
},
842+
{
843+
title: "Using Lit & TypeScript",
844+
path: "guides/develop/using-lit-typescript.md",
845+
},
842846
{
843847
title: "Performance Tips",
844848
path: "guides/develop/performance.md",

src/pages/guides/develop/frameworks-libraries-bundling.md

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

20+
<InlineAlert slots="text" variant="info"/>
21+
22+
Check out the [Using Lit & Typescript Guide](./using-lit-typescript.md) for a more detailed explanation of using TypeScript with the Add-on SDK.
23+
2024
## Webpack & JavaScript bundler
2125

2226
When using Node libraries or other frameworks, you'll often need to use a JavaScript bundler. All of the templates the CLI provides (other than the basic `javascript` template) are pre-configured for webpack via the `--use` option set on the `ccweb-add-on-scripts` commands. If you create a new add-on project based on a react or typescript based template for instance, you will see the following `scripts` block generated in your `package.json`, and the existence of a `webpack.config.js` in the root of your project:
@@ -63,10 +67,25 @@ The CLI supports two different [react-based templates](../getting_started/dev_to
6367

6468
## Lit Framework
6569

66-
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.
70+
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:
71+
72+
- `swc-javascript`: For building with Lit and JavaScript
73+
- `swc-typescript`: For building with Lit and TypeScript
74+
- `swc-typescript-with-document-sandbox`: For building with Lit and TypeScript with the Document Sandbox
75+
- `swc-javascript-with-document-sandbox`: For building with Lit and JavaScript with the Document Sandbox
76+
77+
All templates come pre-configured with the necessary setup and dependencies.
6778

68-
<!-- To learn more about developing with [Lit](https://lit.dev/), be sure to check out the [Using Lit & TypeScript Guide](./using-lit-typescript.md). -->
79+
For detailed guidance on using Lit with TypeScript, you can check out our [Using Lit & TypeScript Guide](./using-lit-typescript.md).
6980

7081
## Other JavaScript and CSS libraries
7182

72-
You should be able to use any other JavaScript or CSS libraries you might want to include in your add-ons (ie: jQuery, Bootstrap) without any issues. Just make sure you include the necessary scripts and stylesheets in your project, and ensure they are bundled correctly by your chosen bundler.
83+
You can enhance your add-ons with additional JavaScript and CSS libraries like jQuery or Bootstrap. Follow these steps to integrate them:
84+
85+
1. Add the library's scripts and stylesheets to your project.
86+
2. Configure your bundler to process these files.
87+
3. Import the libraries where needed in your code.
88+
89+
<InlineAlert slots="text" variant="info"/>
90+
91+
Make sure your chosen bundler is properly configured to handle any additional libraries you include.

0 commit comments

Comments
 (0)