Skip to content

Commit 0377e9a

Browse files
committed
Merge branch 'main' into order-contributors
2 parents 75f04b4 + 8a2f348 commit 0377e9a

File tree

14 files changed

+93
-47
lines changed

14 files changed

+93
-47
lines changed

apps/svelte.dev/content/blog/2024-04-01-whats-new-in-svelte-april-2024.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Also, this month, a ton of new features have been merged into Svelte 5 to make i
2828
- `adapter-vercel` now has Skew Protection which ensures that the client and server stay in sync for any particular deployment (**@sveltejs/adapter-vercel@5.2.0**, [Docs](https://vercel.com/docs/deployments/skew-protection), [#11987](https://github.com/sveltejs/kit/pull/11987))
2929
- `adapter-vercel`'s build output files now include framework metadata - improving observability on the platform (**@sveltejs/adapter-vercel@5.2.0**, [#11800](https://github.com/sveltejs/kit/pull/11800))
3030
- `adapter-cloudflare` and `adapter-cloudflare-workers` now implement `adapter.emulate` which allows the adapter to emulate the Cloudflare platform during dev and preview ([#11732](https://github.com/sveltejs/kit/pull/11732))
31-
- **Breaking:** `adapter-node` now shuts down gracefully and supports the new `IDLE_TIMEOUT` and `SHUTDOWN_TIMEOUT` environment variables (**@sveltejs/adapter-node@5.0.1**, [Docs](/docs/kit/adapter-node#Environment-variables-SHUTDOWN-TIMEOUT), [#11653](https://github.com/sveltejs/kit/pull/11653))
31+
- **Breaking:** `adapter-node` now shuts down gracefully and supports the new `IDLE_TIMEOUT` and `SHUTDOWN_TIMEOUT` environment variables (**@sveltejs/adapter-node@5.0.1**, [Docs](/docs/kit/adapter-node#Environment-variables-SHUTDOWN_TIMEOUT), [#11653](https://github.com/sveltejs/kit/pull/11653))
3232
- **Breaking:** The default value of `precompress` in `adapter-node` is now `true` - making sites faster by default (**@sveltejs/adapter-node@5.0.0**, [Docs](/docs/kit/adapter-node#Options-precompress), [#11945](https://github.com/sveltejs/kit/pull/11945))
3333
- Google Cloud is now supported in `adapter-auto` without any additional configuration (**@sveltejs/adapter-auto@3.2.0**, [Docs](/docs/kit/adapter-auto), [#12015](https://github.com/sveltejs/kit/pull/12015))
3434

apps/svelte.dev/content/blog/2024-07-01-whats-new-in-svelte-july-2024.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Below, you'll find the highlights from the Svelte 5 release notes (now in [Relea
2424

2525
The node and Cloudflare adapters got a few upgrades this month:
2626

27-
- The `BODY_SIZE_LIMIT` environment variable adds unit suffixes support to the adapter-node - making it easier to write and comprehend large byte values (**[email protected]**, [Docs](/docs/kit/adapter-node#Environment-variables-BODYSIZELIMIT), [#11680](https://github.com/sveltejs/kit/pull/11680))
27+
- The `BODY_SIZE_LIMIT` environment variable adds unit suffixes support to the adapter-node - making it easier to write and comprehend large byte values (**[email protected]**, [Docs](/docs/kit/adapter-node#Environment-variables-BODY_SIZE_LIMIT), [#11680](https://github.com/sveltejs/kit/pull/11680))
2828
- Node servers can now listen to the `sveltekit:shutdown` event (replacing the more abrupt `exit`) that is emitted after the HTTP server has closed all connections (**[email protected]**, [Docs](/docs/kit/adapter-node#Graceful-shutdown), [#12153](https://github.com/sveltejs/kit/pull/12153))
2929
- The Cloudflare adapter will now only throw a `_routes.json` error when the file exists but there are no configured routes in svelte.config (**[email protected]**, [#12360](https://github.com/sveltejs/kit/pull/12360))
3030

apps/svelte.dev/content/docs/kit/25-build-and-deploy/40-adapter-node.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ By default `adapter-node` gracefully shuts down the HTTP server when a `SIGTERM`
187187

188188
1. reject new requests ([`server.close`](https://nodejs.org/api/http.html#serverclosecallback))
189189
2. wait for requests that have already been made but not received a response yet to finish and close connections once they become idle ([`server.closeIdleConnections`](https://nodejs.org/api/http.html#servercloseidleconnections))
190-
3. and finally, close any remaining connections that are still active after [`SHUTDOWN_TIMEOUT`](#Environment-variables-SHUTDOWN-TIMEOUT) seconds. ([`server.closeAllConnections`](https://nodejs.org/api/http.html#servercloseallconnections))
190+
3. and finally, close any remaining connections that are still active after [`SHUTDOWN_TIMEOUT`](#Environment-variables-SHUTDOWN_TIMEOUT) seconds. ([`server.closeAllConnections`](https://nodejs.org/api/http.html#servercloseallconnections))
191191

192192
> [!NOTE] If you want to customize this behaviour you can use a [custom server](#Custom-server).
193193
@@ -205,7 +205,7 @@ The parameter `reason` has one of the following values:
205205

206206
- `SIGINT` - shutdown was triggered by a `SIGINT` signal
207207
- `SIGTERM` - shutdown was triggered by a `SIGTERM` signal
208-
- `IDLE` - shutdown was triggered by [`IDLE_TIMEOUT`](#Environment-variables-IDLE-TIMEOUT)
208+
- `IDLE` - shutdown was triggered by [`IDLE_TIMEOUT`](#Environment-variables-IDLE_TIMEOUT)
209209

210210
## Socket activation
211211

@@ -215,7 +215,7 @@ Most Linux operating systems today use a modern process manager called systemd t
215215
216216
To take advantage of socket activation follow these steps.
217217

218-
1. Run your app as a [systemd service](https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html). It can either run directly on the host system or inside a container (using Docker or a systemd portable service for example). If you additionally pass an [`IDLE_TIMEOUT`](#Environment-variables-IDLE-TIMEOUT) environment variable to your app it will gracefully shutdown if there are no requests for `IDLE_TIMEOUT` seconds. systemd will automatically start your app again when new requests are coming in.
218+
1. Run your app as a [systemd service](https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html). It can either run directly on the host system or inside a container (using Docker or a systemd portable service for example). If you additionally pass an [`IDLE_TIMEOUT`](#Environment-variables-IDLE_TIMEOUT) environment variable to your app it will gracefully shutdown if there are no requests for `IDLE_TIMEOUT` seconds. systemd will automatically start your app again when new requests are coming in.
219219

220220
```ini
221221
/// file: /etc/systemd/system/myapp.service
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading

apps/svelte.dev/src/routes/(authed)/playground/[id]/AppControls.svelte

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206

207207
<div class="buttons">
208208
<button
209-
class="raised icon"
209+
class="raised icon tooltip"
210210
disabled={saving || !user}
211211
onclick={() => fork(false)}
212212
aria-label={user ? 'fork' : 'log in to fork'}
@@ -219,7 +219,7 @@
219219
</button>
220220

221221
<button
222-
class="raised icon"
222+
class="raised icon tooltip"
223223
disabled={saving || !user}
224224
onclick={save}
225225
aria-label={user
@@ -267,26 +267,6 @@
267267
background-size: 1.8rem;
268268
z-index: 999;
269269
270-
&[aria-label]:hover::before {
271-
content: '';
272-
width: 1rem;
273-
height: 1rem;
274-
position: absolute;
275-
background: var(--sk-text-3);
276-
top: calc(100% + 0.5rem);
277-
rotate: 45deg;
278-
}
279-
280-
&[aria-label]:hover::after {
281-
content: attr(aria-label);
282-
position: absolute;
283-
top: calc(100% + 1rem);
284-
background: var(--sk-text-3);
285-
color: var(--sk-back-4);
286-
padding: 0.5em 0.5em;
287-
border-radius: var(--sk-border-radius);
288-
}
289-
290270
&.login {
291271
width: auto;
292272
background-image: url($lib/icons/user-light.svg);

apps/svelte.dev/src/routes/_home/Hero.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@
3737
<source srcset={MachineMobile.sources.avif} width="2208" height="936" type="image/avif" />
3838
<source srcset={MachineMobile.sources.webp} width="2208" height="936" type="image/webp" />
3939
<source srcset={MachineMobile.sources.png} width="2208" height="936" type="image/png" />
40-
<img alt="The Svelte compiler packaging up your component code" src={MachineMobile.img.src} />
40+
<img
41+
alt="The Svelte compiler packaging up your component code"
42+
src={MachineMobile.img.src}
43+
fetchpriority="high"
44+
/>
4145
</picture>
4246
</div>
4347

packages/editor/src/lib/Editor.svelte

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,25 @@
5252
}}
5353
/>
5454

55+
<!-- svelte-ignore a11y_no_static_element_interactions -->
5556
<div
5657
class="container"
5758
bind:this={container}
58-
onfocusin={() => {
59+
onpointerdown={() => {
60+
workspace.enable_tab_indent();
61+
}}
62+
onkeydown={(e) => {
63+
if (e.key !== 'Tab') {
64+
workspace.enable_tab_indent();
65+
}
66+
}}
67+
onfocusin={(e) => {
5968
clearTimeout(remove_focus_timeout);
6069
preserve_editor_focus = true;
6170
}}
6271
onfocusout={() => {
72+
workspace.disable_tab_indent();
73+
6374
// Heuristic: user did refocus themmselves if iframe_took_focus
6475
// doesn't happen in the next few miliseconds. Needed
6576
// because else navigations inside the iframe refocus the editor.

packages/editor/src/lib/Workspace.svelte.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { CompileError, CompileOptions, CompileResult } from 'svelte/compiler';
2-
import { EditorState } from '@codemirror/state';
2+
import { Compartment, EditorState } from '@codemirror/state';
33
import { compile_file } from './compile-worker';
44
import { BROWSER } from 'esm-env';
55
import { basicSetup, EditorView } from 'codemirror';
@@ -51,10 +51,12 @@ function file_type(file: Item) {
5151
return file.name.split('.').pop();
5252
}
5353

54+
const tab_behaviour = new Compartment();
55+
5456
const default_extensions = [
5557
basicSetup,
5658
EditorState.tabSize.of(2),
57-
keymap.of([{ key: 'Tab', run: acceptCompletion }, indentWithTab]),
59+
tab_behaviour.of(keymap.of([{ key: 'Tab', run: acceptCompletion }])),
5860
indentUnit.of('\t'),
5961
theme
6062
];
@@ -209,6 +211,20 @@ export class Workspace {
209211
return item;
210212
}
211213

214+
disable_tab_indent() {
215+
this.#view?.dispatch({
216+
effects: tab_behaviour.reconfigure(keymap.of([{ key: 'Tab', run: acceptCompletion }]))
217+
});
218+
}
219+
220+
enable_tab_indent() {
221+
this.#view?.dispatch({
222+
effects: tab_behaviour.reconfigure(
223+
keymap.of([{ key: 'Tab', run: acceptCompletion }, indentWithTab])
224+
)
225+
});
226+
}
227+
212228
focus() {
213229
setTimeout(() => {
214230
this.#view?.focus();

packages/repl/src/lib/Input/Migrate.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
</script>
88

99
<button
10-
class="raised"
10+
class="raised tooltip-left"
1111
disabled={!can_migrate}
1212
onclick={migrate}
13-
title="Migrate this component towards the new syntax"
13+
aria-label="Convert syntax from Svelte 4 to 5 if possible"
1414
>
1515
migrate
1616
</button>

0 commit comments

Comments
 (0)