From 2ba63d4423a8c546109c228ecdfb6014144501a4 Mon Sep 17 00:00:00 2001 From: delucis Date: Sat, 5 Aug 2023 12:03:53 +0000 Subject: [PATCH 1/3] ci: update integration docs --- .../docs/en/guides/integrations-guide/deno.mdx | 4 ++-- .../docs/en/guides/integrations-guide/lit.mdx | 18 ++++-------------- .../en/guides/integrations-guide/netlify.mdx | 2 +- .../en/guides/integrations-guide/partytown.mdx | 2 +- 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/content/docs/en/guides/integrations-guide/deno.mdx b/src/content/docs/en/guides/integrations-guide/deno.mdx index 37da542c8d99a..ae640672a0455 100644 --- a/src/content/docs/en/guides/integrations-guide/deno.mdx +++ b/src/content/docs/en/guides/integrations-guide/deno.mdx @@ -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. @@ -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/std@0.167.0/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. diff --git a/src/content/docs/en/guides/integrations-guide/lit.mdx b/src/content/docs/en/guides/integrations-guide/lit.mdx index 00d2a5e7e710d..6f0a3ea898490 100644 --- a/src/content/docs/en/guides/integrations-guide/lit.mdx +++ b/src/content/docs/en/guides/integrations-guide/lit.mdx @@ -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`

Hello world! From my-element

`; } } -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'; ``` diff --git a/src/content/docs/en/guides/integrations-guide/netlify.mdx b/src/content/docs/en/guides/integrations-guide/netlify.mdx index 585e60921e36c..64ccffce8b1d6 100644 --- a/src/content/docs/en/guides/integrations-guide/netlify.mdx +++ b/src/content/docs/en/guides/integrations-guide/netlify.mdx @@ -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 diff --git a/src/content/docs/en/guides/integrations-guide/partytown.mdx b/src/content/docs/en/guides/integrations-guide/partytown.mdx index 32a0a12f69531..b869b2bbce1ea 100644 --- a/src/content/docs/en/guides/integrations-guide/partytown.mdx +++ b/src/content/docs/en/guides/integrations-guide/partytown.mdx @@ -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 From 1aabfb6541fb2ec2acbdfc996f8a55858b1f7e0c Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Sat, 5 Aug 2023 19:06:38 +0200 Subject: [PATCH 2/3] Discard changes to src/content/docs/en/guides/integrations-guide/netlify.mdx --- src/content/docs/en/guides/integrations-guide/netlify.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/integrations-guide/netlify.mdx b/src/content/docs/en/guides/integrations-guide/netlify.mdx index 64ccffce8b1d6..585e60921e36c 100644 --- a/src/content/docs/en/guides/integrations-guide/netlify.mdx +++ b/src/content/docs/en/guides/integrations-guide/netlify.mdx @@ -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 From 59308e228b026f5a8746e684b442831826b9e20b Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Sat, 5 Aug 2023 19:07:08 +0200 Subject: [PATCH 3/3] Remove bad backslash --- src/content/docs/en/guides/integrations-guide/partytown.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/integrations-guide/partytown.mdx b/src/content/docs/en/guides/integrations-guide/partytown.mdx index b869b2bbce1ea..1c94a78df5716 100644 --- a/src/content/docs/en/guides/integrations-guide/partytown.mdx +++ b/src/content/docs/en/guides/integrations-guide/partytown.mdx @@ -142,7 +142,7 @@ export default defineConfig({ ## 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! +* [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