Skip to content

Commit 95ff9ed

Browse files
committed
Merge branch 'svelte-4' of https://github.com/sveltejs/svelte into fix_login
2 parents 0d66194 + d5e4607 commit 95ff9ed

File tree

9 files changed

+124
-9
lines changed

9 files changed

+124
-9
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: "What's new in Svelte: February 2024"
3+
description: 'New in Kit: `reroute`, `emulate` and more!'
4+
author: Dani Sandoval
5+
authorURL: https://dreamindani.com
6+
---
7+
8+
Since SvelteKit 2.0 released late last year, there's been a bunch of new features to make the Kit dev experience even better! Meanwhile the Svelte team has been hard at work making Svelte 5 a reality.
9+
10+
In case you missed it, Rich also posted [Tenets](https://github.com/sveltejs/svelte/discussions/10085#discussion-6029409), "an attempt to articulate the Svelte philosophy — our bedrock principles, that guide our design decisions."
11+
12+
So let's dive in to check out what's new and see what the rest of the community has been up to...
13+
14+
## What's new in SvelteKit
15+
16+
- The client router is now tree shakeable (**2.1.0**, [#11340](https://github.com/sveltejs/kit/pull/11340))
17+
- `$env/static/public` is now exposed in service workers (**2.2.0**, [Docs](https://kit.svelte.dev/docs/modules#env-static-public), [#10994](https://github.com/sveltejs/kit/pull/10994))
18+
- `style-src-elem` is now supported in environments with a Content Security Policy (**2.2.1**, [Docs](https://kit.svelte.dev/docs/types#private-types-cspdirectives), [#11562](https://github.com/sveltejs/kit/pull/11562))
19+
- The new `reroute` hook allows you to change how URLs are translated into routes (**2.3.0**, [Docs](https://kit.svelte.dev/docs/hooks#universal-hooks-reroute), [#11537](https://github.com/sveltejs/kit/pull/11537))
20+
- The `read` function is now available in the `$app/server` module - allowing you to read assets from the filesystem (**2.4.0**, [Docs](https://kit.svelte.dev/docs/modules#app-server-read), [#11649](https://github.com/sveltejs/kit/pull/11649))
21+
- Adapters can now `emulate` the prod environment for dev and preview servers by implementing the corresponding functions. This is useful for providing access to e.g. KV namespaces in development (**2.5.0**, [Docs](https://kit.svelte.dev/docs/writing-adapters), [#11730](https://github.com/sveltejs/kit/pull/11730))
22+
23+
24+
## What's new in Svelte
25+
26+
In case you missed it, [Svelte 5 is in preview](https://svelte-5-preview.vercel.app/docs/introduction). In the meantime, Svelte 4 (`@latest`) has had one bugfix release. There's just one new feature to highlight from the Svelte 5 changelog:
27+
28+
- Snippets can now take multiple arguments (**5.0.0-next.42**, [Docs](https://svelte-5-preview.vercel.app/docs/snippets), [#9988](https://github.com/sveltejs/svelte/pull/9988))
29+
30+
For all the bug fixes, chores and underlying work required to get Svelte 5 to release-ready, check out [the CHANGELOG on main](https://github.com/sveltejs/svelte/blob/main/packages/svelte/CHANGELOG.md).
31+
32+
33+
---
34+
35+
## Community Showcase
36+
37+
**Apps & Sites built with Svelte**
38+
39+
- [Sprite Fusion](https://www.spritefusion.com/) is a free level design tool to craft beautiful 2D tilemaps right in your browser using any tileset
40+
- [TypeMeUp](https://github.com/bskdany/typemeup) a typing website that teaches you how to type faster
41+
- [Pathfinding Algorithm Visualizer](https://github.com/baterson/pathfinding-visualizer) is an interactive pathfinding algorithm visualizer with player functionality
42+
- [Roch Dog](https://rochdog.com/en) ranks businesses and hotels based on how dog-friendly they are
43+
- [highlight.cool](https://highlight.cool/) is a free, customizable, and real-time highlighting tool for your blog
44+
- [Nola Devs](https://www.noladevs.org/) is a vibrant and inclusive software developers group nestled in the heart of New Orleans. This site aggregates all their events across groups
45+
- [Startup Funding Simulator](https://www.fundingsimulator.com/) is a tool to help founders understand how modern fundraising (with safes) works, and how much dilution you can expect when raising money.
46+
47+
**Learning Resources**
48+
49+
_Featuring Svelte Contributors and Ambassadors_
50+
- [New SvelteKit feature: `import { read } from '$app/server'`](https://www.youtube.com/watch?v=m4G-6dyF1MU) by Rich Harris
51+
- [Reading assets on the server in SvelteKit](https://geoffrich.net/posts/sveltekit-read/) by Geoff Rich
52+
- [Tan Li Hau's new book](https://packt.link/Z4hXD), _Real-World Svelte_ is out now
53+
- [Svelte Society San Diego - January 2024](https://www.youtube.com/watch?v=oH7XFAKh6W8): Attila covers the latest updates on Svelte 5 and also SvelteKit.
54+
- [Svelte London - January 2024](https://www.youtube.com/watch?v=eswNQiq4T2w): featuring talks from both Rich Harris and pngwn
55+
- [Svelte 5: Speed, Simplicity & Size](https://syntax.fm/show/723/svelte-5-speed-simplicity-and-size) by Syntax.FM
56+
- This Week in Svelte:
57+
- [12 Jan 2024](https://www.youtube.com/watch?v=86NNiIG_ncU): A deep dive into the SvelteKit Changelog
58+
- [19 Jan 2024](https://www.youtube.com/watch?v=AWL_xCPT-5Q): Showcasing a new library from Paolo Ricciuti
59+
- [26 Jan 2024](https://www.youtube.com/watch?v=_SraKYKkQAc): Featuring "Cells" - a functional and reactive programming library
60+
61+
_To Read_
62+
63+
- [Customise font in TailwindCSS with SvelteKit](https://www.launchnow.pro/blog/customise-font-tailwindcss-sveltekit) by Launchnow
64+
- [Svelte from the perspective of an Angular developer (for Svelte devs)](https://kylenazario.com/blog/svelte-from-angular-perspective-for-svelte) and [How to create a sitemap for your SvelteKit blog](https://kylenazario.com/blog/sveltekit-blog-sitemap) by Kyle Nazario
65+
- [Get Up and Running with Svelte on the Internet Computer](https://blog.icacademy.at/blog/svelte-ic-starter) by Roland BOLE
66+
- [SvelteKit + Socket.io server deployed on deno](https://devr.me/socket-io-deno) by Devr
67+
68+
69+
**Libraries, Tools & Components**
70+
71+
- [Lucia](https://github.com/lucia-auth/lucia/discussions/1361) - an auth library written in TypeScript that abstracts away the complexity of handling sessions - has just released its 3.0 version
72+
- [Paraglide JS Adapter SvelteKit](https://inlang.com/m/dxnzrydw/library-inlang-paraglideJsAdapterSvelteKit) is a SvelteKit integration for ParaglideJS - a tool for i18n routing
73+
74+
75+
That's it for this month! Feel free to let us know if we missed anything on [Reddit](https://www.reddit.com/r/sveltejs/) or [Discord](https://discord.gg/svelte).
76+
77+
See ya next month!

packages/svelte/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# svelte
22

3+
## 4.2.10
4+
5+
### Patch Changes
6+
7+
- fix: add `scrollend` event type ([#10336](https://github.com/sveltejs/svelte/pull/10336))
8+
9+
- fix: add `fetchpriority` attribute type ([#10390](https://github.com/sveltejs/svelte/pull/10390))
10+
11+
- fix: Add `miter-clip` and `arcs` to `stroke-linejoin` attribute ([#10377](https://github.com/sveltejs/svelte/pull/10377))
12+
13+
- fix: make inline doc links valid ([#10366](https://github.com/sveltejs/svelte/pull/10366))
14+
315
## 4.2.9
416

517
### Patch Changes

packages/svelte/elements.d.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ export interface DOMAttributes<T extends EventTarget> {
179179

180180
// UI Events
181181
'on:scroll'?: UIEventHandler<T> | undefined | null;
182+
'on:scrollend'?: UIEventHandler<T> | undefined | null;
182183
'on:resize'?: UIEventHandler<T> | undefined | null;
183184

184185
// Wheel Events
@@ -761,6 +762,7 @@ export interface HTMLImgAttributes extends HTMLAttributes<HTMLImageElement> {
761762
alt?: string | undefined | null;
762763
crossorigin?: 'anonymous' | 'use-credentials' | '' | undefined | null;
763764
decoding?: 'async' | 'auto' | 'sync' | undefined | null;
765+
fetchpriority?: 'auto' | 'high' | 'low' | undefined | null;
764766
height?: number | string | undefined | null;
765767
ismap?: boolean | undefined | null;
766768
loading?: 'eager' | 'lazy' | undefined | null;
@@ -880,6 +882,7 @@ export interface HTMLLinkAttributes extends HTMLAttributes<HTMLLinkElement> {
880882
sizes?: string | undefined | null;
881883
type?: string | undefined | null;
882884
charset?: string | undefined | null;
885+
fetchpriority?: 'auto' | 'high' | 'low' | undefined | null;
883886
}
884887

885888
export interface HTMLMapAttributes extends HTMLAttributes<HTMLMapElement> {
@@ -1014,6 +1017,7 @@ export interface HTMLScriptAttributes extends HTMLAttributes<HTMLScriptElement>
10141017
charset?: string | undefined | null;
10151018
crossorigin?: string | undefined | null;
10161019
defer?: boolean | undefined | null;
1020+
fetchpriority?: 'auto' | 'high' | 'low' | undefined | null;
10171021
integrity?: string | undefined | null;
10181022
nomodule?: boolean | undefined | null;
10191023
nonce?: string | undefined | null;
@@ -1402,7 +1406,15 @@ export interface SVGAttributes<T extends EventTarget> extends AriaAttributes, DO
14021406
'stroke-dasharray'?: string | number | undefined | null;
14031407
'stroke-dashoffset'?: string | number | undefined | null;
14041408
'stroke-linecap'?: 'butt' | 'round' | 'square' | 'inherit' | undefined | null;
1405-
'stroke-linejoin'?: 'miter' | 'round' | 'bevel' | 'inherit' | undefined | null;
1409+
'stroke-linejoin'?:
1410+
| 'arcs'
1411+
| 'miter-clip'
1412+
| 'miter'
1413+
| 'round'
1414+
| 'bevel'
1415+
| 'inherit'
1416+
| undefined
1417+
| null;
14061418
'stroke-miterlimit'?: string | undefined | null;
14071419
'stroke-opacity'?: number | string | undefined | null;
14081420
'stroke-width'?: number | string | undefined | null;

packages/svelte/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svelte",
3-
"version": "4.2.9",
3+
"version": "4.2.10",
44
"description": "Cybernetically enhanced web apps",
55
"type": "module",
66
"module": "src/runtime/index.js",

packages/svelte/scripts/generate-dts.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,20 @@ await createBundle({
3535

3636
// There's no way to tell in JS that a class can have arbitrary properties, so we need to add that manually
3737
const types = fs.readFileSync('types/index.d.ts', 'utf-8');
38+
39+
const bad_links = [...types.matchAll(/\]\((\/[^)]+)\)/g)];
40+
if (bad_links.length > 0) {
41+
console.error(
42+
'The following links in JSDoc annotations should be prefixed with https://svelte.dev:'
43+
);
44+
45+
for (const [, link] of bad_links) {
46+
console.error(`- ${link}`);
47+
}
48+
49+
process.exit(1);
50+
}
51+
3852
fs.writeFileSync(
3953
'types/index.d.ts',
4054
// same line to not affect source map

packages/svelte/src/runtime/internal/lifecycle.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function beforeUpdate(fn) {
3232
*
3333
* If a function is returned _synchronously_ from `onMount`, it will be called when the component is unmounted.
3434
*
35-
* `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api).
35+
* `onMount` does not run inside a [server-side component](https://svelte.dev/docs#run-time-server-side-component-api).
3636
*
3737
* https://svelte.dev/docs/svelte#onmount
3838
* @template T
@@ -71,7 +71,7 @@ export function onDestroy(fn) {
7171
}
7272

7373
/**
74-
* Creates an event dispatcher that can be used to dispatch [component events](/docs#template-syntax-component-directives-on-eventname).
74+
* Creates an event dispatcher that can be used to dispatch [component events](https://svelte.dev/docs#template-syntax-component-directives-on-eventname).
7575
* Event dispatchers are functions that can take two arguments: `name` and `detail`.
7676
*
7777
* Component events created with `createEventDispatcher` create a

packages/svelte/src/runtime/transition/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export function draw(node, { delay = 0, speed, duration, easing = cubicInOut } =
179179
}
180180

181181
/**
182-
* The `crossfade` function creates a pair of [transitions](/docs#template-syntax-element-directives-transition-fn) called `send` and `receive`. When an element is 'sent', it looks for a corresponding element being 'received', and generates a transition that transforms the element to its counterpart's position and fades it out. When an element is 'received', the reverse happens. If there is no counterpart, the `fallback` transition is used.
182+
* The `crossfade` function creates a pair of [transitions](https://svelte.dev/docs#template-syntax-element-directives-transition-fn) called `send` and `receive`. When an element is 'sent', it looks for a corresponding element being 'received', and generates a transition that transforms the element to its counterpart's position and fades it out. When an element is 'received', the reverse happens. If there is no counterpart, the `fallback` transition is used.
183183
*
184184
* https://svelte.dev/docs/svelte-transition#crossfade
185185
* @param {import('./public').CrossfadeParams & {

packages/svelte/src/shared/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
* https://svelte.dev/docs/svelte-compiler#svelte-version
77
* @type {string}
88
*/
9-
export const VERSION = '4.2.9';
9+
export const VERSION = '4.2.10';
1010
export const PUBLIC_VERSION = '4';

packages/svelte/types/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ declare module 'svelte' {
189189
*
190190
* If a function is returned _synchronously_ from `onMount`, it will be called when the component is unmounted.
191191
*
192-
* `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api).
192+
* `onMount` does not run inside a [server-side component](https://svelte.dev/docs#run-time-server-side-component-api).
193193
*
194194
* https://svelte.dev/docs/svelte#onmount
195195
* */
@@ -212,7 +212,7 @@ declare module 'svelte' {
212212
* */
213213
export function onDestroy(fn: () => any): void;
214214
/**
215-
* Creates an event dispatcher that can be used to dispatch [component events](/docs#template-syntax-component-directives-on-eventname).
215+
* Creates an event dispatcher that can be used to dispatch [component events](https://svelte.dev/docs#template-syntax-component-directives-on-eventname).
216216
* Event dispatchers are functions that can take two arguments: `name` and `detail`.
217217
*
218218
* Component events created with `createEventDispatcher` create a
@@ -1789,7 +1789,7 @@ declare module 'svelte/transition' {
17891789
getTotalLength(): number;
17901790
}, { delay, speed, duration, easing }?: DrawParams | undefined): TransitionConfig;
17911791
/**
1792-
* The `crossfade` function creates a pair of [transitions](/docs#template-syntax-element-directives-transition-fn) called `send` and `receive`. When an element is 'sent', it looks for a corresponding element being 'received', and generates a transition that transforms the element to its counterpart's position and fades it out. When an element is 'received', the reverse happens. If there is no counterpart, the `fallback` transition is used.
1792+
* The `crossfade` function creates a pair of [transitions](https://svelte.dev/docs#template-syntax-element-directives-transition-fn) called `send` and `receive`. When an element is 'sent', it looks for a corresponding element being 'received', and generates a transition that transforms the element to its counterpart's position and fades it out. When an element is 'received', the reverse happens. If there is no counterpart, the `fallback` transition is used.
17931793
*
17941794
* https://svelte.dev/docs/svelte-transition#crossfade
17951795
* */

0 commit comments

Comments
 (0)