diff --git a/.changeset/long-chefs-jump.md b/.changeset/long-chefs-jump.md new file mode 100644 index 000000000000..ed8f47614bfb --- /dev/null +++ b/.changeset/long-chefs-jump.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +The scrollend mechanism is a better way to record the scroll position compared to throttling, so we now use it whenever a browser supports it. \ No newline at end of file diff --git a/benchmark/bench/_util.js b/benchmark/bench/_util.js index c9108695cf98..23c4726046bc 100644 --- a/benchmark/bench/_util.js +++ b/benchmark/bench/_util.js @@ -1,6 +1,9 @@ -import { createRequire } from 'module'; +import { createRequire } from 'node:module'; +import path from 'node:path'; -export const astroBin = createRequire(import.meta.url).resolve('astro'); +const astroPkgPath = createRequire(import.meta.url).resolve('astro/package.json'); + +export const astroBin = path.resolve(astroPkgPath, '../astro.js'); /** @typedef {{ avg: number, stdev: number, max: number }} Stat */ diff --git a/benchmark/make-project/server-stress-default.js b/benchmark/make-project/server-stress-default.js index 20094daa6f3c..79e8b260af6c 100644 --- a/benchmark/make-project/server-stress-default.js +++ b/benchmark/make-project/server-stress-default.js @@ -7,11 +7,13 @@ import { loremIpsum } from './_util.js'; export async function run(projectDir) { await fs.rm(projectDir, { recursive: true, force: true }); await fs.mkdir(new URL('./src/pages', projectDir), { recursive: true }); + await fs.mkdir(new URL('./src/components', projectDir), { recursive: true }); await fs.writeFile( new URL('./src/pages/index.astro', projectDir), `\ --- +import Paragraph from '../components/Paragraph.astro' const content = "${loremIpsum}" --- @@ -25,13 +27,26 @@ const content = "${loremIpsum}"
{content}
')} + ${Array.from({ length: 100 }) + .map(() => '{content}
') + .join('\n')} +