Skip to content

Commit

Permalink
Merge branch 'main' into patch-3
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishi Raj Jain authored Nov 14, 2023
2 parents f640c31 + 554017b commit e42dde6
Show file tree
Hide file tree
Showing 67 changed files with 630 additions and 144 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-lemons-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

When redirecting to the default root locale, Astro middleare should take into consideration the value of `trailingSlash`
5 changes: 5 additions & 0 deletions .changeset/dirty-zoos-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fixes display of debug messages when using the `--verbose` flag
5 changes: 5 additions & 0 deletions .changeset/famous-hats-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fix Passthrough image service generating multiple images with the same content in certain cases
5 changes: 5 additions & 0 deletions .changeset/new-pets-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Supports `formmethod` and `formaction` for form overrides
5 changes: 5 additions & 0 deletions .changeset/six-chefs-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Add a new settings panel to the dev overlay
2 changes: 1 addition & 1 deletion examples/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^3.5.2"
"astro": "^3.5.3"
}
}
2 changes: 1 addition & 1 deletion examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"@astrojs/mdx": "^1.1.4",
"@astrojs/rss": "^3.0.0",
"@astrojs/sitemap": "^3.0.3",
"astro": "^3.5.2"
"astro": "^3.5.3"
}
}
2 changes: 1 addition & 1 deletion examples/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^3.5.2"
"astro": "^3.5.3"
},
"peerDependencies": {
"astro": "^3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-alpine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"@astrojs/alpinejs": "^0.3.1",
"@types/alpinejs": "^3.7.2",
"alpinejs": "^3.12.3",
"astro": "^3.5.2"
"astro": "^3.5.3"
}
}
2 changes: 1 addition & 1 deletion examples/framework-lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/lit": "^3.0.3",
"@webcomponents/template-shadowroot": "^0.2.1",
"astro": "^3.5.2",
"astro": "^3.5.3",
"lit": "^2.8.0"
}
}
2 changes: 1 addition & 1 deletion examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@astrojs/solid-js": "^3.0.2",
"@astrojs/svelte": "^4.0.3",
"@astrojs/vue": "^3.0.4",
"astro": "^3.5.2",
"astro": "^3.5.3",
"preact": "^10.17.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/preact": "^3.0.1",
"@preact/signals": "^1.2.1",
"astro": "^3.5.2",
"astro": "^3.5.3",
"preact": "^10.17.1"
}
}
2 changes: 1 addition & 1 deletion examples/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@astrojs/react": "^3.0.4",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"astro": "^3.5.2",
"astro": "^3.5.3",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/solid-js": "^3.0.2",
"astro": "^3.5.2",
"astro": "^3.5.3",
"solid-js": "^1.7.11"
}
}
2 changes: 1 addition & 1 deletion examples/framework-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/svelte": "^4.0.3",
"astro": "^3.5.2",
"astro": "^3.5.3",
"svelte": "^4.2.0"
}
}
2 changes: 1 addition & 1 deletion examples/framework-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/vue": "^3.0.4",
"astro": "^3.5.2",
"astro": "^3.5.3",
"vue": "^3.3.4"
}
}
2 changes: 1 addition & 1 deletion examples/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/node": "^6.0.3",
"astro": "^3.5.2"
"astro": "^3.5.3"
}
}
2 changes: 1 addition & 1 deletion examples/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^3.5.2"
"astro": "^3.5.3"
},
"peerDependencies": {
"astro": "^3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@astrojs/node": "^6.0.3",
"astro": "^3.5.2",
"astro": "^3.5.3",
"html-minifier": "^4.0.0"
}
}
2 changes: 1 addition & 1 deletion examples/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^3.5.2"
"astro": "^3.5.3"
}
}
2 changes: 1 addition & 1 deletion examples/non-html-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^3.5.2"
"astro": "^3.5.3"
}
}
2 changes: 1 addition & 1 deletion examples/portfolio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^3.5.2"
"astro": "^3.5.3"
}
}
2 changes: 1 addition & 1 deletion examples/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@astrojs/node": "^6.0.3",
"@astrojs/svelte": "^4.0.3",
"astro": "^3.5.2",
"astro": "^3.5.3",
"svelte": "^4.2.0"
}
}
2 changes: 1 addition & 1 deletion examples/view-transitions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"devDependencies": {
"@astrojs/tailwind": "^5.0.2",
"@astrojs/node": "^6.0.3",
"astro": "^3.5.2"
"astro": "^3.5.3"
}
}
2 changes: 1 addition & 1 deletion examples/with-markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/markdoc": "^0.7.1",
"astro": "^3.5.2"
"astro": "^3.5.3"
}
}
2 changes: 1 addition & 1 deletion examples/with-markdown-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/markdown-remark": "^3.4.0",
"astro": "^3.5.2",
"astro": "^3.5.3",
"hast-util-select": "^5.0.5",
"rehype-autolink-headings": "^6.1.1",
"rehype-slug": "^5.1.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/with-markdown-shiki/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^3.5.2"
"astro": "^3.5.3"
}
}
2 changes: 1 addition & 1 deletion examples/with-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/mdx": "^1.1.4",
"@astrojs/preact": "^3.0.1",
"astro": "^3.5.2",
"astro": "^3.5.3",
"preact": "^10.17.1"
}
}
2 changes: 1 addition & 1 deletion examples/with-nanostores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/preact": "^3.0.1",
"@nanostores/preact": "^0.5.0",
"astro": "^3.5.2",
"astro": "^3.5.3",
"nanostores": "^0.9.3",
"preact": "^10.17.1"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/with-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@astrojs/mdx": "^1.1.4",
"@astrojs/tailwind": "^5.0.2",
"@types/canvas-confetti": "^1.6.0",
"astro": "^3.5.2",
"astro": "^3.5.3",
"autoprefixer": "^10.4.15",
"canvas-confetti": "^1.6.0",
"postcss": "^8.4.28",
Expand Down
2 changes: 1 addition & 1 deletion examples/with-vite-plugin-pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^3.5.2",
"astro": "^3.5.3",
"vite-plugin-pwa": "0.16.4",
"workbox-window": "^7.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test": "vitest"
},
"dependencies": {
"astro": "^3.5.2",
"astro": "^3.5.3",
"vitest": "^0.34.2"
}
}
6 changes: 6 additions & 0 deletions packages/astro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# astro

