Skip to content

Commit

Permalink
ci: update integration docs
Browse files Browse the repository at this point in the history
  • Loading branch information
delucis authored Aug 5, 2023
1 parent 058fbdc commit 2ba63d4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/content/docs/en/guides/integrations-guide/deno.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ npm run preview
After [performing a build](/en/guides/deploy/#building-your-site-locally) there will be a `dist/server/entry.mjs` module. You can start a server by importing this module in your Deno app:
```js
import './dist/entry.mjs';
import './dist/server/entry.mjs';
```
See the `start` option below for how you can have more control over starting the Astro server.
Expand Down Expand Up @@ -141,7 +141,7 @@ If you disable this, you need to write your own Deno web server. Import and call
```ts
import { serve } from 'https://deno.land/[email protected]/http/server.ts';
import { handle } from './dist/entry.mjs';
import { handle } from './dist/server/entry.mjs';
serve((req: Request) => {
// Check the request, maybe do static file handling here.
Expand Down
18 changes: 4 additions & 14 deletions src/content/docs/en/guides/integrations-guide/lit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,35 +82,25 @@ To use your first Lit component in Astro, head to our [UI framework documentatio
* 💧 client-side hydration options, and
* 🤝 opportunities to mix and nest frameworks together

However, there's a key difference with Lit *custom elements* over conventional *components*: you can use the element tag name directly.

Astro needs to know which tag is associated with which component script. We expose this through exporting a `tagName` variable from the component script. It looks like this:
Writing and importing a Lit component in Astro looks like this:

```js
// src/components/my-element.js
import { LitElement, html } from 'lit';

const tagName = 'my-element';

export class MyElement extends LitElement {
render() {
return html` <p>Hello world! From my-element</p> `;
}
}

customElements.define(tagName, MyElement);
customElements.define('my-element', MyElement);
```

> Note that exporting the `tagName` is **required** if you want to use the tag name in your templates. Otherwise you can export and use the constructor, like with non custom element frameworks.
In your Astro template import this component as a side-effect and use the element.
Now, the component is ready to be imported via the Astro frontmatter:

```astro
---
// src/pages/index.astro
import { MyElement } from '../components/my-element.js';
---
// src/pages/index.astro import {MyElement} from '../components/my-element.js';
<MyElement />
```

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/integrations-guide/netlify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export function get() {
* The [Astro Netlify Edge Starter](https://github.com/sarahetter/astro-netlify-edge-starter) provides an example and a guide in the README.
* [Browse Astro Netlify projects on GitHub](https://github.com/search?q=path%3A**%2Fastro.config.mjs+%40astrojs%2Fnetlify&type=code) for more examples!
* [Browse Astro Netlify projects on GitHub](https://github.com/search?q=path%3A**%2Fastro.config.mjs+%40astrojs%2Fnetlify\&type=code) for more examples!
## Troubleshooting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export default defineConfig({

## Examples

* [Browse projects with Astro Partytown on GitHub](https://github.com/search?q=%22@astrojs/partytown%22+filename:package.json\&type=Code) for more examples!
* [Browse projects with Astro Partytown on GitHub](https://github.com/search?q=%22%40astrojs%2Fpartytown%22+path%3A**%2Fpackage.json\&type=code) for more examples!

## Troubleshooting

Expand Down

0 comments on commit 2ba63d4

Please sign in to comment.