Skip to content

Commit 9d0d588

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/db-libsql-remote
2 parents 9dec026 + 3c0ca8d commit 9d0d588

215 files changed

Lines changed: 1641 additions & 1035 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/clever-emus-roll.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'astro': minor
3+
---
4+
5+
Adds a new, optional property `timeout` for the `client:idle` directive.
6+
7+
This value allows you to specify a maximum time to wait, in milliseconds, before hydrating a UI framework component, even if the page is not yet done with its initial load. This means you can delay hydration for lower-priority UI elements with more control to ensure your element is interactive within a specified time frame.
8+
9+
```astro
10+
<ShowHideButton client:idle={{timeout: 500}} />
11+
```

.changeset/new-monkeys-sit.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
'astro': minor
3+
---
4+
5+
Adds a new object `swapFunctions` to expose the necessary utility functions on `astro:transitions/client` that allow you to build custom swap functions to be used with view transitions.
6+
7+
The example below uses these functions to replace Astro's built-in default `swap` function with one that only swaps the `<main>` part of the page:
8+
9+
```astro
10+
<script>
11+
import { swapFunctions } from 'astro:transitions/client';
12+
13+
document.addEventListener('astro:before-swap', (e) => { e.swap = () => swapMainOnly(e.newDocument) });
14+
15+
function swapMainOnly(doc: Document) {
16+
swapFunctions.deselectScripts(doc);
17+
swapFunctions.swapRootAttributes(doc);
18+
swapFunctions.swapHeadElements(doc);
19+
const restoreFocusFunction = swapFunctions.saveFocus();
20+
const newMain = doc.querySelector('main');
21+
const oldMain = document.querySelector('main');
22+
if (newMain && oldMain) {
23+
swapFunctions.swapBodyElement(newMain, oldMain);
24+
} else {
25+
swapFunctions.swapBodyElement(doc.body, document.body);
26+
}
27+
restoreFocusFunction();
28+
};
29+
<script>
30+
```
31+
32+
See the [view transitions guide](https://docs.astro.build/en/guides/view-transitions/#astrobefore-swap) for more information about hooking into the `astro:before-swap` lifecycle event and adding a custom swap implementation.

.changeset/pink-kids-taste.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/poor-olives-battle.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/selfish-pianos-notice.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Add continuous release label
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
label:
12+
if: ${{ github.repository_owner == 'withastro' && startsWith(github.event.comment.body, '!preview') }}
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- run: |
17+
gh issue edit ${{ github.event.issue.number }} --add-label "pr: preview" --repo ${{ github.repository }}
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/preview-release.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
name: Preview release
22

33
on:
4-
workflow_dispatch:
5-
issue_comment:
6-
types: [created]
4+
pull_request:
5+
branches: [main]
6+
types: [opened, synchronize, labeled, ready_for_review]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.number }}
10+
cancel-in-progress: true
711

812
permissions:
913
contents: read
1014
actions: write
1115

12-
concurrency:
13-
group: ${{ github.workflow }}-${{ github.ref }}
14-
cancel-in-progress: true
15-
1616
env:
1717
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
1818
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
@@ -24,7 +24,8 @@ env:
2424

2525
jobs:
2626
preview:
27-
if: ${{ github.repository_owner == 'withastro' && github.event.issue.pull_request && (startsWith(github.event.comment.body, '!preview')) }}
27+
if: |
28+
${{ github.repository_owner == 'withastro' && github.event.issue.pull_request && contains(github.event.pull_request.labels.*.name, 'pr: preview') }}
2829
runs-on: ubuntu-latest
2930
permissions:
3031
contents: read

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ package-lock.json
1616
.eslintcache
1717
.pnpm-store
1818

19-
# ignore top-level vscode settings
20-
/.vscode/settings.json
21-
2219
# do not commit .env files or any files that end with `.env`
2320
*.env
2421

@@ -37,3 +34,8 @@ packages/**/e2e/**/fixtures/**/.astro/
3734
packages/**/e2e/**/fixtures/**/env.d.ts
3835
examples/**/.astro/
3936
examples/**/env.d.ts
37+
38+
# make it easy for people to add project-specific Astro settings that they don't
39+
# want to share with others (see
40+
# https://github.com/withastro/astro/pull/11759#discussion_r1721444711)
41+
*.code-workspace

.vscode/extensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"astro-build.astro-vscode",
44
"esbenp.prettier-vscode",
55
"editorconfig.editorconfig",
6-
"dbaeumer.vscode-eslint"
6+
"dbaeumer.vscode-eslint",
7+
"biomejs.biome"
78
],
89
"unwantedRecommendations": []
910
}

.vscode/settings.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"[json]": {
3+
"editor.defaultFormatter": "biomejs.biome"
4+
},
5+
"[javascript]": {
6+
"editor.defaultFormatter": "biomejs.biome"
7+
},
8+
"[typescript]": {
9+
"editor.defaultFormatter": "biomejs.biome"
10+
},
11+
"[javascriptreact]": {
12+
"editor.defaultFormatter": "biomejs.biome"
13+
},
14+
"[typescriptreact]": {
15+
"editor.defaultFormatter": "biomejs.biome"
16+
},
17+
"editor.codeActionsOnSave": {
18+
"quickFix.biome": true,
19+
"source.fixAll.biome": true
20+
}
21+
}

0 commit comments

Comments
 (0)