## 3.5.3

### Patch Changes

- [#9069](https://github.com/withastro/astro/pull/9069) [`50164f5e3`](https://github.com/withastro/astro/commit/50164f5e37cdc6ad81216627d8edb2a98ed37491) Thanks [@natemoo-re](https://github.com/natemoo-re)! - Fix a regression introduced in 3.5.0 related to content collection styles

## 3.5.2

### Patch Changes
Expand Down
7 changes: 5 additions & 2 deletions packages/astro/components/ViewTransitions.astro
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,14 @@ const { fallback = 'animate', handleForms } = Astro.props;
}

const form = el as HTMLFormElement;
const submitter = ev.submitter;
const formData = new FormData(form);
// Use the form action, if defined, otherwise fallback to current path.
let action = form.action ?? location.pathname;
let action = submitter?.getAttribute('formaction') ?? form.action ?? location.pathname;
const method = submitter?.getAttribute('formmethod') ?? form.method;

const options: Options = {};
if (form.method === 'get') {
if (method === 'get') {
const params = new URLSearchParams(formData as any);
const url = new URL(action);
url.search = params.toString();
Expand Down
3 changes: 2 additions & 1 deletion packages/astro/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@ export function getViteConfig(config: ViteUserConfig): ViteUserConfigFn;

/**
* Return the configuration needed to use the Sharp-based image service
* See: https://docs.astro.build/en/guides/assets/#using-sharp
*/
export function sharpImageService(): ImageServiceConfig;

/**
* Return the configuration needed to use the Squoosh-based image service
* See: https://docs.astro.build/en/guides/images/#configure-squoosh
*/
export function squooshImageService(): ImageServiceConfig;

/**
* Return the configuration needed to use the passthrough image service. This image services does not perform
* any image transformations, and is mainly useful when your platform does not support other image services, or you are
* not using Astro's built-in image processing.
* See: https://docs.astro.build/en/guides/images/#configure-no-op-passthrough-service
*/
export function passthroughImageService(): ImageServiceConfig;
19 changes: 19 additions & 0 deletions packages/astro/e2e/dev-overlay.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,23 @@ test.describe('Dev Overlay', () => {
await expect(auditHighlight).not.toBeVisible();
await expect(auditHighlightTooltip).not.toBeVisible();
});

test('can open Settings plugin', async ({ page, astro }) => {
await page.goto(astro.resolveUrl('/'));

const overlay = page.locator('astro-dev-overlay');
const pluginButton = overlay.locator('button[data-plugin-id="astro:settings"]');
await pluginButton.click();

const settingsPluginCanvas = overlay.locator(
'astro-dev-overlay-plugin-canvas[data-plugin-id="astro:settings"]'
);
const settingsWindow = settingsPluginCanvas.locator('astro-dev-overlay-window');
await expect(settingsWindow).toHaveCount(1);
await expect(settingsWindow).toBeVisible();

// Toggle plugin off
await pluginButton.click();
await expect(settingsWindow).not.toBeVisible();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
import Layout from '../components/Layout.astro';
let formData: FormData | undefined;
if(Astro.request.method === 'POST') {
formData = await Astro.request.formData();
}
---
<Layout>
{
Astro.request.method === 'GET' ? (
<h2>Contact Form</h2>
<form action="/contact" method="get">
<input type="hidden" name="name" value="Testing">
<button id="submit" type="submit" formmethod="post" formaction="/form-three">Submit</button>
</form>
) : (
<div id="three-result">Got: {formData?.get('name')}</div>
)
}
</Layout>
12 changes: 12 additions & 0 deletions packages/astro/e2e/view-transitions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1004,4 +1004,16 @@ test.describe('View Transitions', () => {
'There should be only 1 page load. No additional loads for the form submission'
).toEqual(1);
});

test('forms are overridden by formmethod and formaction', async ({ page, astro }) => {
await page.goto(astro.resolveUrl('/form-three'));

let locator = page.locator('h2');
await expect(locator, 'should have content').toHaveText('Contact Form');

// Submit the form
await page.click('#submit');
const result = page.locator('#three-result');
await expect(result, 'should have content').toHaveText('Got: Testing');
});
});
4 changes: 2 additions & 2 deletions packages/astro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "astro",
"version": "3.5.2",
"version": "3.5.3",
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
"type": "module",
"author": "withastro",
Expand Down Expand Up @@ -186,7 +186,7 @@
},
"devDependencies": {
"@astrojs/check": "^0.1.0",
"@playwright/test": "^1.37.1",
"@playwright/test": "1.40.0-alpha-nov-13-2023",
"@types/babel__generator": "^7.6.4",
"@types/babel__traverse": "^7.20.1",
"@types/chai": "^4.3.5",
Expand Down
Loading

0 comments on commit e42dde6

Please sign in to comment.