Skip to content

Commit f4ccd56

Browse files
authored
feat: add MODULE replacement syntax, consolidate sync (#78)
Remove the `<!-- @include ... -->` syntax in favor of the existing `> XXX:` syntax. Add a new `> MODULE:` placeholder. Move some special-casing into sync script. Consolidate stuff.
1 parent 883bc6f commit f4ccd56

File tree

8 files changed

+604
-107
lines changed

8 files changed

+604
-107
lines changed

apps/svelte.dev/content/docs/kit/20-core-concepts/20-load.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,7 @@ To summarize, a `load` function will rerun in the following situations:
664664
- It references a property of `url` (such as `url.pathname` or `url.search`) whose value has changed. Properties in `request.url` are _not_ tracked
665665
- It calls `url.searchParams.get(...)`, `url.searchParams.getAll(...)` or `url.searchParams.has(...)` and the parameter in question changes. Accessing other properties of `url.searchParams` will have the same effect as accessing `url.search`.
666666
- It calls `await parent()` and a parent `load` function reran
667+
- A child `load` function calls `await parent()` and is rerunning, and the parent is a server load function
667668
- It declared a dependency on a specific URL via [`fetch`](#making-fetch-requests) (universal load only) or [`depends`](types#public-types-loadevent), and that URL was marked invalid with [`invalidate(url)`](modules#$app-navigation-invalidate)
668669
- All active `load` functions were forcibly rerun with [`invalidateAll()`](modules#$app-navigation-invalidateall)
669670

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,10 @@ Compress files in `directory` with gzip and brotli, where appropriate. Generates
814814
</div>
815815
</div>
816816

817+
## Config
818+
819+
See the [configuration reference](/docs/kit/configuration) for details.
820+
817821
## Cookies
818822

819823
<div class="ts-block">
@@ -1085,6 +1089,10 @@ The content of the error.
10851089
</div>
10861090
</div>
10871091

1092+
## KitConfig
1093+
1094+
See the [configuration reference](/docs/kit/configuration) for details.
1095+
10881096
## LessThan
10891097

10901098
<div class="ts-block">

apps/svelte.dev/content/docs/svelte/04-runtime/03-lifecycle-hooks.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ If a function is returned from `onMount`, it will be called when the component i
4545
4646
## `onDestroy`
4747

48-
> EXPORT_SNIPPET: svelte#onDestroy
48+
<div class="ts-block">
49+
50+
```dts
51+
function onDestroy(fn: () => any): void;
52+
```
53+
54+
</div>
4955

5056
Schedules a callback to run immediately before the component is unmounted.
5157

apps/svelte.dev/content/docs/svelte/98-reference/21-svelte-store.md

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,140 @@ function writable<T>(
186186

187187
</div>
188188

189+
## Readable
190+
191+
Readable interface for subscribing.
192+
193+
<div class="ts-block">
194+
195+
```dts
196+
interface Readable<T> {/*…*/}
197+
```
198+
199+
<div class="ts-block-property">
200+
201+
```dts
202+
subscribe(this: void, run: Subscriber<T>, invalidate?: () => void): Unsubscriber;
203+
```
204+
205+
<div class="ts-block-property-details">
206+
207+
<div class="ts-block-property-bullets">
208+
209+
- `run` subscription callback
210+
- `invalidate` cleanup callback
211+
212+
</div>
213+
214+
Subscribe on value changes.
215+
216+
</div>
217+
</div>
218+
</div>
219+
220+
## StartStopNotifier
221+
222+
Start and stop notification callbacks.
223+
This function is called when the first subscriber subscribes.
224+
225+
<div class="ts-block">
226+
227+
```dts
228+
type StartStopNotifier<T> = (
229+
set: (value: T) => void,
230+
update: (fn: Updater<T>) => void
231+
) => void | (() => void);
232+
```
233+
234+
235+
</div>
236+
237+
## Subscriber
238+
239+
Callback to inform of a value updates.
240+
241+
<div class="ts-block">
242+
243+
```dts
244+
type Subscriber<T> = (value: T) => void;
245+
```
246+
247+
248+
</div>
249+
250+
## Unsubscriber
251+
252+
Unsubscribes from value updates.
253+
254+
<div class="ts-block">
255+
256+
```dts
257+
type Unsubscriber = () => void;
258+
```
259+
260+
261+
</div>
262+
263+
## Updater
264+
265+
Callback to update a value.
266+
267+
<div class="ts-block">
268+
269+
```dts
270+
type Updater<T> = (value: T) => T;
271+
```
272+
273+
274+
</div>
275+
276+
## Writable
277+
278+
Writable interface for both updating and subscribing.
279+
280+
<div class="ts-block">
281+
282+
```dts
283+
interface Writable<T> extends Readable<T> {/*…*/}
284+
```
285+
286+
<div class="ts-block-property">
287+
288+
```dts
289+
set(this: void, value: T): void;
290+
```
291+
292+
<div class="ts-block-property-details">
293+
294+
<div class="ts-block-property-bullets">
295+
296+
- `value` to set
297+
298+
</div>
299+
300+
Set value and inform subscribers.
301+
302+
</div>
303+
</div>
304+
305+
<div class="ts-block-property">
306+
307+
```dts
308+
update(this: void, updater: Updater<T>): void;
309+
```
310+
311+
<div class="ts-block-property-details">
312+
313+
<div class="ts-block-property-bullets">
314+
315+
- `updater` callback
316+
317+
</div>
318+
319+
Update value using callback and inform subscribers.
320+
321+
</div>
322+
</div>
323+
</div>
324+
189325

0 commit comments

Comments
 (0)