Skip to content

Commit ce7aac4

Browse files
Merge branch 'main' into fix-spelling
2 parents 3e4c16b + 898654e commit ce7aac4

File tree

24 files changed

+432
-56
lines changed

24 files changed

+432
-56
lines changed

apps/svelte.dev/content/docs/cli/20-commands/20-sv-add.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ You can select multiple space-separated add-ons from [the list below](#Official-
3939
- [`sveltekit-adapter`](sveltekit-adapter)
4040
- [`tailwindcss`](tailwind)
4141
- [`vitest`](vitest)
42+
- [`devtools-json`](devtools-json)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
NOTE: do not edit this file, it is generated in apps/svelte.dev/scripts/sync-docs/index.ts
3+
title: devtools-json
4+
---
5+
6+
`devtools-json` is essentially a vite plugin [vite-plugin-devtools-json](https://github.com/ChromeDevTools/vite-plugin-devtools-json/) for generating the Chrome DevTools project settings file on-the-fly in the devserver.
7+
8+
It will prevent this server log:
9+
10+
```sh
11+
Not found: /.well-known/appspecific/com.chrome.devtools.json
12+
```
13+
14+
## Usage
15+
16+
```bash
17+
npx sv add devtools-json
18+
```
19+
20+
## What you get
21+
22+
- the `vite` plugin added to your vite plugin options.

apps/svelte.dev/content/docs/kit/20-core-concepts/30-form-actions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ Without an argument, `use:enhance` will emulate the browser-native behaviour, ju
369369
370370
### Customising use:enhance
371371
372-
To customise the behaviour, you can provide a `SubmitFunction` that runs immediately before the form is submitted, and (optionally) returns a callback that runs with the `ActionResult`. Note that if you return a callback, the default behavior mentioned above is not triggered. To get it back, call `update`.
372+
To customise the behaviour, you can provide a `SubmitFunction` that runs immediately before the form is submitted, and (optionally) returns a callback that runs with the `ActionResult`.
373373
374374
```svelte
375375
<form
@@ -391,7 +391,7 @@ To customise the behaviour, you can provide a `SubmitFunction` that runs immedia
391391
392392
You can use these functions to show and hide loading UI, and so on.
393393
394-
If you return a callback, you may need to reproduce part of the default `use:enhance` behaviour, but without invalidating all data on a successful response. You can do so with `applyAction`:
394+
If you return a callback, you override the default post-submission behavior. To get it back, call `update`, which accepts `invalidateAll` and `reset` parameters, or use `applyAction` on the result:
395395
396396
```svelte
397397
/// file: src/routes/login/+page.svelte

apps/svelte.dev/content/docs/kit/30-advanced/20-hooks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ export async function reroute({ url, fetch }) {
321321
322322
### transport
323323

324-
This is a collection of _transporters_, which allow you to pass custom types — returned from `load` and form actions — across the server/client boundary. Each transporter contains an `encode` function, which encodes values on the server (or returns `false` for anything that isn't an instance of the type) and a corresponding `decode` function:
324+
This is a collection of _transporters_, which allow you to pass custom types — returned from `load` and form actions — across the server/client boundary. Each transporter contains an `encode` function, which encodes values on the server (or returns a falsy value for anything that isn't an instance of the type) and a corresponding `decode` function:
325325

326326
```js
327327
/// file: src/hooks.js

apps/svelte.dev/content/docs/kit/40-best-practices/03-auth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ In contrast, JWT generally are not checked against a datastore, which means they
1515

1616
## Integration points
1717

18-
Auth [cookies](@sveltejs-kit#Cookies) can be checked inside [server hooks](hooks#Server-hooks). If a user is found matching the provided credentials, the user information can be stored in [`locals`](hooks#Server-hooks-handle).
18+
Auth [cookies](@sveltejs-kit#Cookies) can be checked inside [server hooks](hooks#Server-hooks). If a user is found matching the provided credentials, the user information can be stored in [`locals`](hooks#Server-hooks-locals).
1919

2020
## Guides
2121

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ the location of the template for fallback error responses
647647

648648
</div>
649649

650-
Inline CSS inside a `<style>` block at the head of the HTML. This option is a number that specifies the maximum length of a CSS file in UTF-16 code units, as specified by the [String.length](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length) property, to be inlined. All CSS files needed for the page and smaller than this value are merged and inlined in a `<style>` block.
650+
Inline CSS inside a `<style>` block at the head of the HTML. This option is a number that specifies the maximum length of a CSS file in UTF-16 code units, as specified by the [String.length](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length) property, to be inlined. All CSS files needed for the page that are smaller than this value are merged and inlined in a `<style>` block.
651651

652652
> [!NOTE] This results in fewer initial requests and can improve your [First Contentful Paint](https://web.dev/first-contentful-paint) score. However, it generates larger HTML output and reduces the effectiveness of browser caches. Use it advisedly.
653653

apps/svelte.dev/content/docs/svelte/02-runes/02-$state.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Unlike other frameworks you may have encountered, there is no API for interactin
2121

2222
If `$state` is used with an array or a simple object, the result is a deeply reactive _state proxy_. [Proxies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) allow Svelte to run code when you read or write properties, including via methods like `array.push(...)`, triggering granular updates.
2323

24-
State is proxified recursively until Svelte finds something other than an array or simple object (like a class). In a case like this...
24+
State is proxified recursively until Svelte finds something other than an array or simple object (like a class or an object created with `Object.create`). In a case like this...
2525

2626
```js
2727
let todos = $state([

apps/svelte.dev/content/docs/svelte/03-template-syntax/17-style.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ To mark a style as important, use the `|important` modifier:
3535
<div style:color|important="red">...</div>
3636
```
3737

38-
When `style:` directives are combined with `style` attributes, the directives will take precedence:
38+
When `style:` directives are combined with `style` attributes, the directives will take precedence,
39+
even over `!important` properties:
3940

4041
```svelte
41-
<div style="color: blue;" style:color="red">This will be red</div>
42+
<div style:color="red" style="color: blue">This will be red</div>
43+
<div style:color="red" style="color: blue !important">This will still be red</div>
4244
```

apps/svelte.dev/content/docs/svelte/07-misc/02-testing.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ test('Effect', () => {
130130
// effects normally run after a microtask,
131131
// use flushSync to execute all pending effects synchronously
132132
flushSync();
133-
expect(log.value).toEqual([0]);
133+
expect(log).toEqual([0]);
134134

135135
count = 1;
136136
flushSync();
137137

138-
expect(log.value).toEqual([0, 1]);
138+
expect(log).toEqual([0, 1]);
139139
});
140140

141141
cleanup();
@@ -149,17 +149,13 @@ test('Effect', () => {
149149
*/
150150
export function logger(getValue) {
151151
/** @type {any[]} */
152-
let log = $state([]);
152+
let log = [];
153153

154154
$effect(() => {
155155
log.push(getValue());
156156
});
157157

158-
return {
159-
get value() {
160-
return log;
161-
}
162-
};
158+
return log;
163159
}
164160
```
165161

packages/repl/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
"@replit/codemirror-vim": "^6.0.14",
9191
"@rich_harris/svelte-split-pane": "^2.0.0",
9292
"@rollup/browser": "^4.17.2",
93+
"@sveltejs/acorn-typescript": "^1.0.0",
9394
"@sveltejs/site-kit": "workspace:*",
9495
"@sveltejs/svelte-json-tree": "^2.2.1",
9596
"acorn": "^8.11.3",
@@ -98,12 +99,12 @@
9899
"esrap": "^1.2.2",
99100
"icons": "workspace:*",
100101
"locate-character": "^3.0.0",
102+
"magic-string": "^0.30.0",
101103
"marked": "^14.1.2",
102104
"resolve.exports": "^2.0.2",
103105
"svelte": "5.33.0",
104106
"tailwindcss": "^4.0.15",
105107
"tarparser": "^0.0.4",
106-
"ts-blank-space": "^0.6.1",
107108
"zimmerframe": "^1.1.2"
108109
}
109110
}

0 commit comments

Comments
 (0)