Skip to content

Commit

Permalink
Merge branch 'main' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp committed Aug 17, 2023
2 parents 2484dc4 + d6b4943 commit cbb77af
Show file tree
Hide file tree
Showing 136 changed files with 1,764 additions and 808 deletions.
5 changes: 5 additions & 0 deletions .changeset/big-elephants-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/svelte': patch
---

Filter unknown `class` prop warnings
5 changes: 5 additions & 0 deletions .changeset/brown-wolves-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-astro': patch
---

Update 'dev' command for Bun users
5 changes: 5 additions & 0 deletions .changeset/eleven-wasps-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Ensure dotfiles are cleaned during static builds
5 changes: 0 additions & 5 deletions .changeset/green-islands-repeat.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/itchy-pants-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/vercel': patch
---

Update image support to work with latest version of Astro
5 changes: 0 additions & 5 deletions .changeset/lazy-pillows-burn.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/many-actors-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"astro": patch
---

Fix a handful of edge cases with prerendered 404/500 pages
5 changes: 0 additions & 5 deletions .changeset/moody-houses-drum.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/odd-plants-tie.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/olive-queens-drum.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/orange-foxes-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/solid-js': patch
---

Update `babel-preset-solid` dependency to `^1.7.7`
5 changes: 5 additions & 0 deletions .changeset/popular-planes-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

ViewTransition: bug fix for lost scroll position in browser history
5 changes: 5 additions & 0 deletions .changeset/silent-baboons-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-astro': patch
---

Verify internet connection and that `--template` exists before continuing
5 changes: 0 additions & 5 deletions .changeset/soft-colts-heal.md

This file was deleted.

27 changes: 27 additions & 0 deletions .changeset/sour-frogs-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
'astro': patch
---

Added support for optimizing remote images from authorized sources when using `astro:assets`. This comes with two new parameters to specify which domains (`image.domains`) and host patterns (`image.remotePatterns`) are authorized for remote images.

For example, the following configuration will only allow remote images from `astro.build` to be optimized:

```ts
// astro.config.mjs
export default defineConfig({
image: {
domains: ["astro.build"],
}
});
```

The following configuration will only allow remote images from HTTPS hosts:

```ts
// astro.config.mjs
export default defineConfig({
image: {
remotePatterns: [{ protocol: "https" }],
}
});
```
5 changes: 0 additions & 5 deletions .changeset/thin-plums-drop.md

This file was deleted.

21 changes: 21 additions & 0 deletions .changeset/yellow-snakes-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
'@astrojs/react': minor
---

Optionally parse React slots as React children.

This adds a new configuration option for the React integration `experimentalReactChildren`:

```js
export default {
integrations: [
react({
experimentalReactChildren: true,
})
]
}
```

With this enabled, children passed to React from Astro components via the default slot are parsed as React components.

This enables better compatibility with certain React components which manipulate their children.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Astro is generously supported by Netlify, Storyblok, and several other amazing o

