Skip to content

Commit

Permalink
Merge branch 'main' into patch-16
Browse files Browse the repository at this point in the history
  • Loading branch information
yanthomasdev authored Feb 6, 2025
2 parents 97e5a5a + e90abc1 commit 4b5e337
Show file tree
Hide file tree
Showing 119 changed files with 2,265 additions and 1,884 deletions.
2 changes: 1 addition & 1 deletion astro.sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export const sidebar = [
'reference/experimental-flags/client-prerender',
'reference/experimental-flags/content-intellisense',
'reference/experimental-flags/sessions',
'reference/experimental-flags/serialized-configuration',
],
}),
'reference/legacy-flags',
Expand Down Expand Up @@ -171,7 +172,6 @@ export const sidebar = [
'guides/integrations-guide/mdx',
'guides/integrations-guide/partytown',
'guides/integrations-guide/sitemap',
'guides/integrations-guide/tailwind',
],
}),
'reference/publish-to-npm',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@astrojs/sitemap": "^3.2.1",
"@astrojs/starlight": "^0.30.5",
"@expressive-code/plugin-collapsible-sections": "^0.38.3",
"@lunariajs/core": "https://pkg.pr.new/lunariajs/lunaria/@lunariajs/core@62a858f",
"@lunariajs/core": "https://pkg.pr.new/lunariajs/lunaria/@lunariajs/core@4c8b9b0",
"canvas-confetti": "^1.6.0",
"jsdoc-api": "^9.3.4",
"rehype-autolink-headings": "^7.1.0",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/lunaria/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export const LocaleDetails = (
</ul>`
: ''}
${missingFiles.length == 0 && outdatedFiles.length == 0
? html`<p>"This translation is complete, amazing job! 🎉"</p>`
? html`<p>This translation is complete, amazing job! 🎉</p>`
: ''}
</details>
`;
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/editor-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Our amazing community maintains several extensions for other popular editors, in
- [VS Code Extension on Open VSX](https://open-vsx.org/extension/astro-build/astro-vscode) <span style="margin: 0.25em;"><Badge text="Official" /></span> - The official Astro VS Code Extension, available on the Open VSX registry for open platforms like [VSCodium](https://vscodium.com/)
- [Nova Extension](https://extensions.panic.com/extensions/sciencefidelity/sciencefidelity.astro/) <span style="margin: 0.25em;"><Badge class="neutral-badge" text="Community" /></span> - Provides syntax highlighting and code completion for Astro inside of Nova
- [Vim Plugin](https://github.com/wuelnerdotexe/vim-astro) <span style="margin: 0.25em;"><Badge class="neutral-badge" text="Community" /></span> - Provides syntax highlighting, indentation, and code folding support for Astro inside of Vim or Neovim
- Neovim [LSP](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#astro) and [TreeSitter](https://github.com/virchau13/tree-sitter-astro) Plugins <span style="margin: 0.25em;"><Badge class="neutral-badge" text="Community" /></span> - Provides syntax highlighting, treesitter parsing, and code completion for Astro inside of Neovim
- Neovim [LSP](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#astro) and [TreeSitter](https://github.com/virchau13/tree-sitter-astro) Plugins <span style="margin: 0.25em;"><Badge class="neutral-badge" text="Community" /></span> - Provides syntax highlighting, treesitter parsing, and code completion for Astro inside of Neovim
- Emacs - See instructions for [Configuring Emacs and Eglot](https://medium.com/@jrmjrm/configuring-emacs-and-eglot-to-work-with-astro-language-server-9408eb709ab0) <span style="margin: 0.25em;"><Badge class="neutral-badge" text="Community" /></span> to work with Astro
- [Astro syntax highlighting for Sublime Text](https://packagecontrol.io/packages/Astro) <span style="margin: 0.25em;"><Badge class="neutral-badge" text="Community" /></span> - The Astro package for Sublime Text, available on the Sublime Text package manager.

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ For detailed setup instructions, check out the [Better Auth Installation Guide](

Configure your database table to store user data and your preferred authentication methods as described in the [Better Auth Installation Guide](https://www.better-auth.com/docs/installation#configure-database). Then, you'll need to mount the Better Auth handler in your Astro project.

```ts title="page/api/auth/[...all].ts"
```ts title="src/pages/api/auth/[...all].ts"
import { auth } from "../../../lib/auth"; // import your Better Auth instance
import type { APIRoute } from "astro";

Expand Down
14 changes: 3 additions & 11 deletions src/content/docs/en/guides/deploy/cloudflare.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,15 @@ To get started, you will need:
## How to deploy a site with Git

<Steps>
1. Set up a new project on Cloudflare Pages.
1. Push your code to your git repository (GitHub, GitLab).

2. Push your code to your git repository (GitHub, GitLab).

3. Log in to the Cloudflare dashboard and select your account in **Account Home** > **Compute (Workers)** > **Workers & Pages** > **Overview**.

4. Select **Create application**, then the **Pages** tab and then select the **Connect to Git** option.

5. Select the git project you want to deploy and click **Begin setup**

6. Use the following build settings:
2. Set up a new project on Cloudflare Pages. Use the following build settings:

- **Framework preset**: `Astro`
- **Build command:** `npm run build`
- **Build output directory:** `dist`

7. Click the **Save and Deploy** button.
3. Click the **Save and Deploy** button.
</Steps>

## How to deploy a site using Wrangler
Expand Down
29 changes: 10 additions & 19 deletions src/content/docs/en/guides/fonts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -103,30 +103,21 @@ See the [Fontsource guide to preloading fonts](https://fontsource.org/docs/getti

## Register fonts in Tailwind

If you are using the [Tailwind integration](/en/guides/integrations-guide/tailwind/), you can use either of the previous methods on this page to install your font, with some modification. You can either add an [`@font-face` statement for a local font](#using-a-local-font-file) or use [Fontsource's `import` strategy](#using-fontsource) to install your font.
If you are using [Tailwind](/en/guides/styling/#tailwind), you can use either of the previous methods on this page to install your font, with some modifications. You can either add an [`@font-face` statement for a local font](#using-a-local-font-file) or use [Fontsource's `import` strategy](#using-fontsource) to install your font.

To register your font in Tailwind:

<Steps>
1. Follow either of the guides above, but skip the final step of adding `font-family` to your CSS.
2. Add the typeface name to `tailwind.config.mjs`.

This example adds `Inter` to the sans-serif font stack, with default fallback fonts from Tailwind CSS.

```js title="tailwind.config.mjs" ins={1,8-10}
import defaultTheme from 'tailwindcss/defaultTheme'

/** @type {import('tailwindcss').Config} */
export default {
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
theme: {
extend: {
fontFamily: {
sans: ['Inter', ...defaultTheme.fontFamily.sans],
},
},
},
plugins: [],
2. Add the typeface name to `src/styles/global.css`.

This example adds `Inter` to the sans-serif font stack.

```css title="src/styles/global.css" ins={3-5}
@import 'tailwindcss';

@theme {
--font-sans: 'Inter', 'sans-serif';
}
```

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/en/guides/imports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,15 @@ Markdown files loaded with `import.meta.glob()` return the following `MarkdownIn

```ts
export interface MarkdownInstance<T extends Record<string, any>> {
/* Any data specified in this file's YAML frontmatter */
/* Any data specified in this file's YAML/TOML frontmatter */
frontmatter: T;
/* The absolute file path of this file */
file: string;
/* The rendered path of this file */
url: string | undefined;
/* Astro Component that renders the contents of this file */
Content: AstroComponentFactory;
/** (Markdown only) Raw Markdown file content, excluding layout HTML and YAML frontmatter */
/** (Markdown only) Raw Markdown file content, excluding layout HTML and YAML/TOML frontmatter */
rawContent(): string;
/** (Markdown only) Markdown file compiled to HTML, excluding layout HTML */
compiledContent(): string;
Expand Down
2 changes: 0 additions & 2 deletions src/content/docs/en/guides/integrations-guide/lit.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
title: 'Lit'
description: Using Lit to extend component support in your Astro project.
sidebar:
label: Lit
i18nReady: true
---

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/integrations-guide/mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ The following properties are available to a `.astro` component when using an `im

- **`file`** - The absolute file path (e.g. `/home/user/projects/.../file.mdx`).
- **`url`** - The URL of the page (e.g. `/en/guides/markdown-content`).
- **`frontmatter`** - Contains any data specified in the file’s YAML frontmatter.
- **`frontmatter`** - Contains any data specified in the file’s YAML/TOML frontmatter.
- **`getHeadings()`** - An async function that returns an array of all headings (`<h1>` to `<h6>`) in the file with the type: `{ depth: number; slug: string; text: string }[]`. Each heading’s `slug` corresponds to the generated ID for a given heading and can be used for anchor links.
- **`<Content />`** - A component that returns the full, rendered contents of the file.
- **(any `export` value)** - MDX files can also export data with an `export` statement.
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 @@ -4,7 +4,7 @@ title: '@astrojs/netlify'
description: Learn how to use the @astrojs/netlify SSR adapter to deploy your Astro project.
sidebar:
label: Netlify
githubIntegrationURL: 'https://github.com/withastro/adapters/tree/main/packages/netlify/'
githubIntegrationURL: 'https://github.com/withastro/astro/tree/main/packages/integrations/netlify/'
category: adapter
i18nReady: true
---
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/integrations-guide/node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: '@astrojs/node'
description: Learn how to use the @astrojs/node SSR adapter to deploy your Astro project.
sidebar:
label: Node
githubIntegrationURL: 'https://github.com/withastro/adapters/tree/main/packages/node/'
githubIntegrationURL: 'https://github.com/withastro/astro/tree/main/packages/integrations/node/'
category: adapter
i18nReady: true
---
Expand Down
20 changes: 20 additions & 0 deletions src/content/docs/en/guides/integrations-guide/react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,26 @@ export default defineConfig({
});
```

### Disable streaming (experimental)

Astro streams the output of React components by default. However, you can disable this behavior by enabling the `experimentalDisableStreaming` option. This is particularly helpful for supporting libraries that don’t work well with streaming, like some CSS-in-JS solutions.

To disable streaming for all React components in your project, configure `@astrojs/react` with `experimentalDisableStreaming: true`:

```js title="astro.config.mjs" ins={8}
import { defineConfig } from 'astro/config';
import react from '@astrojs/react';

export default defineConfig({
// ...
integrations: [
react({
experimentalDisableStreaming: true,
}),
],
});
```

[astro-integration]: /en/guides/integrations-guide/

[astro-ui-frameworks]: /en/guides/framework-components/#using-framework-components
Loading

0 comments on commit 4b5e337

Please sign in to comment.