Skip to content

Commit

Permalink
Use astro: namespace modules (#4239)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp authored Aug 19, 2023
1 parent 6a32051 commit 0f62bd2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/content/docs/en/guides/middleware.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ You can import and use the utility function `defineMiddleware()` to take advanta

```ts
// src/middleware.ts
import { defineMiddleware } from "astro/middleware";
import { defineMiddleware } from "astro:middleware";
// `context` and `next` are automatically typed
export const onRequest = defineMiddleware((context, next) => {
Expand Down Expand Up @@ -137,7 +137,7 @@ export const onRequest = async (context, next) => {
Multiple middlewares can be joined in a specified order using [`sequence()`](#sequence):
```js title="src/middleware.js"
import { sequence } from "astro/middleware";
import { sequence } from "astro:middleware";
async function validation(_, next) {
console.log("validation request");
Expand Down Expand Up @@ -218,4 +218,4 @@ This function can be used by integrations/adapters to programmatically execute t

### `trySerializeLocals`

A low-level API that takes in any value and tries to return a serialized version (a string) of it. If the value cannot be serialized, the function will throw a runtime error.
A low-level API that takes in any value and tries to return a serialized version (a string) of it. If the value cannot be serialized, the function will throw a runtime error.
4 changes: 2 additions & 2 deletions src/content/docs/en/guides/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ To help you debug your Astro components, Astro provides a built-in [`<Debug />`]

```astro {2,7}
---
import { Debug } from 'astro/components';
import { Debug } from 'astro:components';
const sum = (a, b) => a + b;
---
Expand All @@ -210,7 +210,7 @@ The Debug component supports a variety of syntax options for even more flexible

```astro {2,7-9}
---
import { Debug } from 'astro/components';
import { Debug } from 'astro:components';
const sum = (a, b) => a + b;
const answer = sum(2, 4);
---
Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/en/reference/api-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1044,13 +1044,13 @@ export default function () {

## Built-in Components

Astro includes several built-in components for you to use in your projects. All built-in components are available in `.astro` files via `import {} from 'astro/components';`.
Astro includes several built-in components for you to use in your projects. All built-in components are available in `.astro` files via `import {} from 'astro:components';`.

### `<Code />`

```astro 'theme="dark-plus"' /wrap\b/ /(inline) \/>/
---
import { Code } from 'astro/components';
import { Code } from 'astro:components';
---
<!-- Syntax highlight some JavaScript code. -->
<Code code={`const foo = 'bar';`} lang="js" />
Expand Down Expand Up @@ -1112,7 +1112,7 @@ See the [list of languages supported by Prism](https://prismjs.com/#supported-la
```astro
---
import { Debug } from 'astro/components';
import { Debug } from 'astro:components';
const serverObject = {
a: 0,
b: "string",
Expand Down

0 comments on commit 0f62bd2

Please sign in to comment.