Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: withastro/astro
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @astrojs/[email protected]
Choose a base ref
...
head repository: withastro/astro
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing 315 changed files with 5,869 additions and 2,040 deletions.
5 changes: 5 additions & 0 deletions .changeset/old-clouds-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/mdx': patch
---

Fixes a bug that caused Image component to be imported on MDX pages that did not include images
5 changes: 5 additions & 0 deletions .changeset/pink-years-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Processes markdown with empty body as remark and rehype plugins may add additional content or frontmatter
5 changes: 5 additions & 0 deletions .changeset/seven-feet-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Allows configuring Astro modules TypeScript compilation with the `vite.esbuild` config
5 changes: 5 additions & 0 deletions .changeset/strong-cobras-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/mdx': patch
---

Makes internal `check()` function a no-op to allow faster component renders and prevent React 19 component warnings
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/---01-bug-report.yml
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ body:
id: bug-reproduction
attributes:
label: Link to Minimal Reproducible Example
description: 'Use [astro.new](https://astro.new) to create a minimal reproduction of the problem. **A minimal reproduction is required** so that others can help debug your issue. If a report is vague (e.g. just a generic error message) and has no reproduction, it may be auto-closed. Not sure how to create a minimal example? [Read our guide](https://docs.astro.build/en/guides/troubleshooting/#creating-minimal-reproductions)'
description: 'Use [StackBlitz](https://astro.new/repro) to create a minimal reproduction of the problem. **A minimal reproduction is required** so that others can help debug your issue. If a report is vague (e.g. just a generic error message) and has no reproduction, it may be auto-closed. Not sure how to create a minimal example? [Read our guide](https://docs.astro.build/en/guides/troubleshooting/#creating-minimal-reproductions)'
placeholder: 'https://stackblitz.com/abcd1234'
validations:
required: true
3 changes: 2 additions & 1 deletion .github/workflows/continuous_benchmark.yml
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@ jobs:
uses: CodSpeedHQ/action@513a19673a831f139e8717bf45ead67e47f00044 # v3.2.0
timeout-minutes: 30
with:
run: pnpm benchmark codspeed
working-directory: ./benchmark
run: pnpm bench
token: ${{ secrets.CODSPEED_TOKEN }}

