Skip to content

Commit bac3986

Browse files
authored
Merge branch 'main' into fix-console-scroll
2 parents 4852626 + a165ce7 commit bac3986

File tree

5 files changed

+112
-5
lines changed

5 files changed

+112
-5
lines changed

.github/workflows/docs-preview-create.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ on:
1919
description: 'Branch (eg. my-feature-branch)'
2020
required: true
2121
type: string
22-
check_id:
23-
description: 'The ID of the check that triggered this workflow'
22+
sha:
23+
description: 'The commit SHA responsible for triggering this workflow'
2424
required: false
2525
type: string
2626

@@ -66,9 +66,11 @@ jobs:
6666
6767
- name: Push
6868
id: push
69-
run: git add -A && git commit -m "sync docs for check run ${{ inputs.check_id }}" && git push -u origin ${{ env.BRANCH }} --force
69+
continue-on-error: true
70+
run: git add -A && git commit -m "sync docs for repo ${{ inputs.repo }}, pr ${{ inputs.pr }}, commit ${{ inputs.sha }}" && git push -u origin ${{ env.BRANCH }} --force
7071

7172
- name: Request preview comment
73+
if: ${{ steps.push.outcome == 'success' }}
7274
uses: peter-evans/repository-dispatch@v3
7375
with:
7476
event-type: 'request-preview-comment'
@@ -77,3 +79,15 @@ jobs:
7779
"repo": "${{ inputs.repo }}",
7880
"pr": "${{ inputs.pr }}"
7981
}
82+
83+
- name: Dispatch docs-unaffected
84+
if: ${{ steps.push.outcome != 'success' }}
85+
uses: peter-evans/repository-dispatch@v3
86+
with:
87+
event-type: 'docs-unaffected'
88+
client-payload: |-
89+
{
90+
"repo": "${{ inputs.repo }}",
91+
"pr": "${{ inputs.pr }}",
92+
"sha": "${{ inputs.sha }}"
93+
}

apps/svelte.dev/content/docs/kit/98-reference/[email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2211,7 +2211,7 @@ type RemoteQuery<T> = RemoteResource<T> & {
22112211
* await submit().updates(
22122212
* todos.withOverride((todos) => [...todos, { text: data.get('text') }])
22132213
* );
2214-
* }}>
2214+
* })}>
22152215
* <input type="text" name="text" />
22162216
* <button type="submit">Add Todo</button>
22172217
* </form>

apps/svelte.dev/content/docs/kit/98-reference/50-configuration.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ checkOrigin?: boolean;
257257
<div class="ts-block-property-bullets">
258258

259259
- <span class="tag">default</span> `true`
260+
- <span class="tag deprecated">deprecated</span> Use `trustedOrigins: ['*']` instead
260261

261262
</div>
262263

@@ -281,11 +282,13 @@ trustedOrigins?: string[];
281282

282283
</div>
283284

284-
An array of origins that are allowed to make cross-origin form submissions to your app, even when `checkOrigin` is `true`.
285+
An array of origins that are allowed to make cross-origin form submissions to your app.
285286

286287
Each origin should be a complete origin including protocol (e.g., `https://payment-gateway.com`).
287288
This is useful for allowing trusted third-party services like payment gateways or authentication providers to submit forms to your app.
288289

290+
If the array contains `'*'`, all origins will be trusted. This is generally not recommended!
291+
289292
**Warning**: Only add origins you completely trust, as this bypasses CSRF protection for those origins.
290293

291294
</div>

apps/svelte.dev/content/docs/svelte/98-reference/.generated/compile-errors.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,51 @@ Cyclical dependency detected: %cycle%
196196
`{@const}` must be the immediate child of `{#snippet}`, `{#if}`, `{:else if}`, `{:else}`, `{#each}`, `{:then}`, `{:catch}`, `<svelte:fragment>`, `<svelte:boundary` or `<Component>`
197197
```
198198

199+
### const_tag_invalid_reference
200+
201+
```
202+
The `{@const %name% = ...}` declaration is not available in this snippet
203+
```
204+
205+
The following is an error:
206+
207+
```svelte
208+
<svelte:boundary>
209+
{@const foo = 'bar'}
210+
211+
{#snippet failed()}
212+
{foo}
213+
{/snippet}
214+
</svelte:boundary>
215+
```
216+
217+
Here, `foo` is not available inside `failed`. The top level code inside `<svelte:boundary>` becomes part of the implicit `children` snippet, in other words the above code is equivalent to this:
218+
219+
```svelte
220+
<svelte:boundary>
221+
{#snippet children()}
222+
{@const foo = 'bar'}
223+
{/snippet}
224+
225+
{#snippet failed()}
226+
{foo}
227+
{/snippet}
228+
</svelte:boundary>
229+
```
230+
231+
The same applies to components:
232+
233+
```svelte
234+
<Component>
235+
{@const foo = 'bar'}
236+
237+
{#snippet someProp()}
238+
<!-- error -->
239+
{foo}
240+
{/snippet}
241+
</Component>
242+
```
243+
199244
### constant_assignment
200245

201246
```

apps/svelte.dev/content/docs/svelte/98-reference/30-compiler-errors.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,51 @@ Cyclical dependency detected: %cycle%
201201
`{@const}` must be the immediate child of `{#snippet}`, `{#if}`, `{:else if}`, `{:else}`, `{#each}`, `{:then}`, `{:catch}`, `<svelte:fragment>`, `<svelte:boundary` or `<Component>`
202202
```
203203

204+
### const_tag_invalid_reference
205+
206+
```
207+
The `{@const %name% = ...}` declaration is not available in this snippet
208+
```
209+
210+
The following is an error:
211+
212+
```svelte
213+
<svelte:boundary>
214+
{@const foo = 'bar'}
215+
216+
{#snippet failed()}
217+
{foo}
218+
{/snippet}
219+
</svelte:boundary>
220+
```
221+
222+
Here, `foo` is not available inside `failed`. The top level code inside `<svelte:boundary>` becomes part of the implicit `children` snippet, in other words the above code is equivalent to this:
223+
224+
```svelte
225+
<svelte:boundary>
226+
{#snippet children()}
227+
{@const foo = 'bar'}
228+
{/snippet}
229+
230+
{#snippet failed()}
231+
{foo}
232+
{/snippet}
233+
</svelte:boundary>
234+
```
235+
236+
The same applies to components:
237+
238+
```svelte
239+
<Component>
240+
{@const foo = 'bar'}
241+
242+
{#snippet someProp()}
243+
<!-- error -->
244+
{foo}
245+
{/snippet}
246+
</Component>
247+
```
248+
204249
### constant_assignment
205250

206251
```

0 commit comments

Comments
 (0)