[![Astro's sponsors.](https://astro.build/sponsors.png "Astro's sponsors.
Platinum sponsors: Netlify, storyblok, Vercel, Ship Shape, Google Chrome
Gold sponsors: ‹div›RIOTS, DEEPGRAM, CloudCannon
Gold sponsors: ‹div›RIOTS, DEEPGRAM, Transloadit, CloudCannon
Sponsors: Monogram, Qoddi, Dimension")](https://github.com/sponsors/withastro)

</a>
Expand Down
46 changes: 43 additions & 3 deletions examples/portfolio/src/components/Nav.astro
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,45 @@ const iconLinks: { label: string; href: string; icon: keyof typeof iconPaths }[]
</template>
</menu-button>
</div>
<div id="menu-content">
<noscript class="menu-noscript">
<ul class="nav-items">
{
textLinks.map(({ label, href }) => (
<li>
<a
aria-current={Astro.url.pathname === href}
class:list={[
'link',
{
active:
Astro.url.pathname === href ||
(href !== '/' && Astro.url.pathname.startsWith(href)),
},
]}
href={href}
>
{label}
</a>
</li>
))
}
</ul>
</noscript>
<noscript style="display: contents;">
<div class="menu-footer">
<div class="socials">
{
iconLinks.map(({ href, icon, label }) => (
<a href={href} class="social">
<span class="sr-only">{label}</span>
<Icon icon={icon} />
</a>
))
}
</div>
</div>
</noscript>
<div id="menu-content" hidden>
<ul class="nav-items">
{
textLinks.map(({ label, href }) => (
Expand Down Expand Up @@ -90,6 +128,8 @@ const iconLinks: { label: string; href: string; icon: keyof typeof iconPaths }[]
// Hide menu (shown by default to support no-JS browsers).
const menu = document.getElementById('menu-content')!;
menu.hidden = true;
// Add "menu-content" class in JS to avoid covering content in non-JS browsers.
menu.classList.add('menu-content');

/** Set whether the menu is currently expanded or collapsed. */
const setExpanded = (expand: boolean) => {
Expand Down Expand Up @@ -169,7 +209,7 @@ const iconLinks: { label: string; href: string; icon: keyof typeof iconPaths }[]
z-index: -1;
}

#menu-content {
.menu-content {
position: absolute;
left: 0;
right: 0;
Expand Down Expand Up @@ -254,7 +294,7 @@ const iconLinks: { label: string; href: string; icon: keyof typeof iconPaths }[]
font-size: var(--text-lg);
}

#menu-content {
.menu-content {
display: contents;
}

Expand Down
4 changes: 2 additions & 2 deletions examples/with-markdoc/src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import { getEntryBySlug } from 'astro:content';
import { getEntry } from 'astro:content';
import Layout from '../layouts/Layout.astro';
const intro = await getEntryBySlug('docs', 'intro');
const intro = await getEntry('docs', 'intro');
const { Content } = await intro.render();
---

Expand Down
22 changes: 22 additions & 0 deletions packages/astro/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,28 @@
- @astrojs/internal-helpers@0.2.0-beta.0
- @astrojs/markdown-remark@3.0.0-beta.0

## 2.10.9

### Patch Changes

- [#8091](https://github.com/withastro/astro/pull/8091) [`56e7c5177`](https://github.com/withastro/astro/commit/56e7c5177bd61b404978dc9b82e2d34d76a4b2f9) Thanks [@martrapp](https://github.com/martrapp)! - Handle `<noscript>` tags in `<head>` during ViewTransitions

## 2.10.8

### Patch Changes

- [#7702](https://github.com/withastro/astro/pull/7702) [`c19987df0`](https://github.com/withastro/astro/commit/c19987df0be3520cf774476cea270c03edd08354) Thanks [@shishkin](https://github.com/shishkin)! - Fix AstroConfigSchema type export

- [#8084](https://github.com/withastro/astro/pull/8084) [`560e45924`](https://github.com/withastro/astro/commit/560e45924622141206ff5b47d134cb343d6d2a71) Thanks [@hbgl](https://github.com/hbgl)! - Stream request body instead of buffering it in memory.

- [#8066](https://github.com/withastro/astro/pull/8066) [`afc45af20`](https://github.com/withastro/astro/commit/afc45af2022f7c43fbb6c5c04983695f3819e47e) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Add support for non-awaited imports to the Image component and `getImage`

- [#7866](https://github.com/withastro/astro/pull/7866) [`d1f7143f9`](https://github.com/withastro/astro/commit/d1f7143f9caf2ffa0e87cc55c0e05339d3501db3) Thanks [@43081j](https://github.com/43081j)! - Add second type argument to the AstroGlobal type to type Astro.self. This change will ultimately allow our editor tooling to provide props completions and intellisense for `<Astro.self />`

- [#8032](https://github.com/withastro/astro/pull/8032) [`3e46634fd`](https://github.com/withastro/astro/commit/3e46634fd540e5b967d2e5c9abd6235452cee2f2) Thanks [@natemoo-re](https://github.com/natemoo-re)! - `astro add` now passes down `--save-prod`, `--save-dev`, `--save-exact`, and `--no-save` flags for installation

- [#8035](https://github.com/withastro/astro/pull/8035) [`a12027b6a`](https://github.com/withastro/astro/commit/a12027b6af411be39700919ca47e240a335e9887) Thanks [@fyndor](https://github.com/fyndor)! - Removed extra double quotes from computed style in shiki code component

## 2.10.7

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/components/Code.astro
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ const html = renderToHtml(tokens, {
// Handle code wrapping
// if wrap=null, do nothing.
if (wrap === false) {
style += '; overflow-x: auto;"';
style += '; overflow-x: auto;';
} else if (wrap === true) {
style += '; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;"';
style += '; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;';
}
return `<${tag} class="${className}" style="${style}" tabindex="0">${children}</${tag}>`;
},
Expand Down
19 changes: 17 additions & 2 deletions packages/astro/components/ViewTransitions.astro
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,21 @@ const { fallback = 'animate' } = Astro.props as Props;

const throttle = (cb: (...args: any[]) => any, delay: number) => {
let wait = false;
// During the waiting time additional events are lost.
// So repeat the callback at the end if we have swallowed events.
let onceMore = false;
return (...args: any[]) => {
if (wait) return;

if (wait) {
onceMore = true;
return;
}
cb(...args);
wait = true;
setTimeout(() => {
if (onceMore) {
onceMore = false;
cb(...args);
}
wait = false;
}, delay);
};
Expand Down Expand Up @@ -125,6 +134,10 @@ const { fallback = 'animate' } = Astro.props as Props;
};

const swap = () => {
// noscript tags inside head element are not honored on swap (#7969).
// Remove them before swapping.
doc.querySelectorAll('head noscript').forEach((el) => el.remove());

// Swap head
for (const el of Array.from(document.head.children)) {
const newEl = persistedHeadElement(el);
Expand Down Expand Up @@ -159,6 +172,8 @@ const { fallback = 'animate' } = Astro.props as Props;
}
if (state?.scrollY != null) {
scrollTo(0, state.scrollY);
// Overwrite erroneous updates by the scroll handler during transition
persistState(state);
}

triggerEvent('astro:beforeload');
Expand Down
Loading

0 comments on commit cbb77af

Please sign in to comment.