Skip to content

Commit

Permalink
Merge branch 'main' into bugfix/prefetch-files
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored May 19, 2023
2 parents 73df659 + cf06694 commit 907990f
Show file tree
Hide file tree
Showing 39 changed files with 271 additions and 142 deletions.
5 changes: 5 additions & 0 deletions .changeset/friendly-garlics-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fix routes created by `injectRoute` for SSR
5 changes: 5 additions & 0 deletions .changeset/good-frogs-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Emit middleware as an entrypoint during build
5 changes: 5 additions & 0 deletions .changeset/popular-rules-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Emit pages as dynamic import chunks during the build
5 changes: 5 additions & 0 deletions .changeset/swift-lamps-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Add route information when warning of `getStaticPaths()` ignored
5 changes: 5 additions & 0 deletions .changeset/tasty-geese-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fix unnecessary warning showing on start when a collection folder was empty. The warning was also enhanced to add more information about possible causes.
2 changes: 1 addition & 1 deletion examples/with-markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/markdoc": "^0.1.2",
"@astrojs/markdoc": "^0.2.0",
"astro": "^2.4.1",
"kleur": "^4.1.5"
}
Expand Down
10 changes: 5 additions & 5 deletions packages/astro/e2e/client-only.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test.afterAll(async () => {

test.describe('Client only', () => {
test('React counter', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = await page.locator('#react-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand All @@ -33,7 +33,7 @@ test.describe('Client only', () => {
});

test('Preact counter', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = await page.locator('#preact-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand All @@ -51,7 +51,7 @@ test.describe('Client only', () => {
});

test('Solid counter', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = await page.locator('#solid-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand All @@ -69,7 +69,7 @@ test.describe('Client only', () => {
});

test('Vue counter', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = await page.locator('#vue-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand All @@ -87,7 +87,7 @@ test.describe('Client only', () => {
});

test('Svelte counter', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = await page.locator('#svelte-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand Down
10 changes: 5 additions & 5 deletions packages/astro/e2e/errors.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test.afterAll(async ({ astro }) => {

test.describe('Error display', () => {
test('detect syntax errors in template', async ({ page, astro }) => {
await page.goto(astro.resolveUrl('/astro-syntax-error'));
await page.goto(astro.resolveUrl('/astro-syntax-error'), { waitUntil: 'networkidle' });

const message = (await getErrorOverlayContent(page)).message;
expect(message).toMatch('Unexpected "}"');
Expand All @@ -37,7 +37,7 @@ test.describe('Error display', () => {
});

test('shows useful error when frontmatter import is not found', async ({ page, astro }) => {
await page.goto(astro.resolveUrl('/import-not-found'));
await page.goto(astro.resolveUrl('/import-not-found'), { waitUntil: 'networkidle' });

const message = (await getErrorOverlayContent(page)).message;
expect(message).toMatch('Could not import ../abc.astro');
Expand All @@ -53,7 +53,7 @@ test.describe('Error display', () => {
});

test('shows correct file path when a page has an error', async ({ page, astro }) => {
await page.goto(astro.resolveUrl('/import-not-found'));
await page.goto(astro.resolveUrl('/import-not-found'), { waitUntil: 'networkidle' });

const { fileLocation, absoluteFileLocation } = await getErrorOverlayContent(page);
const absoluteFileUrl = 'file://' + absoluteFileLocation.replace(/:\d+:\d+$/, '');
Expand All @@ -64,7 +64,7 @@ test.describe('Error display', () => {
});

test('shows correct file path when a component has an error', async ({ page, astro }) => {
await page.goto(astro.resolveUrl('/preact-runtime-error'));
await page.goto(astro.resolveUrl('/preact-runtime-error'), { waitUntil: 'networkidle' });

const { fileLocation, absoluteFileLocation } = await getErrorOverlayContent(page);
const absoluteFileUrl = 'file://' + absoluteFileLocation.replace(/:\d+:\d+$/, '');
Expand All @@ -75,7 +75,7 @@ test.describe('Error display', () => {
});

test('framework errors recover when fixed', async ({ page, astro }) => {
await page.goto(astro.resolveUrl('/svelte-syntax-error'));
await page.goto(astro.resolveUrl('/svelte-syntax-error'), { waitUntil: 'networkidle' });

const message = (await getErrorOverlayContent(page)).message;
expect(message).toMatch('</div> attempted to close an element that was not open');
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/e2e/hydration-race.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test.afterEach(async () => {

test.describe('Hydration race', () => {
test('Islands inside of slots hydrate', async ({ page, astro }) => {
await page.goto('/slot');
await page.goto(astro.resolveUrl('/slot'));

const html = await page.content();

Expand Down
24 changes: 12 additions & 12 deletions packages/astro/e2e/multiple-frameworks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test.afterAll(async () => {

test.skip('Multiple frameworks', () => {
test.skip('React counter', async ({ page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = page.locator('#react-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand All @@ -30,7 +30,7 @@ test.skip('Multiple frameworks', () => {
});

test('Preact counter', async ({ page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = page.locator('#preact-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand All @@ -45,7 +45,7 @@ test.skip('Multiple frameworks', () => {
});

test.skip('Solid counter', async ({ page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = page.locator('#solid-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand All @@ -60,7 +60,7 @@ test.skip('Multiple frameworks', () => {
});

test('Vue counter', async ({ page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = page.locator('#vue-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand All @@ -75,7 +75,7 @@ test.skip('Multiple frameworks', () => {
});

test('Svelte counter', async ({ page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = page.locator('#svelte-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand All @@ -90,7 +90,7 @@ test.skip('Multiple frameworks', () => {
});

test('Astro components', async ({ page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const aComponent = page.locator('#astro-a');
await expect(aComponent, 'component is visible').toBeVisible();
Expand All @@ -103,7 +103,7 @@ test.skip('Multiple frameworks', () => {

test.describe('HMR', () => {
test('Page template', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const slot = page.locator('#preact-counter + .counter-message');
await expect(slot, 'initial slot content').toHaveText('Hello Preact!');
Expand All @@ -116,7 +116,7 @@ test.skip('Multiple frameworks', () => {
});

test('React component', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const count = page.locator('#react-counter pre');
await expect(count, 'initial count updated to 0').toHaveText('0');
Expand All @@ -129,7 +129,7 @@ test.skip('Multiple frameworks', () => {
});

test('Preact component', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const count = page.locator('#preact-counter pre');
await expect(count, 'initial count updated to 0').toHaveText('0');
Expand All @@ -142,7 +142,7 @@ test.skip('Multiple frameworks', () => {
});

test('Solid component', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const count = page.locator('#solid-counter pre');
await expect(count, 'initial count updated to 0').toHaveText('0');
Expand All @@ -157,7 +157,7 @@ test.skip('Multiple frameworks', () => {
// TODO: re-enable this test when #3559 is fixed
// https://github.com/withastro/astro/issues/3559
test.skip('Vue component', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const count = page.locator('#vue-counter pre');
await expect(count, 'initial count updated to 0').toHaveText('0');
Expand All @@ -172,7 +172,7 @@ test.skip('Multiple frameworks', () => {
// TODO: track down a reliability issue in this test
// It seems to lost connection to the vite server in CI
test.skip('Svelte component', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const count = page.locator('#svelte-counter pre');
await expect(count, 'initial count is 0').toHaveText('0');
Expand Down
8 changes: 4 additions & 4 deletions packages/astro/e2e/namespaced-component.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ test.afterAll(async () => {
});

test.describe('Hydrating namespaced components', () => {
test('Preact Component', async ({ page }) => {
await page.goto('/');
test('Preact Component', async ({ astro, page }) => {
await page.goto(astro.resolveUrl('/'));

// Counter declared with: <ns.components.PreactCounter id="preact-counter-namespace" client:load>
const namespacedCounter = page.locator('#preact-counter-namespace');
Expand Down Expand Up @@ -54,8 +54,8 @@ test.describe('Hydrating namespaced components', () => {
await expect(namedCount, 'count incremented by 1').toHaveText('1');
});

test('MDX', async ({ page }) => {
await page.goto('/mdx');
test('MDX', async ({ astro, page }) => {
await page.goto(astro.resolveUrl('/mdx'));

// Counter declared with: <ns.components.PreactCounter id="preact-counter-namespace" client:load>
const namespacedCounter = page.locator('#preact-counter-namespace');
Expand Down
10 changes: 5 additions & 5 deletions packages/astro/e2e/nested-in-preact.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test.afterAll(async () => {

test.describe('Nested Frameworks in Preact', () => {
test('React counter', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = page.locator('#react-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand All @@ -32,7 +32,7 @@ test.describe('Nested Frameworks in Preact', () => {
});

test('Preact counter', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = page.locator('#preact-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand All @@ -49,7 +49,7 @@ test.describe('Nested Frameworks in Preact', () => {
});

test('Solid counter', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = page.locator('#solid-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand All @@ -66,7 +66,7 @@ test.describe('Nested Frameworks in Preact', () => {
});

test('Vue counter', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = page.locator('#vue-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand All @@ -83,7 +83,7 @@ test.describe('Nested Frameworks in Preact', () => {
});

test('Svelte counter', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = page.locator('#svelte-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand Down
10 changes: 5 additions & 5 deletions packages/astro/e2e/nested-in-react.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test.afterAll(async () => {

test.describe('Nested Frameworks in React', () => {
test('React counter', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = page.locator('#react-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand All @@ -32,7 +32,7 @@ test.describe('Nested Frameworks in React', () => {
});

test('Preact counter', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = page.locator('#preact-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand All @@ -49,7 +49,7 @@ test.describe('Nested Frameworks in React', () => {
});

test('Solid counter', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = page.locator('#solid-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand All @@ -66,7 +66,7 @@ test.describe('Nested Frameworks in React', () => {
});

test('Vue counter', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = page.locator('#vue-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand All @@ -83,7 +83,7 @@ test.describe('Nested Frameworks in React', () => {
});

test('Svelte counter', async ({ astro, page }) => {
await page.goto('/');
await page.goto(astro.resolveUrl('/'));

const counter = page.locator('#svelte-counter');
await expect(counter, 'component is visible').toBeVisible();
Expand Down
Loading

0 comments on commit 907990f

Please sign in to comment.