2 changes: 1 addition & 1 deletion .github/workflows/issue-labeled.yml
Original file line number Diff line number Diff line change
@@ -26,5 +26,5 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository or [StackBlitz](https://astro.new). Issues marked with `needs repro` will be closed if they have no activity within 3 days.
Hello @${{ github.event.issue.user.login }}. Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository or [StackBlitz](https://astro.new/repro). Issues marked with `needs repro` will be closed if they have no activity within 3 days.
labels: "needs triage"
42 changes: 20 additions & 22 deletions .github/workflows/sync-examples.yml
Original file line number Diff line number Diff line change
@@ -3,6 +3,9 @@ name: Sync examples
on:
workflow_dispatch:
inputs:
checkout-ref:
type: string
required: false
skip-unchanged-check:
type: boolean
default: false
@@ -31,16 +34,25 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 2 # fetch 2 to compare with previous commit for changes
ref: ${{ inputs.checkout-ref }}

- name: Detect changesets
uses: bluwy/detect-changesets-action@v1
id: detect

- name: Get pre mode of changesets
id: pre
run: |
if [ -f ./.changeset/pre.json ]; then
pre_value=$(jq -r '.tag' ./.changeset/pre.json)
echo "value=$pre_value" >> $GITHUB_OUTPUT
fi
# We only do sync if there are no changesets, so we don't accidentally allow users
# to clone examples that may rely on unreleased code

- name: Sync from main branch to latest and examples/* branches
if: steps.detect.outputs.has-changesets == 'false' && github.ref == 'refs/heads/main'
- name: Sync stable to latest and examples/* branches
if: steps.detect.outputs.has-changesets == 'false' && github.ref == 'refs/heads/main' && steps.pre.outputs.value == ''
uses: bluwy/auto-branch-sync-action@v1
with:
map: |
@@ -49,38 +61,24 @@ jobs:
skip-unchanged-check: ${{ inputs.skip-unchanged-check == true }}
dry-run: ${{ inputs.dry-run == true }}

- name: Check .changeset/pre.json for matching tag
if: steps.detect.outputs.has-changesets == 'false' && github.ref == 'refs/heads/next'
id: check-pre-mode
run: |
if [ -f ./.changeset/pre.json ]; then
if grep -q '"tag": "alpha"' ./.changeset/pre.json; then
echo "alpha=true" >> $GITHUB_OUTPUT
elif grep -q '"tag": "beta"' ./.changeset/pre.json; then
echo "beta=true" >> $GITHUB_OUTPUT
elif grep -q '"tag": "rc"' ./.changeset/pre.json; then
echo "rc=true" >> $GITHUB_OUTPUT
fi
fi
- name: Sync from next branch to alpha branch
if: steps.detect.outputs.has-changesets == 'false' && steps.check-pre-mode.outputs.alpha == 'true'
- name: Sync prerelease to alpha branch
if: steps.detect.outputs.has-changesets == 'false' && steps.pre.outputs.value == 'alpha'
uses: bluwy/auto-branch-sync-action@v1
with:
map: / -> alpha
skip-unchanged-check: ${{ inputs.skip-unchanged-check == true }}
dry-run: ${{ inputs.dry-run == true }}

- name: Sync from next branch to beta branch
if: steps.detect.outputs.has-changesets == 'false' && steps.check-pre-mode.outputs.beta == 'true'
- name: Sync prerelease to beta branch
if: steps.detect.outputs.has-changesets == 'false' && steps.pre.outputs.value == 'beta'
uses: bluwy/auto-branch-sync-action@v1
with:
map: / -> beta
skip-unchanged-check: ${{ inputs.skip-unchanged-check == true }}
dry-run: ${{ inputs.dry-run == true }}

- name: Sync from next branch to rc branch
if: steps.detect.outputs.has-changesets == 'false' && steps.check-pre-mode.outputs.rc == 'true'
- name: Sync prerelease to rc branch
if: steps.detect.outputs.has-changesets == 'false' && steps.pre.outputs.value == 'rc'
uses: bluwy/auto-branch-sync-action@v1
with:
map: / -> rc
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ dist/
.vercel
.netlify
_site/
.astro/
scripts/smoke/*-main/
scripts/memory/project/src/pages/
benchmark/projects/
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -11,7 +11,6 @@
<div align="center">

[![main](https://github.com/withastro/astro/actions/workflows/ci.yml/badge.svg)](https://github.com/withastro/astro/actions/workflows/ci.yml)
[![next](https://github.com/withastro/astro/actions/workflows/ci.yml/badge.svg?branch=next)](https://github.com/withastro/astro/actions/workflows/ci.yml)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/withastro/astro/blob/main/LICENSE)
[![npm version](https://badge.fury.io/js/astro.svg)](https://badge.fury.io/js/astro)

11 changes: 11 additions & 0 deletions benchmark/bench/_util.js
Original file line number Diff line number Diff line change
@@ -19,3 +19,14 @@ export function calculateStat(numbers) {
const max = Math.max(...numbers);
return { avg, stdev, max };
}

export async function makeProject(name) {
console.log('Making project:', name);
const projectDir = new URL(`../projects/${name}/`, import.meta.url);

const makeProjectMod = await import(`../make-project/${name}.js`);
await makeProjectMod.run(projectDir);

console.log('Finished making project:', name);
return projectDir;
}
48 changes: 48 additions & 0 deletions benchmark/bench/codspeed.bench.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { fileURLToPath } from 'node:url';
import { exec } from 'tinyexec';
import { beforeAll, bench, describe } from 'vitest';
import { astroBin, makeProject } from './_util.js';
let streamingApp;
let nonStreamingApp;
beforeAll(async () => {
const render = await makeProject('render-bench');
const root = fileURLToPath(render);
await exec(astroBin, ['build'], {
nodeOptions: {
cwd: root,
stdio: 'inherit',
},
});
const entry = new URL('./dist/server/entry.mjs', `file://${root}`);
const { manifest, createApp } = await import(entry);
streamingApp = createApp(manifest, true);
nonStreamingApp = createApp(manifest, false);
}, 900000);

describe('Bench rendering', () => {
bench('Rendering: streaming [true], .astro file', async () => {
const request = new Request(new URL('http://exmpale.com/astro'));
await streamingApp.render(request);
});
bench('Rendering: streaming [true], .md file', async () => {
const request = new Request(new URL('http://exmpale.com/md'));
await streamingApp.render(request);
});
bench('Rendering: streaming [true], .mdx file', async () => {
const request = new Request(new URL('http://exmpale.com/mdx'));
await streamingApp.render(request);
});

bench('Rendering: streaming [false], .astro file', async () => {
const request = new Request(new URL('http://exmpale.com/astro'));
await nonStreamingApp.render(request);
});
bench('Rendering: streaming [false], .md file', async () => {
const request = new Request(new URL('http://exmpale.com/md'));
await nonStreamingApp.render(request);
});
bench('Rendering: streaming [false], .mdx file', async () => {
const request = new Request(new URL('http://exmpale.com/mdx'));
await nonStreamingApp.render(request);
});
});
64 changes: 0 additions & 64 deletions benchmark/bench/codspeed.js

This file was deleted.

46 changes: 10 additions & 36 deletions benchmark/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import mri from 'mri';
import fs from 'node:fs/promises';
import path from 'node:path';
import {fileURLToPath, pathToFileURL} from 'node:url';
import { pathToFileURL } from 'node:url';
import mri from 'mri';
import { makeProject } from './bench/_util.js';

const args = mri(process.argv.slice(2));

@@ -14,7 +15,6 @@ Command
memory Run build memory and speed test
render Run rendering speed test
server-stress Run server stress test
codspeed Run codspeed test
cli-startup Run CLI startup speed test
Options
@@ -30,7 +30,6 @@ const benchmarks = {
render: () => import('./bench/render.js'),
'server-stress': () => import('./bench/server-stress.js'),
'cli-startup': () => import('./bench/cli-startup.js'),
codspeed: () => import('./bench/codspeed.js')
};

if (commandName && !(commandName in benchmarks)) {
@@ -39,26 +38,12 @@ if (commandName && !(commandName in benchmarks)) {
}

if (commandName) {
if (commandName === 'codspeed') {
const render = await makeProject('render-bench');
const rootRender = fileURLToPath(render);
const bench = benchmarks[commandName];
const benchMod = await bench();
const payload = {
render: {
root: rootRender,
output: await getOutputFile('render')
},
};
await benchMod.run(payload);
} else {
// Run single benchmark
const bench = benchmarks[commandName];
const benchMod = await bench();
const projectDir = await makeProject(args.project || benchMod.defaultProject);
const outputFile = await getOutputFile(commandName);
await benchMod.run(projectDir, outputFile);
}
// Run single benchmark
const bench = benchmarks[commandName];
const benchMod = await bench();
const projectDir = await makeProject(args.project || benchMod.defaultProject);
const outputFile = await getOutputFile(commandName);
await benchMod.run(projectDir, outputFile);
} else {
// Run all benchmarks
for (const name in benchmarks) {
@@ -70,21 +55,10 @@ if (commandName) {
}
}

export async function makeProject(name) {
console.log('Making project:', name);
const projectDir = new URL(`./projects/${name}/`, import.meta.url);

const makeProjectMod = await import(`./make-project/${name}.js`);
await makeProjectMod.run(projectDir);

console.log('Finished making project:', name);
return projectDir;
}

/**
* @param {string} benchmarkName
*/
async function getOutputFile(benchmarkName) {
export async function getOutputFile(benchmarkName) {
let file;
if (args.output) {
file = pathToFileURL(path.resolve(args.output));
Loading