Skip to content

Commit 7874910

Browse files
PuruVJbenmccanndummdidumm
authored
fix: update/add links to website (#8729)
--------- Co-authored-by: Ben McCann <[email protected]> Co-authored-by: Simon H <[email protected]> Co-authored-by: Simon Holthausen <[email protected]>
1 parent 963cbcd commit 7874910

File tree

15 files changed

+101
-14
lines changed

15 files changed

+101
-14
lines changed

packages/svelte/src/compiler/compile/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ function validate_options(options, warnings) {
115115
}
116116

117117
/**
118+
* `compile` takes your component source code, and turns it into a JavaScript module that exports a class.
119+
*
120+
* https://svelte.dev/docs/svelte-compiler#svelte-compile
118121
* @param {string} source
119122
* @param {import('../interfaces.js').CompileOptions} options
120123
*/

packages/svelte/src/compiler/parse/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ export class Parser {
257257
}
258258

259259
/**
260+
* The parse function parses a component, returning only its abstract syntax tree.
261+
*
262+
* https://svelte.dev/docs/svelte-compiler#svelte-parse
260263
* @param {string} template
261264
* @param {import('../interfaces.js').ParserOptions} options
262265
* @returns {import('../interfaces.js').Ast}

packages/svelte/src/compiler/preprocess/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,10 @@ async function process_markup(process, source) {
327327
}
328328

329329
/**
330+
* The preprocess function provides convenient hooks for arbitrarily transforming component source code.
331+
* For example, it can be used to convert a <style lang="sass"> block into vanilla CSS.
332+
*
333+
* https://svelte.dev/docs/svelte-compiler#svelte-preprocess
330334
* @param {string} source
331335
* @param {import('./public.js').PreprocessorGroup | import('./public.js').PreprocessorGroup[]} preprocessor
332336
* @param {{ filename?: string }} [options]

packages/svelte/src/compiler/utils/namespaces.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// The `foreign` namespace covers all DOM implementations that aren't HTML5.
22
// It opts out of HTML5-specific a11y checks and case-insensitive attribute names.
3-
export const foreign = 'https://svelte.dev/docs#template-syntax-svelte-options';
3+
export const foreign = 'https://svelte.dev/docs/special-elements#svelte-options';
44
export const html = 'http://www.w3.org/1999/xhtml';
55
export const mathml = 'http://www.w3.org/1998/Math/MathML';
66
export const svg = 'http://www.w3.org/2000/svg';

packages/svelte/src/runtime/action/public.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* }
2525
* ```
2626
*
27-
* Docs: https://svelte.dev/docs#template-syntax-element-directives-use-action
27+
* Docs: https://svelte.dev/docs/svelte-action
2828
*/
2929
export interface ActionReturn<
3030
Parameter = never,
@@ -55,7 +55,7 @@ export interface ActionReturn<
5555
* You can return an object with methods `update` and `destroy` from the function and type which additional attributes and events it has.
5656
* See interface `ActionReturn` for more details.
5757
*
58-
* Docs: https://svelte.dev/docs#template-syntax-element-directives-use-action
58+
* Docs: https://svelte.dev/docs/svelte-action
5959
*/
6060
export interface Action<
6161
Element = HTMLElement,

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { cubicOut } from '../easing/index.js';
22
import { is_function } from '../internal/index.js';
33

44
/**
5+
* The flip function calculates the start and end position of an element and animates between them, translating the x and y values.
6+
* `flip` stands for [First, Last, Invert, Play](https://aerotwist.com/blog/flip-your-animations/).
7+
*
8+
* https://svelte.dev/docs/svelte-animate#flip
59
* @param {Element} node
610
* @param {{ from: DOMRect; to: DOMRect }} fromTo
711
* @param {import('./public.js').FlipParams} params

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Distributed under MIT License https://github.com/mattdesl/eases/blob/master/LICE
55
export { identity as linear } from '../internal/index.js';
66

77
/**
8+
* https://svelte.dev/docs/svelte-easing
89
* @param {number} t
910
* @returns {number}
1011
*/
@@ -15,6 +16,7 @@ export function backInOut(t) {
1516
}
1617

1718
/**
19+
* https://svelte.dev/docs/svelte-easing
1820
* @param {number} t
1921
* @returns {number}
2022
*/
@@ -24,6 +26,7 @@ export function backIn(t) {
2426
}
2527

2628
/**
29+
* https://svelte.dev/docs/svelte-easing
2730
* @param {number} t
2831
* @returns {number}
2932
*/
@@ -33,6 +36,7 @@ export function backOut(t) {
3336
}
3437

3538
/**
39+
* https://svelte.dev/docs/svelte-easing
3640
* @param {number} t
3741
* @returns {number}
3842
*/
@@ -54,6 +58,7 @@ export function bounceOut(t) {
5458
}
5559

5660
/**
61+
* https://svelte.dev/docs/svelte-easing
5762
* @param {number} t
5863
* @returns {number}
5964
*/
@@ -62,6 +67,7 @@ export function bounceInOut(t) {
6267
}
6368

6469
/**
70+
* https://svelte.dev/docs/svelte-easing
6571
* @param {number} t
6672
* @returns {number}
6773
*/
@@ -70,6 +76,7 @@ export function bounceIn(t) {
7076
}
7177

7278
/**
79+
* https://svelte.dev/docs/svelte-easing
7380
* @param {number} t
7481
* @returns {number}
7582
*/
@@ -79,6 +86,7 @@ export function circInOut(t) {
7986
}
8087

8188
/**
89+
* https://svelte.dev/docs/svelte-easing
8290
* @param {number} t
8391
* @returns {number}
8492
*/
@@ -87,6 +95,7 @@ export function circIn(t) {
8795
}
8896

8997
/**
98+
* https://svelte.dev/docs/svelte-easing
9099
* @param {number} t
91100
* @returns {number}
92101
*/
@@ -95,6 +104,7 @@ export function circOut(t) {
95104
}
96105

97106
/**
107+
* https://svelte.dev/docs/svelte-easing
98108
* @param {number} t
99109
* @returns {number}
100110
*/
@@ -103,6 +113,7 @@ export function cubicInOut(t) {
103113
}
104114

105115
/**
116+
* https://svelte.dev/docs/svelte-easing
106117
* @param {number} t
107118
* @returns {number}
108119
*/
@@ -111,6 +122,7 @@ export function cubicIn(t) {
111122
}
112123

113124
/**
125+
* https://svelte.dev/docs/svelte-easing
114126
* @param {number} t
115127
* @returns {number}
116128
*/
@@ -120,6 +132,7 @@ export function cubicOut(t) {
120132
}
121133

122134
/**
135+
* https://svelte.dev/docs/svelte-easing
123136
* @param {number} t
124137
* @returns {number}
125138
*/
@@ -133,6 +146,7 @@ export function elasticInOut(t) {
133146
}
134147

135148
/**
149+
* https://svelte.dev/docs/svelte-easing
136150
* @param {number} t
137151
* @returns {number}
138152
*/
@@ -141,6 +155,7 @@ export function elasticIn(t) {
141155
}
142156

143157
/**
158+
* https://svelte.dev/docs/svelte-easing
144159
* @param {number} t
145160
* @returns {number}
146161
*/
@@ -149,6 +164,7 @@ export function elasticOut(t) {
149164
}
150165

151166
/**
167+
* https://svelte.dev/docs/svelte-easing
152168
* @param {number} t
153169
* @returns {number}
154170
*/
@@ -161,6 +177,7 @@ export function expoInOut(t) {
161177
}
162178

163179
/**
180+
* https://svelte.dev/docs/svelte-easing
164181
* @param {number} t
165182
* @returns {number}
166183
*/
@@ -169,6 +186,7 @@ export function expoIn(t) {
169186
}
170187

171188
/**
189+
* https://svelte.dev/docs/svelte-easing
172190
* @param {number} t
173191
* @returns {number}
174192
*/
@@ -177,6 +195,7 @@ export function expoOut(t) {
177195
}
178196

179197
/**
198+
* https://svelte.dev/docs/svelte-easing
180199
* @param {number} t
181200
* @returns {number}
182201
*/
@@ -188,6 +207,7 @@ export function quadInOut(t) {
188207
}
189208

190209
/**
210+
* https://svelte.dev/docs/svelte-easing
191211
* @param {number} t
192212
* @returns {number}
193213
*/
@@ -196,6 +216,7 @@ export function quadIn(t) {
196216
}
197217

198218
/**
219+
* https://svelte.dev/docs/svelte-easing
199220
* @param {number} t
200221
* @returns {number}
201222
*/
@@ -204,6 +225,7 @@ export function quadOut(t) {
204225
}
205226

206227
/**
228+
* https://svelte.dev/docs/svelte-easing
207229
* @param {number} t
208230
* @returns {number}
209231
*/
@@ -212,6 +234,7 @@ export function quartInOut(t) {
212234
}
213235

214236
/**
237+
* https://svelte.dev/docs/svelte-easing
215238
* @param {number} t
216239
* @returns {number}
217240
*/
@@ -220,6 +243,7 @@ export function quartIn(t) {
220243
}
221244

222245
/**
246+
* https://svelte.dev/docs/svelte-easing
223247
* @param {number} t
224248
* @returns {number}
225249
*/
@@ -228,6 +252,7 @@ export function quartOut(t) {
228252
}
229253

230254
/**
255+
* https://svelte.dev/docs/svelte-easing
231256
* @param {number} t
232257
* @returns {number}
233258
*/
@@ -237,6 +262,7 @@ export function quintInOut(t) {
237262
}
238263

239264
/**
265+
* https://svelte.dev/docs/svelte-easing
240266
* @param {number} t
241267
* @returns {number}
242268
*/
@@ -245,6 +271,7 @@ export function quintIn(t) {
245271
}
246272

247273
/**
274+
* https://svelte.dev/docs/svelte-easing
248275
* @param {number} t
249276
* @returns {number}
250277
*/
@@ -253,6 +280,7 @@ export function quintOut(t) {
253280
}
254281

255282
/**
283+
* https://svelte.dev/docs/svelte-easing
256284
* @param {number} t
257285
* @returns {number}
258286
*/
@@ -261,6 +289,7 @@ export function sineInOut(t) {
261289
}
262290

263291
/**
292+
* https://svelte.dev/docs/svelte-easing
264293
* @param {number} t
265294
* @returns {number}
266295
*/
@@ -271,6 +300,7 @@ export function sineIn(t) {
271300
}
272301

273302
/**
303+
* https://svelte.dev/docs/svelte-easing
274304
* @param {number} t
275305
* @returns {number}
276306
*/

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function get_current_component() {
1717
*
1818
* The first time the callback runs will be before the initial `onMount`
1919
*
20-
* https://svelte.dev/docs#run-time-svelte-beforeupdate
20+
* https://svelte.dev/docs/svelte#beforeupdate
2121
* @param {() => any} fn
2222
* @returns {void}
2323
*/
@@ -34,7 +34,7 @@ export function beforeUpdate(fn) {
3434
*
3535
* `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api).
3636
*
37-
* https://svelte.dev/docs#run-time-svelte-onmount
37+
* https://svelte.dev/docs/svelte#onmount
3838
* @template T
3939
* @param {() => import('./private.js').NotFunction<T> | Promise<import('./private.js').NotFunction<T>> | (() => any)} fn
4040
* @returns {void}
@@ -47,6 +47,8 @@ export function onMount(fn) {
4747
* Schedules a callback to run immediately after the component has been updated.
4848
*
4949
* The first time the callback runs will be after the initial `onMount`
50+
*
51+
* https://svelte.dev/docs/svelte#afterupdate
5052
* @param {() => any} fn
5153
* @returns {void}
5254
*/
@@ -60,7 +62,7 @@ export function afterUpdate(fn) {
6062
* Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the
6163
* only one that runs inside a server-side component.
6264
*
63-
* https://svelte.dev/docs#run-time-svelte-ondestroy
65+
* https://svelte.dev/docs/svelte#ondestroy
6466
* @param {() => any} fn
6567
* @returns {void}
6668
*/
@@ -87,7 +89,7 @@ export function onDestroy(fn) {
8789
* }>();
8890
* ```
8991
*
90-
* https://svelte.dev/docs#run-time-svelte-createeventdispatcher
92+
* https://svelte.dev/docs/svelte#createeventdispatcher
9193
* @template {Record<string, any>} [EventMap=any]
9294
* @returns {import('./public.js').EventDispatcher<EventMap>}
9395
*/
@@ -115,7 +117,7 @@ export function createEventDispatcher() {
115117
*
116118
* Like lifecycle functions, this must be called during component initialisation.
117119
*
118-
* https://svelte.dev/docs#run-time-svelte-setcontext
120+
* https://svelte.dev/docs/svelte#setcontext
119121
* @template T
120122
* @param {any} key
121123
* @param {T} context
@@ -130,7 +132,7 @@ export function setContext(key, context) {
130132
* Retrieves the context that belongs to the closest parent component with the specified `key`.
131133
* Must be called during component initialisation.
132134
*
133-
* https://svelte.dev/docs#run-time-svelte-getcontext
135+
* https://svelte.dev/docs/svelte#getcontext
134136
* @template T
135137
* @param {any} key
136138
* @returns {T}
@@ -144,7 +146,7 @@ export function getContext(key) {
144146
* Must be called during component initialisation. Useful, for example, if you
145147
* programmatically create a component and want to pass the existing context to it.
146148
*
147-
* https://svelte.dev/docs#run-time-svelte-getallcontexts
149+
* https://svelte.dev/docs/svelte#getallcontexts
148150
* @template {Map<any, any>} [T=Map<any, any>]
149151
* @returns {T}
150152
*/
@@ -156,7 +158,7 @@ export function getAllContexts() {
156158
* Checks whether a given `key` has been set in the context of a parent component.
157159
* Must be called during component initialisation.
158160
*
159-
* https://svelte.dev/docs#run-time-svelte-hascontext
161+
* https://svelte.dev/docs/svelte#hascontext
160162
* @param {any} key
161163
* @returns {boolean}
162164
*/

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ export function subscribe(store, ...callbacks) {
107107

108108
/**
109109
* Get the current value from a store by subscribing and immediately unsubscribing.
110+
*
111+
* https://svelte.dev/docs/svelte-store#get
110112
* @template T
111113
* @param {import('../store/public.js').Readable<T>} store
112114
* @returns {T}

0 commit comments

Comments
 (0)