From 92830b077bca9c52941efbcf8643871b00b00e2f Mon Sep 17 00:00:00 2001 From: Puru Vijay Date: Fri, 17 Feb 2023 02:24:48 +0530 Subject: [PATCH 01/20] Update links --- site/content/docs/02-component-format.md | 39 ++- site/content/docs/03-template-syntax.md | 229 ++++++------ site/content/docs/04-run-time.md | 329 +++++++++--------- .../01-introduction/01-basics/text.md | 9 +- .../01-introduction/07-making-an-app/text.md | 10 +- .../08-stores/04-derived-stores/text.md | 9 +- .../tutorial/09-motion/02-spring/text.md | 15 +- .../19-next-steps/01-congratulations/text.md | 2 +- sites/svelte.dev/svelte.config.js | 4 - 9 files changed, 327 insertions(+), 319 deletions(-) diff --git a/site/content/docs/02-component-format.md b/site/content/docs/02-component-format.md index d9f7a356623b..9d42fa665b1a 100644 --- a/site/content/docs/02-component-format.md +++ b/site/content/docs/02-component-format.md @@ -28,7 +28,7 @@ A ` ``` -Readonly props can be accessed as properties on the element, tied to the component using [`bind:this` syntax](/docs#template-syntax-component-directives-bind-this). +Readonly props can be accessed as properties on the element, tied to the component using [`bind:this` syntax](/docs/template-syntax#component-directives-bind-this). --- @@ -174,11 +174,11 @@ Only values which directly appear within the `$:` block will become dependencies @@ -193,17 +193,18 @@ Total: {total} ``` --- + It is important to note that the reactive blocks are ordered via simple static analysis at compile time, and all the compiler looks at are the variables that are assigned to and used within the block itself, not in any functions called by them. This means that `yDependent` will not be updated when `x` is updated in the following example: ```sv @@ -230,7 +231,7 @@ If a statement consists entirely of an assignment to an undeclared variable, Sve --- -A *store* is an object that allows reactive access to a value via a simple *store contract*. The [`svelte/store` module](/docs#run-time-svelte-store) contains minimal store implementations which fulfil this contract. +A _store_ is an object that allows reactive access to a value via a simple _store contract_. The [`svelte/store` module](/docs/run-time#svelte-store) contains minimal store implementations which fulfil this contract. Any time you have a reference to a store, you can access its value inside a component by prefixing it with the `$` character. This causes Svelte to declare the prefixed variable, subscribe to the store at component initialization and unsubscribe when appropriate. @@ -238,7 +239,7 @@ Assignments to `$`-prefixed variables require that the variable be a writable st Note that the store must be declared at the top level of the component — not inside an `if` block or a function, for example. -Local variables (that do not represent store values) must *not* have a `$` prefix. +Local variables (that do not represent store values) must _not_ have a `$` prefix. ```sv ``` - ### <style> --- @@ -336,11 +335,11 @@ To apply styles to a selector globally, use the `:global(...)` modifier. } p:global(.red) { - /* this will apply to all

elements belonging to this + /* this will apply to all

elements belonging to this component with a class of red, even if class="red" does - not initially appear in the markup, and is instead - added at runtime. This is useful when the class - of the element is dynamically applied, for instance + not initially appear in the markup, and is instead + added at runtime. This is useful when the class + of the element is dynamically applied, for instance when updating the element's classList property directly. */ } @@ -354,7 +353,9 @@ The `-global-` part will be removed when compiled, and the keyframe then be refe ```html ``` diff --git a/site/content/docs/03-template-syntax.md b/site/content/docs/03-template-syntax.md index 481fbd440586..fc92392c7048 100644 --- a/site/content/docs/03-template-syntax.md +++ b/site/content/docs/03-template-syntax.md @@ -2,12 +2,11 @@ title: Template syntax --- - ### Tags --- -A lowercase tag, like `

`, denotes a regular HTML element. A capitalised tag, such as `` or ``, indicates a *component*. +A lowercase tag, like `
`, denotes a regular HTML element. A capitalised tag, such as `` or ``, indicates a _component_. ```sv ``` -> This behaviour will only work when the function passed to `onMount` *synchronously* returns a value. `async` functions always return a `Promise`, and as such cannot *synchronously* return a function. +> This behaviour will only work when the function passed to `onMount` _synchronously_ returns a value. `async` functions always return a `Promise`, and as such cannot _synchronously_ return a function. #### `beforeUpdate` @@ -121,7 +121,7 @@ Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the onl #### `tick` ```js -promise: Promise = tick() +promise: Promise = tick(); ``` --- @@ -160,7 +160,7 @@ Like lifecycle functions, this must be called during component initialisation. ``` -> Context is not inherently reactive. If you need reactive values in context then you can pass a store into context, which *will* be reactive. +> Context is not inherently reactive. If you need reactive values in context then you can pass a store into context, which _will_ be reactive. #### `getContext` @@ -226,7 +226,7 @@ dispatch: ((name: string, detail?: any, options?: DispatchOptions) => boolean) = --- -Creates an event dispatcher that can be used to dispatch [component events](/docs#template-syntax-component-directives-on-eventname). Event dispatchers are functions that can take two arguments: `name` and `detail`. +Creates an event dispatcher that can be used to dispatch [component events](/docs/template-syntax#component-directives-on-eventname). Event dispatchers are functions that can take two arguments: `name` and `detail`. Component events created with `createEventDispatcher` create a [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent). These events do not [bubble](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture). The `detail` argument corresponds to the [CustomEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail) property and can contain any type of data. @@ -277,17 +277,18 @@ Events can be cancelable by passing a third parameter to the dispatch function. ### `svelte/store` -The `svelte/store` module exports functions for creating [readable](/docs#run-time-svelte-store-readable), [writable](/docs#run-time-svelte-store-writable) and [derived](/docs#run-time-svelte-store-derived) stores. +The `svelte/store` module exports functions for creating [readable](/docs/run-time#svelte-store-readable), [writable](/docs/run-time#svelte-store-writable) and [derived](/docs/run-time#svelte-store-derived) stores. -Keep in mind that you don't *have* to use these functions to enjoy the [reactive `$store` syntax](/docs#component-format-script-4-prefix-stores-with-$-to-access-their-values) in your components. Any object that correctly implements `.subscribe`, unsubscribe, and (optionally) `.set` is a valid store, and will work both with the special syntax, and with Svelte's built-in [`derived` stores](/docs#run-time-svelte-store-derived). +Keep in mind that you don't _have_ to use these functions to enjoy the [reactive `$store` syntax](/docs/component-format#script-4-prefix-stores-with-$-to-access-their-values) in your components. Any object that correctly implements `.subscribe`, unsubscribe, and (optionally) `.set` is a valid store, and will work both with the special syntax, and with Svelte's built-in [`derived` stores](/docs/run-time#svelte-store-derived). -This makes it possible to wrap almost any other reactive state handling library for use in Svelte. Read more about the [store contract](/docs#component-format-script-4-prefix-stores-with-$-to-access-their-values-store-contract) to see what a correct implementation looks like. +This makes it possible to wrap almost any other reactive state handling library for use in Svelte. Read more about the [store contract](/docs/component-format#script-4-prefix-stores-with-$-to-access-their-values-store-contract) to see what a correct implementation looks like. #### `writable` ```js store = writable(value?: any) ``` + ```js store = writable(value?: any, start?: (set: (value: any) => void) => () => void) ``` @@ -301,17 +302,17 @@ Function that creates a store which has values that can be set from 'outside' co `update` is a method that takes one argument which is a callback. The callback takes the existing store value as its argument and returns the new value to be set to the store. ```js -import { writable } from 'svelte/store'; +import { writable } from "svelte/store"; const count = writable(0); -count.subscribe(value => { +count.subscribe((value) => { console.log(value); }); // logs '0' count.set(1); // logs '1' -count.update(n => n + 1); // logs '2' +count.update((n) => n + 1); // logs '2' ``` --- @@ -319,16 +320,16 @@ count.update(n => n + 1); // logs '2' If a function is passed as the second argument, it will be called when the number of subscribers goes from zero to one (but not from one to two, etc). That function will be passed a `set` function which changes the value of the store. It must return a `stop` function that is called when the subscriber count goes from one to zero. ```js -import { writable } from 'svelte/store'; +import { writable } from "svelte/store"; const count = writable(0, () => { - console.log('got a subscriber'); - return () => console.log('no more subscribers'); + console.log("got a subscriber"); + return () => console.log("no more subscribers"); }); count.set(1); // does nothing -const unsubscribe = count.subscribe(value => { +const unsubscribe = count.subscribe((value) => { console.log(value); }); // logs 'got a subscriber', then '1' @@ -348,9 +349,9 @@ store = readable(value?: any, start?: (set: (value: any) => void) => () => void) Creates a store whose value cannot be set from 'outside', the first argument is the store's initial value, and the second argument to `readable` is the same as the second argument to `writable`. ```js -import { readable } from 'svelte/store'; +import { readable } from "svelte/store"; -const time = readable(null, set => { +const time = readable(null, (set) => { set(new Date()); const interval = setInterval(() => { @@ -366,12 +367,15 @@ const time = readable(null, set => { ```js store = derived(a, callback: (a: any) => any) ``` + ```js store = derived(a, callback: (a: any, set: (value: any) => void) => void | () => void, initial_value: any) ``` + ```js store = derived([a, ...b], callback: ([a: any, ...b: any[]]) => any) ``` + ```js store = derived([a, ...b], callback: ([a: any, ...b: any[]], set: (value: any) => void) => void | () => void, initial_value: any) ``` @@ -383,9 +387,9 @@ Derives a store from one or more other stores. The callback runs initially when In the simplest version, `derived` takes a single store, and the callback returns a derived value. ```js -import { derived } from 'svelte/store'; +import { derived } from "svelte/store"; -const doubled = derived(a, $a => $a * 2); +const doubled = derived(a, ($a) => $a * 2); ``` --- @@ -395,11 +399,15 @@ The callback can set a value asynchronously by accepting a second argument, `set In this case, you can also pass a third argument to `derived` — the initial value of the derived store before `set` is first called. ```js -import { derived } from 'svelte/store'; +import { derived } from "svelte/store"; -const delayed = derived(a, ($a, set) => { - setTimeout(() => set($a), 1000); -}, 'one moment...'); +const delayed = derived( + a, + ($a, set) => { + setTimeout(() => set($a), 1000); + }, + "one moment..." +); ``` --- @@ -407,17 +415,21 @@ const delayed = derived(a, ($a, set) => { If you return a function from the callback, it will be called when a) the callback runs again, or b) the last subscriber unsubscribes. ```js -import { derived } from 'svelte/store'; +import { derived } from "svelte/store"; -const tick = derived(frequency, ($frequency, set) => { - const interval = setInterval(() => { - set(Date.now()); - }, 1000 / $frequency); +const tick = derived( + frequency, + ($frequency, set) => { + const interval = setInterval(() => { + set(Date.now()); + }, 1000 / $frequency); - return () => { - clearInterval(interval); - }; -}, 'one moment...'); + return () => { + clearInterval(interval); + }; + }, + "one moment..." +); ``` --- @@ -425,7 +437,7 @@ const tick = derived(frequency, ($frequency, set) => { In both cases, an array of arguments can be passed as the first argument instead of a single store. ```js -import { derived } from 'svelte/store'; +import { derived } from "svelte/store"; const summed = derived([a, b], ([$a, $b]) => $a + $b); @@ -437,7 +449,7 @@ const delayed = derived([a, b], ([$a, $b], set) => { #### `get` ```js -value: any = get(store) +value: any = get(store); ``` --- @@ -447,12 +459,11 @@ Generally, you should read the value of a store by subscribing to it and using t > This works by creating a subscription, reading the value, then unsubscribing. It's therefore not recommended in hot code paths. ```js -import { get } from 'svelte/store'; +import { get } from "svelte/store"; const value = get(store); ``` - ### `svelte/motion` The `svelte/motion` module exports two functions, `tweened` and `spring`, for creating writable stores whose values change over time after `set` and `update`, rather than immediately. @@ -465,10 +476,10 @@ store = tweened(value: any, options) Tweened stores update their values over a fixed duration. The following options are available: -* `delay` (`number`, default 0) — milliseconds before starting -* `duration` (`number` | `function`, default 400) — milliseconds the tween lasts -* `easing` (`function`, default `t => t`) — an [easing function](/docs#run-time-svelte-easing) -* `interpolate` (`function`) — see below +- `delay` (`number`, default 0) — milliseconds before starting +- `duration` (`number` | `function`, default 400) — milliseconds the tween lasts +- `easing` (`function`, default `t => t`) — an [easing function](/docs/run-time#svelte-easing) +- `interpolate` (`function`) — see below `store.set` and `store.update` can accept a second `options` argument that will override the options passed in upon instantiation. @@ -507,7 +518,7 @@ If the initial value is `undefined` or `null`, the first value change will take ```js const size = tweened(undefined, { duration: 300, - easing: cubicOut + easing: cubicOut, }); $: $size = big ? 100 : 10; @@ -515,7 +526,7 @@ $: $size = big ? 100 : 10; --- -The `interpolate` option allows you to tween between *any* arbitrary values. It must be an `(a, b) => t => value` function, where `a` is the starting value, `b` is the target value, `t` is a number between 0 and 1, and `value` is the result. For example, we can use the [d3-interpolate](https://github.com/d3/d3-interpolate) package to smoothly interpolate between two colours. +The `interpolate` option allows you to tween between _any_ arbitrary values. It must be an `(a, b) => t => value` function, where `a` is the starting value, `b` is the target value, `t` is a number between 0 and 1, and `value` is the result. For example, we can use the [d3-interpolate](https://github.com/d3/d3-interpolate) package to smoothly interpolate between two colours. ```sv '` string occurrence breaking pages ([#349](https://github.com/sveltejs/svelte/pull/349)) -* Allow reference to whitelisted globals without properties ([#333](https://github.com/sveltejs/svelte/pull/333)) -* Don't remove ` ` incorrectly ([#348](https://github.com/sveltejs/svelte/issues/348)) -* `let` -> `var` in `addCss` block ([#351](https://github.com/sveltejs/svelte/pull/351)) +- Prevent `''` string occurrence breaking pages ([#349](https://github.com/sveltejs/svelte/pull/349)) +- Allow reference to whitelisted globals without properties ([#333](https://github.com/sveltejs/svelte/pull/333)) +- Don't remove ` ` incorrectly ([#348](https://github.com/sveltejs/svelte/issues/348)) +- `let` -> `var` in `addCss` block ([#351](https://github.com/sveltejs/svelte/pull/351)) ## 1.10.2 -* Accept any case for doctype declarations ([#336](https://github.com/sveltejs/svelte/issues/336)) -* Allow non-top-level ` ``` + This will make sure that you can invoke dispatch only with the specified event names and its types. The Svelte for VS Code extension was also updated to deal with this new feature. It will provide strong typings for these events as well as autocompletion and hover information. **New from Sapper!** @@ -37,44 +40,47 @@ Sapper 0.28.9 just came out. The highlights from it include much better support In addition, Sapper's CSS handling has been rewritten over the course of recent releases in order to fix existing CSS handling bugs, refactor the CSS handling to occur entirely within a Rollup plugin, and remove the need internally to register CSS in the routing system. Congrats and thank you to the folks working on Sapper for all their solid work! - ## Impactful bug fixes + - CSS compilation will no longer remove rules for the `open` attribute on `
` elements ([Example](https://svelte.dev/repl/ab4c0c177d1f4fab92f46eb8539cea9a?version=3.26.0), **3.26.0**) - `prettier-plugin-svelte` will do a better job now at dealing with whitespaces, especially around inline elements. It will also preserve formatting inside `
` tags and will no longer format languages which are not supported by Prettier, like SASS, Pug or Stylus.
 
-
 ## Coming up
+
 - [Svelte Summit](https://sveltesummit.com/), Svelte's second global online conference, is taking place on October 18! Sign up for free to get reminders and talk updates!
 
 For all the features and bugfixes see the CHANGELOG for [Svelte](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md) and [Sapper](https://github.com/sveltejs/sapper/blob/master/CHANGELOG.md).
 
-
 ---
 
 ## Svelte Showcase
+
 - [This CustomMenu example](https://svelte.dev/repl/3a33725c3adb4f57b46b597f9dade0c1?version=3.25.0) demos how to replace the OS right-click menu
 - [GitHub Tetris](https://svelte.dev/repl/cc1eaa7c66964fedb5e70e3ecbbaa0e1?version=3.25.1) lets you play a Tetris-like game in a git commit history
 - [Who are my representatives?](https://whoaremyrepresentatives.us/) is a website built with Svelte to help US residents get more info on their congressional representatives
 - [Pick Palette](https://github.com/bluwy/pick-palette) is a color palette manager made with Svelte!
 
 ### In-depth learning:
+
 - [Svelte 3 Up and Running](https://www.amazon.com/dp/B08D6T6BKS/ref=cm_sw_r_tw_dp_x_OQMtFb3GPQCB2) is a new book about building production-ready static web apps with Svelte 3
 - [Sapper Tutorial (Crash Course)](https://www.youtube.com/playlist?list=PL4cUxeGkcC9gdr4Qhx83gBBcID-KMe-PQ) walks through the ins-and-outs of Sapper, the Svelte-powered application framework
 - [Svelte Society Day France](https://france.sveltesociety.dev/) happened September 27th featuring a wide variety of topics all in French! You can find the full recording [here](https://www.youtube.com/watch?v=aS1TQ155JK4).
 
 ### Plug-and-play components:
+
 - [svelte-zoom](https://github.com/vaheqelyan/svelte-zoom) brings "nearly native" pan-and-zoom to images on desktop and mobile
 - [svelte-materialify](https://github.com/TheComputerM/svelte-materialify) is a Material component library for Svelte with over 50 components
 - [svelte-undoable](https://github.com/macfja/svelte-undoable) makes it easy to introduce undo and redo functionality using `bind:`
 - [This Tilt component](https://svelte.dev/repl/7b23ad9d2693424482cd411b0378b55b?version=3.24.1) implements a common UX pattern where the hovered element tilts to follow the mouse
 
 ### Lots of examples of how use JS tech came out this month:
-  - [Sapper with PostCSS and Tailwind](https://codechips.me/sapper-with-postcss-and-tailwind/)
-  - [PrismJS (Code block syntax highlighting)](https://github.com/phptuts/Svelte-PrismJS)
-  - [Filepond (Drag-and-drop file upload)](https://github.com/pqina/svelte-filepond)
-  - [Ionic (UI Components)](https://github.com/Tommertom/svelte-ionic-app)
-  - [Pell (WYSIWYG Editor)](https://github.com/Demonicious/svelte-pell/)
-  - [Leaflet (Mapping)](https://github.com/anoram/leaflet-svelte)
+
+- [Sapper with PostCSS and Tailwind](https://codechips.me/sapper-with-postcss-and-tailwind/)
+- [PrismJS (Code block syntax highlighting)](https://github.com/phptuts/Svelte-PrismJS)
+- [Filepond (Drag-and-drop file upload)](https://github.com/pqina/svelte-filepond)
+- [Ionic (UI Components)](https://github.com/Tommertom/svelte-ionic-app)
+- [Pell (WYSIWYG Editor)](https://github.com/Demonicious/svelte-pell/)
+- [Leaflet (Mapping)](https://github.com/anoram/leaflet-svelte)
 
 **Reminder**: There's a [Svelte integrations repo](https://github.com/sveltejs/integrations) that demonstrates ways to incorporate Svelte into your stack (and vice versa). If you've got questions on how to use a particular piece of tech with Svelte, you may find your answer there... and if you've gotten something to work with Svelte, consider contributing!
 
diff --git a/site/content/blog/2020-11-01-whats-new-in-svelte-november-2020.md b/site/content/blog/2020-11-01-whats-new-in-svelte-november-2020.md
index 07956b01ec93..d29859a47329 100644
--- a/site/content/blog/2020-11-01-whats-new-in-svelte-november-2020.md
+++ b/site/content/blog/2020-11-01-whats-new-in-svelte-november-2020.md
@@ -10,7 +10,7 @@ Welcome back to the "What's new in Svelte" series! This month, we're covering ne
 ## New features & impactful bug fixes
 
 1. Destructuring Promises now works as expected by using the `{#await}` syntax
- (**3.29.3**, [Example](https://svelte.dev/repl/3fd4e2cecfa14d629961478f1dac2445?version=3.29.3))
+   (**3.29.3**, [Example](https://svelte.dev/repl/3fd4e2cecfa14d629961478f1dac2445?version=3.29.3))
 2. Slot forwarding (released in 3.29.0) should no longer hang during compilation (**3.29.3**, [Example](https://svelte.dev/repl/29959e70103f4868a6525c0734934936?version=3.29.3))
 3. Better typings for the `get` function in `svelte/store` and on lifecycle hooks (**3.29.1**)
 
@@ -18,17 +18,17 @@ Welcome back to the "What's new in Svelte" series! This month, we're covering ne
 
 Sapper got some new types in its `preload` function, which will make typing easier if you are using TypeScript. See the [Sapper docs](https://sapper.svelte.dev/docs#Typing_the_function) on how to use them. There also were fixes to `preload` links in exported sites. Route layouts got a few fixes too - including ensuring CSS is applied to nested route layouts. You can also better organize your files now that extensions with multiple dots are supported. (**0.28.10**)
 
-
 For all the features and bugfixes see the CHANGELOGs for [Svelte](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md) and [Sapper](https://github.com/sveltejs/sapper/blob/master/CHANGELOG.md).
 
-
 ## [Svelte Summit](https://sveltesummit.com/) was Svelte-tacular!
+
 - Rich Harris demoed the possible future of Svelte development in a talk titled "Futuristic Web Development". The not-yet-public project is called SvelteKit (name may change) and will bring a first-class developer experience and more flexibility for build outputs. If you want to get the full sneak-peek, [check out the video](https://www.youtube.com/watch?v=qSfdtmcZ4d0).
 - 17 speakers made the best of the conference's virtual format... From floating heads to seamless demos, Svelte developers from every skill level will find something of interest in this year's [YouTube playlist](https://www.youtube.com/playlist?list=PL8bMgX1kyZThM1sbYCoWdTcpiYysJsSeu)
 
 ---
 
 ## Community Showcase
+
 - [Svelte Lab](https://sveltelab.app/) showcases a variety of components, visualizations and interactions that can be achieved in Svelte. You can click into any component to see its source or edit it, using the site's built-in REPL
 - [svelte-electron-boilerplate](https://github.com/hjalmar/svelte-electron-boilerplate) is a fast way to get up and running with a Svelte app built in the desktop javascript framework, Electron
 - [React Hooks in Svelte](https://github.com/joshnuss/react-hooks-in-svelte) showcases examples of common React Hooks ported to Svelte.
diff --git a/site/content/blog/2020-11-05-whats-the-deal-with-sveltekit.md b/site/content/blog/2020-11-05-whats-the-deal-with-sveltekit.md
index 26cfe979a009..a89181fc6aa2 100644
--- a/site/content/blog/2020-11-05-whats-the-deal-with-sveltekit.md
+++ b/site/content/blog/2020-11-05-whats-the-deal-with-sveltekit.md
@@ -23,26 +23,23 @@ This was slightly tongue-in-cheek — as the talk explains, it's really more of
 
 
- ## What's Sapper? -[Sapper](https://sapper.svelte.dev) is an *app framework* (or 'metaframework') built on top of Svelte (which is a *component* framework). Its job is to make it easy to build Svelte apps with all the modern best practices like server-side rendering (SSR) and code-splitting, and to provide a project structure that makes development productive and fun. It uses *filesystem-based routing* (as popularised by [Next](https://nextjs.org/) and adopted by many other frameworks, albeit with some enhancements) — your project's file structure mirrors the structure of the app itself. +[Sapper](https://sapper.svelte.dev) is an _app framework_ (or 'metaframework') built on top of Svelte (which is a _component_ framework). Its job is to make it easy to build Svelte apps with all the modern best practices like server-side rendering (SSR) and code-splitting, and to provide a project structure that makes development productive and fun. It uses _filesystem-based routing_ (as popularised by [Next](https://nextjs.org/) and adopted by many other frameworks, albeit with some enhancements) — your project's file structure mirrors the structure of the app itself. While the Svelte homepage and documentation encourages you to [degit](https://github.com/Rich-Harris/degit) the [sveltejs/template](https://github.com/sveltejs/template) repo to start building an app, Sapper has long been our recommended way to build apps; this very blog post is (at the time of writing!) rendered with Sapper. - ## Why are we migrating to something new? Firstly, the distinction between [sveltejs/template](https://github.com/sveltejs/template) and [sveltejs/sapper-template](https://github.com/sveltejs/sapper-template) is confusing, particularly to newcomers to Svelte. Having a single recommended way to start building apps with Svelte will bring enormous benefits: we simplify onboarding, reduce the maintenance and support burden, and can potentially begin to explore the new possibilities that are unlocked by having a predictable project structure. (This last part is deliberately vague because it will take time to fully understand what those possibilities are.) Aside from all that, we've been tempted by the thought of rewriting Sapper for a while. This is partly because the codebase has become a little unkempt over the years ([Sapper started in 2017](/blog/sapper-towards-the-ideal-web-app-framework)), but mostly because the web has changed a lot recently, and it's time to rethink some of our foundational assumptions. - ## How is this new thing different? The first of those foundational assumptions is that you need to use a module bundler like [webpack](https://webpack.js.org/) or [Rollup](https://rollupjs.org/) to build apps. These tools trace the dependency graph of your application, analysing and transforming code along the way (turning Svelte components to JS modules, for example), in order to create bundles of code that can run anywhere. As the original creator of Rollup, I can attest that it is a surprisingly complex problem with fiendish edge cases. -You certainly needed a bundler several years ago, because browsers didn't natively support the `import` keyword, but it's much less true today. Right now, we're seeing the rise of the *unbundled development* workflow, which is radically simpler: instead of eagerly bundling your app, a dev server can serve modules (converted to JavaScript, if necessary) *on-demand*, meaning startup is essentially instantaneous however large your app becomes. +You certainly needed a bundler several years ago, because browsers didn't natively support the `import` keyword, but it's much less true today. Right now, we're seeing the rise of the _unbundled development_ workflow, which is radically simpler: instead of eagerly bundling your app, a dev server can serve modules (converted to JavaScript, if necessary) _on-demand_, meaning startup is essentially instantaneous however large your app becomes. [Snowpack](https://www.snowpack.dev/) is at the vanguard of this movement, and it's what powers SvelteKit. It's astonishingly fast, and has a beautiful development experience (hot module reloading, error overlays and so on), and we've been working closely with the Snowpack team on features like SSR. The hot module reloading is particularly revelatory if you're used to using Sapper with Rollup (which has never had first-class HMR support owing to its architecture, which prioritises the most efficient output). @@ -50,13 +47,12 @@ That's not to say we're abandoning bundlers altogether. It's still essential to The other foundational assumption is that a server-rendered app needs, well, a server. Sapper effectively has two modes — `sapper build`, which creates a standalone app that has to run on a Node server, and `sapper export` which bakes your app out as a collection of static files suitable for hosting on services like GitHub Pages. -Static files can go pretty much anywhere, but running a Node server (and monitoring/scaling it etc) is less straightforward. Nowadays we're witnessing a shift towards *serverless platforms*, in which you as the app author don't need to think about the server your code is running on, with all the attendant complexity. You can get Sapper apps running on serverless platforms, thanks to things like [vercel-sapper](https://github.com/thgh/vercel-sapper), but it's certainly not what you'd call idiomatic. +Static files can go pretty much anywhere, but running a Node server (and monitoring/scaling it etc) is less straightforward. Nowadays we're witnessing a shift towards _serverless platforms_, in which you as the app author don't need to think about the server your code is running on, with all the attendant complexity. You can get Sapper apps running on serverless platforms, thanks to things like [vercel-sapper](https://github.com/thgh/vercel-sapper), but it's certainly not what you'd call idiomatic. SvelteKit fully embraces the serverless paradigm, and will launch with support for all the major serverless providers, with an 'adapter' API for targeting any platforms that we don't officially cater to. In addition, we'll be able to do partial pre-rendering, which means that static pages can be generated at build time but dynamic ones get rendered on-demand. - ## When can I start using it? If you're feeling brave, you can start right now: @@ -71,19 +67,16 @@ We don't recommend it though! There are no docs, and we won't be able to offer a The work is being done in a private monorepo while we're still in exploration mode. Our plan is to get a public beta ready and announce it here once we've closed a few issues — the repo itself will remain private at that time, but we'll create a place to collect feedback from the YOLO crowd. After that, we'll work towards a 1.0 release which will involve opening the repo up. -I'm not going to make any firm promises about timings, because I don't like to break promises. But I *think* we're talking about weeks rather than months. - +I'm not going to make any firm promises about timings, because I don't like to break promises. But I _think_ we're talking about weeks rather than months. ## What if I don't want to use SvelteKit? You won't have to — it will always be possible to use Svelte as a standalone package or via a bundler integration like [rollup-plugin-svelte](https://github.com/sveltejs/rollup-plugin-svelte). We think it's essential that you can bend Svelte to fit your workflow, however esoteric, and use third-party app frameworks like [Elder.js](https://github.com/Elderjs/elderjs), [Routify](https://routify.dev/), [Plenti](https://plenti.co/), [Crown](https://crownframework.com/), [JungleJS](https://www.junglejs.org/) and others. - ## TypeScript? Don't worry, we won't launch without full TypeScript support. - ## How can I migrate my existing Sapper apps? For the most part, it should be relatively straightforward to migrate a Sapper codebase. @@ -92,12 +85,10 @@ There are some unavoidable changes (being able to run on serverless platforms me Detailed migration guides will accompany the 1.0 launch. - ## How can I contribute? Keep your eyes peeled for announcements about when we'll launch the public beta and open up the repo. (Also, blog post TODO but I would be remiss if I didn't mention that we now have an [OpenCollective](https://opencollective.com/svelte) where you can contribute financially to the project if it's been valuable to you. Many, many thanks to those of you who already have.) - ## Where can I learn more? -Follow [@sveltejs](https://twitter.com/sveltejs) and [@SvelteSociety](https://twitter.com/SvelteSociety) on Twitter, and visit [svelte.dev/chat](https://svelte.dev/chat). You should also subscribe to [Svelte Radio](https://www.svelteradio.com/), where Kevin and his co-hosts will grill me about this project on an upcoming episode (and between now and next week when we record it, [reply to this Twitter thread](https://twitter.com/Rich_Harris/status/1323376048571121665) with your additional questions). \ No newline at end of file +Follow [@sveltejs](https://twitter.com/sveltejs) and [@SvelteSociety](https://twitter.com/SvelteSociety) on Twitter, and visit [svelte.dev/chat](https://svelte.dev/chat). You should also subscribe to [Svelte Radio](https://www.svelteradio.com/), where Kevin and his co-hosts will grill me about this project on an upcoming episode (and between now and next week when we record it, [reply to this Twitter thread](https://twitter.com/Rich_Harris/status/1323376048571121665) with your additional questions). diff --git a/site/content/blog/2020-12-01-whats-new-in-svelte-december-2020.md b/site/content/blog/2020-12-01-whats-new-in-svelte-december-2020.md index 9ccee98a607b..4e0f56e44963 100644 --- a/site/content/blog/2020-12-01-whats-new-in-svelte-december-2020.md +++ b/site/content/blog/2020-12-01-whats-new-in-svelte-december-2020.md @@ -9,18 +9,19 @@ It's the last "What's new in Svelte" of the year and there's lots to celebrate! ## New features & impactful bug fixes -1. `$$props`, `$$restProps`, and `$$slots` are all now supported in custom web components (**3.29.5**, [Example](https://svelte.dev/repl/ad8e6f39cd20403dacd1be84d71e498d?version=3.29.5)) and `slot` components now support spread props: `` (**3.30.0**) +1. `$$props`, `$$restProps`, and `$$slots` are all now supported in custom web components (**3.29.5**, [Example](https://svelte.dev/repl/ad8e6f39cd20403dacd1be84d71e498d?version=3.29.5)) and `slot` components now support spread props: `` (**3.30.0**) 2. A new `hasContext` lifecycle function makes it easy to check whether a `key` has been set in the context of a parent component (**3.30.0** & **3.30.1**, [Docs](https://svelte.dev/docs#run-time-svelte-hascontext)) 3. There is now a new `SvelteComponentTyped` class which makes it easier to add strongly typed components that extend base Svelte components. Component library and framework authors rejoice! An example: `export class YourComponent extends SvelteComponentTyped<{aProp: boolean}, {click: MouseEvent}, {default: {aSlot: string}}> {}` (**3.31.0**, [RFC](https://github.com/sveltejs/rfcs/pull/37)) 4. Transitions within `{:else}` blocks should now complete successfully (**3.29.5**, [Example](https://svelte.dev/repl/49cef205e5da459594ef2eafcbd41593?version=3.29.5)) 5. Svelte now includes an export map, which explicitly states which files can be imported from its npm package (**3.29.5** with some fixes in **3.29.6**, **3.29.7** and **3.30.0**) 6. `rollup-plugin-svelte` had a new [7.0.0 release](https://github.com/sveltejs/rollup-plugin-svelte/blob/master/CHANGELOG.md). The biggest change is that the `css` option was removed. Users who were using that option should add another plugin like `rollup-plugin-css-only` as demonstrated [in the template](https://github.com/sveltejs/template/blob/5b1135c286f7a649daa99825a077586655051649/rollup.config.js#L48) - ## What's going on in Sapper? + Lots of new TypeScript definition improvements to make editing Sapper apps even easier! CSS for dynamic imports also should now work in `client.js` files. (Unreleased) ## What's the deal with SvelteKit? + We're glad you asked! If you didn't catch Rich's blog post from early last month, [you can find it here](https://svelte.dev/blog/whats-the-deal-with-sveltekit)! For all the features and bugfixes see the CHANGELOGs for [Svelte](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md) and [Sapper](https://github.com/sveltejs/sapper/blob/master/CHANGELOG.md). @@ -30,6 +31,7 @@ For all the features and bugfixes see the CHANGELOGs for [Svelte](https://github ## Community Showcase **Apps & Sites** + - [narration.studio](https://narration.studio/) (Chrome Only) is an automatic in-browser audio recording & editing platform for voice over narration. - [Vippet](https://vippet.netlify.app/) is a video recording and editing tool for the browser. - [Pattern Monster](https://pattern.monster/) is a simple online pattern generator to create repeatable SVG patterns. @@ -39,19 +41,21 @@ For all the features and bugfixes see the CHANGELOGs for [Svelte](https://github - [svelte-presenter](https://github.com/stephane-vanraes/svelte-presenter) lets you quickly make good looking presentations using Svelte and mdsvex. **Demos** + - [u/loopcake got SSR working in Java Spring Boot](https://www.reddit.com/r/sveltejs/comments/jkh5up/svelte_ssr_but_its_java_spring_boot_and_its_native/) for all the Java shops out there looking to render Svelte server-side. - [svelte-liquid-swipe](https://github.com/tncrazvan/svelte-liquid-swipe) shows off a fancy interaction pattern using svg paths. - [Crossfade Link Animation](https://svelte.dev/repl/7f68e148caf04b2787bb6f296208f870?version=3.29.7) demonstrates how to animate between navigation links using a crossfade (made by Blu, from the Discord community) - [Clip-Path Transitions](https://svelte.dev/repl/b5ad281ae8024b629b545c70c9e8764d?version=3.29.7) showcases how to use clip paths and custom transitions to create magical in-and-out transitions (made by Faber, from the Discord community) **Learning Resources** + - [lihautan](https://www.youtube.com/channel/UCbmC3HP3FaAFdcZkui8YoMQ/featured) has been making easy-to-follow videos to share his in-depth knowledge of Svelte. - [Lessons From Building a Static Site Generator](https://nicholasreese.com/lessons-from-building-a-static-site-generator/) shares the backstory and thinking behind Elder.js - and the design decision made along the way. - [Svelte Tutorial and Projects Course ](https://www.udemy.com/course/svelte-tutorial-and-projects-course/) is a udemy course by John Smilga where students learn Svelte.js by building interesting projects. - [Building Pastebin on IPFS - with FastAPI, Svelte, and IPFS](https://amalshaji.wtf/building-pastebin-on-ipfs-with-fastapi-svelte-and-ipfs) explains how to make a distributed pastebin-like application. - **Components, Libraries & Tools** + - [svelte-crossword](https://russellgoldenberg.github.io/svelte-crossword/) is a customizable crossword puzzle component for Svelte. - [svelte-cloudinary](https://github.com/cupcakearmy/svelte-cloudinary) makes it easy to integrate Cloudinary with Svelte (including TypeScript and SSR support) - [Svelte Nova](https://extensions.panic.com/extensions/sb.lao/sb.lao.svelte-nova/) extends the new Nova editor to support Svelte diff --git a/site/content/blog/2021-01-01-whats-new-in-svelte-january-2021.md b/site/content/blog/2021-01-01-whats-new-in-svelte-january-2021.md index 8597e2ae9dc4..675d809fec0b 100644 --- a/site/content/blog/2021-01-01-whats-new-in-svelte-january-2021.md +++ b/site/content/blog/2021-01-01-whats-new-in-svelte-january-2021.md @@ -13,14 +13,12 @@ A new minor release replaces the `SvelteComponent` class with a `SvelteComponent If you're using `SvelteComponent` or the new `SvelteComponentTyped` in your project or library, let us know what you're using it for and we'll add it to the showcase! - ## What's going on in Sapper? More quality of life features are landing in the upcoming release every day. `0.29.0` will include new TypeScript definitions, fixes to scroll tracking and prefetching behavior, and improvements to the runtime router to support encoded query parameters. If you're upgrading from 0.28.x, check out [the migration guide](https://sapper.svelte.dev/migrating/#0_28_to_0_29) for steps on updating to Sapper 0.29. - ## Is SvelteKit ready yet? To avoid too much churn during development, SvelteKit is still being worked on in a private repo. There will be an announcement on the Discord, blog and Twitter when it's ready for a larger group of users and contributors. @@ -29,7 +27,6 @@ In the meantime, you can explore the current build by running `npm init svelte@n As cautioned in _[What's the deal with SvelteKit?](https://svelte.dev/blog/whats-the-deal-with-sveltekit)_, there are no docs or support available yet... So use at your own risk / for your own enjoyment! - --- ## Community Showcase diff --git a/site/content/blog/2021-02-01-whats-new-in-svelte-february-2021.md b/site/content/blog/2021-02-01-whats-new-in-svelte-february-2021.md index d70de4e0eb0a..9b5a5eec4c7c 100644 --- a/site/content/blog/2021-02-01-whats-new-in-svelte-february-2021.md +++ b/site/content/blog/2021-02-01-whats-new-in-svelte-february-2021.md @@ -8,12 +8,12 @@ authorURL: https://dreamindani.com With the shortest month of the year coming up, Svelte maintainers and community members alike have been busy this last month – from big changes in `svelte-loader`, `prettier-plugin-svelte`, `rollup-plugin-svelte`, and `language-tools` to steady progress in Sapper and `svelte-preprocess`. Meanwhile, lots of folks have been busy integrating Svelte with other popular frameworks. ## New compiler features + - Aria roles from the [WAI-ARIA Graphics Module](https://www.w3.org/TR/graphics-aria-1.0/#role_definitions) are now recognized as valid aria roles in Svelte components (**3.31.1**) - Compiler warnings for the common React attributes, `className` and `htmlFor`, now make it easier to port React components to Svelte (**3.31.1**) Have a suggestion for a compiler feature or want to help implement new features/bug fixes? Check out the ["triage: good first issue" tag for Svelte](https://github.com/sveltejs/svelte/issues?q=is%3Aopen+is%3Aissue+label%3A%22triage%3A+good+first+issue%22) - ## New bits in language-tools - User disabled auto import suggestions no longer show in VS Code (**103.0.0**) @@ -34,7 +34,7 @@ A great way to try the language tools is to download the [Svelte Extension for V - [Sapper](https://github.com/sveltejs/sapper) got some improvements in scroll tracking and handling encoding query parameters. Dynamic imports also now work as expected in browsers that don't support ES modules. These changes from 0.29.0 and a step-by-step migration guide can be found [in the changelog](https://github.com/sveltejs/sapper/blob/master/CHANGELOG.md) - [prettier-plugin-svelte](https://github.com/sveltejs/prettier-plugin-svelte) version 2 was released. It received an overhaul and comes with a rewrite of the HTML formatting. The output is now much more in line with how standard Prettier formats HTML. Better defaults for `svelteBracketNewLine` and `options-scripts-markup-styles` should now match how the majority of users like to order the code blocks. Additionally, Prettier's `htmlWhitespaceSensitivity` setting is now supported. [More info in the changelog](https://github.com/sveltejs/prettier-plugin-svelte/blob/master/CHANGELOG.md) -New changes to the Svelte Society website include [a new cheat sheet](https://sveltesociety.dev/cheatsheet) for easy access to useful code patterns and some smaller visual fixes across the site. **Want to help make the Svelte Society website ready for prime time**? [Checkout the GitHub repo](https://github.com/svelte-society/sveltesociety.dev) to get started! +New changes to the Svelte Society website include [a new cheat sheet](https://sveltesociety.dev/cheatsheet) for easy access to useful code patterns and some smaller visual fixes across the site. **Want to help make the Svelte Society website ready for prime time**? [Checkout the GitHub repo](https://github.com/svelte-society/sveltesociety.dev) to get started! --- @@ -47,7 +47,6 @@ New changes to the Svelte Society website include [a new cheat sheet](https://sv - [sho.rest](https://github.com/Melonai/shorest) is a self-hostable url shortener - [night.fm](https://night.fm/) is a cyberpunk-themed radio station - **Demos, Libraries & Components** - [Svelte Reactive Debugger](https://addons.mozilla.org/en-US/firefox/addon/svelte-reactive-debugger/) is a way to monitor Svelte reactive statements in Firefox devtools @@ -60,8 +59,8 @@ New changes to the Svelte Society website include [a new cheat sheet](https://sv - [svelte-video-player](https://github.com/meigo/svelte-video-player) is a customizable `VideoPlayer` component - [svelte-readonly](https://github.com/Crisfole/svelte-readonly) is a very small store that exposes only a readable interface. - **New Integrations & Starters** + - [svelte-derver-starter](https://github.com/AlexxNB/svelte-derver-starter) is a starter for baking fullstack application with the client based on Svelte and server side powered by Derver. - [eleventy-plugin-embed-svelte](https://github.com/shalomscott/eleventy-plugin-embed-svelte) makes it easy to embed Svelte components into an 11ty site. - [svelte-tailwind-extension-boilerplate](https://github.com/kyrelldixon/svelte-tailwind-extension-boilerplate) is a good foundation for a Chrome extension using either JavaScript or TypeScript, Svelte for the frontend, Tailwind CSS for styling, Jest for testing, and Rollup as the build system. diff --git a/site/content/blog/2021-03-01-whats-new-in-svelte-march-2021.md b/site/content/blog/2021-03-01-whats-new-in-svelte-march-2021.md index 7a5305c5fc57..46e45a11309e 100644 --- a/site/content/blog/2021-03-01-whats-new-in-svelte-march-2021.md +++ b/site/content/blog/2021-03-01-whats-new-in-svelte-march-2021.md @@ -10,17 +10,17 @@ Lots to cover this month with releases from across the Svelte ecosystem. Most im Let's dive into the news 🐬 ## What's new in `sveltejs/svelte` -* SSR store handling has been reworked to subscribe and unsubscribe as in DOM mode. SSR stores should work much more consistently now (**3.31.2**, see [custom stores](https://svelte.dev/examples/custom-stores) and [Server-side component API ](https://svelte.dev/docs#run-time-server-side-component-api)) -* Multiple instances of the same action are now allowed on an element (**3.32.0**, [example](https://svelte.dev/repl/01a14375951749dab9579cb6860eccde?version=3.32.0)) -* The new `foreign` namespace should make it easier for alternative compile targets (like Svelte Native and SvelteGUI) by disabling certain HTML5-specific behaviour and checks (**3.32.0**, [more info](https://github.com/sveltejs/svelte/pull/5652)) -* Support for inline comment sourcemaps in code from preprocessors (**3.32.0**) -* Destructured defaults are now allowed to refer to other variables (**3.33.0**, [example](https://svelte.dev/repl/0ee7227e1b45465b9b47d7a5ae2d1252?version=3.33.0)) -* Custom elements will now call `onMount` functions when connecting and clean up when disconnecting (**3.33.0**, checkout [this PR](https://github.com/sveltejs/svelte/pull/4522) for an interesting conversation on how folks are using Svelte with Web Components) -* A `cssHash` option has been added to the compiler options to control the classname used for CSS scoping (**3.34.0**, [docs](https://svelte.dev/docs#compile-time-svelte-compile)) -* Continued improvement to TypeScript definitions -For a complete list of changes, including bug fixes and links to PRs, check out [the CHANGELOG](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md) +- SSR store handling has been reworked to subscribe and unsubscribe as in DOM mode. SSR stores should work much more consistently now (**3.31.2**, see [custom stores](https://svelte.dev/examples/custom-stores) and [Server-side component API ](https://svelte.dev/docs#run-time-server-side-component-api)) +- Multiple instances of the same action are now allowed on an element (**3.32.0**, [example](https://svelte.dev/repl/01a14375951749dab9579cb6860eccde?version=3.32.0)) +- The new `foreign` namespace should make it easier for alternative compile targets (like Svelte Native and SvelteGUI) by disabling certain HTML5-specific behaviour and checks (**3.32.0**, [more info](https://github.com/sveltejs/svelte/pull/5652)) +- Support for inline comment sourcemaps in code from preprocessors (**3.32.0**) +- Destructured defaults are now allowed to refer to other variables (**3.33.0**, [example](https://svelte.dev/repl/0ee7227e1b45465b9b47d7a5ae2d1252?version=3.33.0)) +- Custom elements will now call `onMount` functions when connecting and clean up when disconnecting (**3.33.0**, checkout [this PR](https://github.com/sveltejs/svelte/pull/4522) for an interesting conversation on how folks are using Svelte with Web Components) +- A `cssHash` option has been added to the compiler options to control the classname used for CSS scoping (**3.34.0**, [docs](https://svelte.dev/docs#compile-time-svelte-compile)) +- Continued improvement to TypeScript definitions +For a complete list of changes, including bug fixes and links to PRs, check out [the CHANGELOG](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md) ## New from `sveltejs/language-tools` @@ -45,7 +45,7 @@ Haven't tried the language-tools yet? Check out [Svelte Extension for VSCode](ht **Apps & Sites** - [Tracking the Coronavirus](https://www.nytimes.com/interactive/2021/us/new-york-city-new-york-covid-cases.html) from NYTimes is an example of SvelteKit in production -- [Budibase](https://github.com/Budibase/budibase) is an open-source low-code platform, helping developers and IT professionals build, automate, and ship internal tools 50x faster on their own infrastructure. +- [Budibase](https://github.com/Budibase/budibase) is an open-source low-code platform, helping developers and IT professionals build, automate, and ship internal tools 50x faster on their own infrastructure. - [Track the Parcel](https://tracktheparcel.com/) is a one-stop tool for tracking parcel status with all major package shippers. - [Memo](https://sendmemo.app/features/) is a replacement for email that uses Svelte for modern messaging - [Userscripts Safari](https://github.com/quoid/userscripts) is an open-source userscript editor for Safari... a native Svelte app for Mac OS! @@ -61,8 +61,6 @@ Haven't tried the language-tools yet? Check out [Svelte Extension for VSCode](ht - [weatherify](https://brdtheo-weatherify.netlify.app/) is a very pretty (and [open source](https://github.com/brdtheo/weatherify)) weather app - [DSN Live](https://dsn-live.netlify.app/#/) lets you monitor connections between NASA/JPL and interplanetary spacecraft missions in real time. - - **Demos, Libraries, Tools & Components** - [spc](https://github.com/khang-nd/spc) is a special characters picker component for the web @@ -86,7 +84,6 @@ Haven't tried the language-tools yet? Check out [Svelte Extension for VSCode](ht **Have your own Svelte Component to share?** Check out the [Components](https://sveltesociety.dev/components) page on the Svelte Society site. You can contribute by making [a PR to this file](https://github.com/svelte-society/sveltesociety.dev/blob/master/src/pages/components/components.json). - **Learning Resources & Starters** - [The **unofficial** SvelteKit docs](https://sk-incognito.vercel.app/learn/what-is-sveltekit) were built using SvelteKit and are [open for contributions](https://github.com/GrygrFlzr/kit-docs) diff --git a/site/content/blog/2021-03-23-sveltekit-beta.md b/site/content/blog/2021-03-23-sveltekit-beta.md index 59cc2c4833d6..e778fbd02051 100644 --- a/site/content/blog/2021-03-23-sveltekit-beta.md +++ b/site/content/blog/2021-03-23-sveltekit-beta.md @@ -28,7 +28,6 @@ You'll find documentation at [kit.svelte.dev/docs](https://kit.svelte.dev/docs). The source code is available at [github.com/sveltejs/kit](https://github.com/sveltejs/kit). Issues and pull requests are disabled while we finish getting our house in order, but we'll be making it fully open in the near future. - ## Wait, what is SvelteKit? Think of it as [Next](https://nextjs.org/) for Svelte. It's a framework for building apps with Svelte, complete with server-side rendering, routing, code-splitting for JS and CSS, adapters for different serverless platforms and so on. @@ -45,7 +44,6 @@ Vite falls into the same category as Snowpack. While Vite 1 wasn't suitable for We owe a deep debt of gratitude to the Snowpack team, both for the close collaboration earlier in development and for lighting the path that web development will take over the next few years. It's a wonderful tool, and you should absolutely try it out. - ## Dogfooding as extreme sport SvelteKit is very much in beta, but that doesn't mean it hasn't been used in production. diff --git a/site/content/blog/2021-04-01-whats-new-in-svelte-april-2021.md b/site/content/blog/2021-04-01-whats-new-in-svelte-april-2021.md index c204b0f5adfa..4c9a12238510 100644 --- a/site/content/blog/2021-04-01-whats-new-in-svelte-april-2021.md +++ b/site/content/blog/2021-04-01-whats-new-in-svelte-april-2021.md @@ -8,11 +8,13 @@ authorURL: https://dreamindani.com Two projects that have been months (even years) in the making have made their way out into the world. SvelteKit is now in public beta and slotted components are now available in Svelte! ## What's up with SvelteKit? + [SvelteKit](https://kit.svelte.dev/) - Svelte's versatile framework for building SSR, serverless applications, or SPAs - is now officially in public beta. Expect bugs! Lots more detail in the [latest blog post](https://svelte.dev/blog/sveltekit-beta). Want to know when 1.0 is close? Check out the milestone on [github](https://github.com/sveltejs/kit/milestone/2). Want to learn more about how to get started, what's different compared to Sapper, new features and migration paths? Check out this week's [episode of Svelte Radio](https://www.svelteradio.com/episodes/svelte-kit-public-beta) for a deep dive with Antony, Kev and Swyx. ## New in Svelte & Language Tools + - Slotted components, including `` lets component consumers target specific slots with rich content (**Svelte 3.35.0, Language Tools [104.5.0](https://github.com/sveltejs/language-tools/releases/tag/extensions-104.5.0)**, check out the [docs](https://svelte.dev/docs#template-syntax-svelte-fragment) and the [tutorial](https://svelte.dev/tutorial/svelte-fragment)) - Linked editing now works for HTML in Svelte files (**Language Tools, [104.6.0](https://github.com/sveltejs/language-tools/releases/tag/extensions-104.6.0)**) - Type definitions `svelte.d.ts` are now resolved in order, allowing library authors to ship type definitions with their svelte components (**Language Tools, [104.7.0](https://github.com/sveltejs/language-tools/releases/tag/extensions-104.7.0)**) @@ -32,7 +34,6 @@ Want to learn more about how to get started, what's different compared to Sapper - [Svelte Game of Life](https://github.com/alanrsoares/svelte-game-of-life) is an educational implementation of Conway's Game of Life in TypeScript + Svelte - [foxql](https://github.com/foxql) is a peer to peer full text search engine that runs on your browser. - **Demos, Libraries, Tools & Components** - [svelte-nodegui](https://github.com/nodegui/svelte-nodegui) is a way to build performant, native and cross-platform desktop applications with Node.js and Svelte @@ -46,17 +47,16 @@ Want to learn more about how to get started, what's different compared to Sapper **Want to contribute your own component?** Submit a [Component](https://sveltesociety.dev/components) to the Svelte Society site by making [a PR to this file](https://github.com/svelte-society/sveltesociety.dev/blob/master/src/pages/components/components.json). - **Starters** - [sveltekit-electron](https://github.com/FractalHQ/sveltekit-electron) is a starter kit for Electron using SvelteKit - [sveltekit-tailwindcss-external-api](https://github.com/acidlake/sveltekit-tailwindcss-external-api) is everything you need to build a Svelte project with TailwindCSS and an external API, powered by create-svelte. - [Sapper Netlify](https://www.npmjs.com/package/sapper-netlify) is a Sapper project that can run on a Netlify function. - **Looking for a particular starter?** Check out [svelte-adders](https://github.com/svelte-add/svelte-adders) and a number of other template examples at the community site [sveltesociety.dev](https://sveltesociety.dev/templates/) **Learning Resources** + - [How to Build a Website with Svelte and SvelteKit](https://prismic.io/blog/svelte-sveltekit-tutorial) is a step-by-step tutorial walking through the new SvelteKit setup. - [A Svelte store for prefers-reduced-motion](https://geoffrich.net/posts/svelte-prefers-reduced-motion-store/) demonstrates how to make a custom Svelte store whose value will indicate whether the user has requested reduced motion and improve accessibility. - [TypeScript support in Svelte](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Client-side_JavaScript_frameworks/Svelte_TypeScript) is an MDN guide to using TypeScript in Svelte. @@ -67,7 +67,6 @@ Want to learn more about how to get started, what's different compared to Sapper - [Svelte Store: Reactive context using Svelte Store](https://www.youtube.com/watch?v=-rTnWlbdjoY) is a video answer to the question, "How do we make [a] context value reactive?" - [Creating Social Sharing Images with Cloudinary and Svelte](https://www.youtube.com/watch?v=-Si5o-R7KHY) is a video from Cloudinary that demonstrates how to dynamically develop Open Graph images and Twitter Cards for a JAMstack website. - ## See you next month! Got something to add? Join us on [Svelte Society](https://sveltesociety.dev/), [Reddit](https://www.reddit.com/r/sveltejs/) and [Discord](https://discord.com/invite/yy75DKs)! diff --git a/site/content/blog/2021-05-01-whats-new-in-svelte-may-2021.md b/site/content/blog/2021-05-01-whats-new-in-svelte-may-2021.md index d57227414825..1e176b742191 100644 --- a/site/content/blog/2021-05-01-whats-new-in-svelte-may-2021.md +++ b/site/content/blog/2021-05-01-whats-new-in-svelte-may-2021.md @@ -8,10 +8,12 @@ authorURL: https://dreamindani.com Last week, Svelte Summit blew us away with a mountain of content! [Check out the full recording](https://www.youtube.com/watch?v=fnr9XWvjJHw) or an audio-only (p)review [on Svelte Radio](https://www.svelteradio.com/episodes/svelte-summit-party-episode). Now let's get into this month's news... ## New features in the Svelte Compiler + - `:global()` is now supported as part of compound CSS selectors (**3.38.0**, [Example](https://svelte.dev/repl/54148fd2af484f2c84977c94e523c7c5?version=3.38.0)) - CSS custom properties can now be passed to components for use cases such as theming (**3.38.0**, [Docs coming soon](https://github.com/sveltejs/svelte/issues/6268)) ## New in SvelteKit + - [kit.svelte.dev](https://kit.svelte.dev/) has a fresh new look and the [SvelteKit Demo Site](https://netlify.demo.svelte.dev/) got a fresh set of paint. Check it out by running `npm init svelte@next` - You can now use `@sveltejs/adapter-static` to create a single-page app or SPA by specifying a fallback page ([PR](https://github.com/sveltejs/kit/pull/1181), [Docs](https://github.com/sveltejs/kit/tree/master/packages/adapter-static)) - Disable Server-side Rendering (SSR) app-wide or on a page-by-page basis ([PR](https://github.com/sveltejs/kit/pull/713)) @@ -20,6 +22,7 @@ Last week, Svelte Summit blew us away with a mountain of content! [Check out the - `fetch` in SvelteKit code will now use the environment-provided implementation, whenever possible. If `fetch` is unavailable, it will be polyfilled by adapters ([PR](https://github.com/sveltejs/kit/pull/1066), [Docs](https://kit.svelte.dev/docs/loading#input-fetch)) ## New in Svelte & Language Tools + - `svelte-preprocess` now supports the "extends" field of the tsconfig.json (4.7.2) - HTML `style` attributes now have hover & auto-complete. Foreign namespaces and ESM configs are now supported in the Svelte language server & extensions - The Svelte language tools can now infer slot/event types from their props if a generic relationship between them was defined @@ -39,18 +42,17 @@ Last week, Svelte Summit blew us away with a mountain of content! [Check out the - [Frog Safety](https://frog-safety.vercel.app/) is a guide for African Dwarf Frogs and the API freshwater master kit - [Stardew Valley Character Preview](https://github.com/overscore-media/stardew-valley-character-preview) loads your character's attributes from your Stardew Valley savefile and lets you play around with different outfits, colours, and accessories. - **Demos, Libraries, Tools & Components** - [svelte-parallax](https://github.com/kindoflew/svelte-parallax) is a spring-based parallax component for Svelte - [@svelte-plugins/viewable](https://github.com/svelte-plugins/viewable) is a simple rule-based approach to tracking element viewability. - [Sveltekit-JUI](https://github.com/Wolfr/sveltekit-jui) is a kit of UI components to be used in conjunction with Svelte and Svelte Kit. -- [EZGesture](https://github.com/mhmd-22/ezgesture#integrating-with-other-frameworks) makes it easy to add gestures functionality with simple native DOM events +- [EZGesture](https://github.com/mhmd-22/ezgesture#integrating-with-other-frameworks) makes it easy to add gestures functionality with simple native DOM events **Want to contribute your own component?** Submit a [Component](https://sveltesociety.dev/components) to the Svelte Society site by making [a PR to this file](https://github.com/svelte-society/sveltesociety.dev/blob/master/src/pages/components/components.json). - **Starters** + - [How to use Vercel Analytics with SvelteKit](https://ivoberger.com/posts/using-vercel-analytics-with-svelte-kit) teaches how to track Web Vitals across your users' devices - [Asp.NETCore + Svelte + Vite](https://github.com/Kiho/aspcore-spa-cli/tree/master/samples/SviteSample) connects the three frameworks with SpaCliMiddleware (VS2019) - [Add CoffeeScript to Svelte](https://github.com/Leftium/coffeescript-adder) is an experimental command to run to add CoffeeScript to your SvelteKit project or Vite-powered Svelte app @@ -59,8 +61,8 @@ Last week, Svelte Summit blew us away with a mountain of content! [Check out the **Looking for a starter or integration?** Check out [svelte-adders](https://github.com/svelte-add/svelte-adders) and a number of other template examples at the community site [sveltesociety.dev](https://sveltesociety.dev/templates) - **Learning Resources** + - [Amazing macOS Dock animation in Svelte](https://dev.to/puruvj/amazing-macos-dock-animation-in-svelte-5hfb) demonstrates how nice Svelte and popmotion look together - [Solving the Tower of Hanoi with recursive Svelte templates](https://geoffrich.net/posts/svelte-tower-of-hanoi/) incorporates the `` element into a common computer science problem - [DIY SvelteKit CDK adapter](https://dev.to/juranki/diy-sveltekit-cdk-adapter-3enp) puts together SvelteKit and AWS CDK @@ -69,8 +71,6 @@ Last week, Svelte Summit blew us away with a mountain of content! [Check out the - lihautan's latest video updates in the [Svelte 101](https://www.youtube.com/watch?v=rwYgOU0WmVk&list=PLoKaNN3BjQX3mxDEVG3oGJx2ByXnue_gR&index=59) and [Svelte Store](https://www.youtube.com/watch?v=p4GmT0trCPE&list=PLoKaNN3BjQX3fG-XOSwsPHtnV8FUY6lgK&index=19) playlists cover slots, stores and context - and when to use which - [DavidParkerW](https://www.youtube.com/c/DavidParkerW/playlists) has been exploring Svelte, Sapper and SvelteKit in some real-world scenarios, like [displaying a blog post list from an API](https://www.youtube.com/watch?v=kAPVFgFnxaM&list=PLPqKsyEGhUna6cvm6d4vZNI6gbt_0S4Xx&index=15) - - ## See you next month! Got something to add? Join us on [Svelte Society](https://sveltesociety.dev/), [Reddit](https://www.reddit.com/r/sveltejs/) and [Discord](https://discord.com/invite/yy75DKs)! diff --git a/site/content/blog/2021-06-01-whats-new-in-svelte-june-2021.md b/site/content/blog/2021-06-01-whats-new-in-svelte-june-2021.md index 3177708d3aa7..cf05ef09fe9b 100644 --- a/site/content/blog/2021-06-01-whats-new-in-svelte-june-2021.md +++ b/site/content/blog/2021-06-01-whats-new-in-svelte-june-2021.md @@ -8,25 +8,26 @@ authorURL: https://dreamindani.com This month, we saw lots of contributions to SvelteKit and its docs. The language tools also got some new features, most notably deeper integration with Svelte files within JavaScript or TypeScript files. Let's jump into the updates... ## New in SvelteKit + - `svelte.config.js` config files are now loaded in ESM format (`.js` instead of `.cjs`). - AMP pages will now use the rendered CSS, rather than emitted CSS -- `svelte-check` has been added to the TypeScript template ([sveltejs/kit#1556](https://github.com/sveltejs/kit/pull/1556)) -- Support for https keypair [sveltejs/kit#1456](https://github.com/sveltejs/kit/pull/1456) -- Now bundling Vite with SvelteKit and using an upgraded version. Remove Vite from your `package.json` if it's there -- Etags for binary responses [sveltejs/kit#1382](https://github.com/sveltejs/kit/pull/1382) -- Renamed `$layout` to `__layout` and `$error` to `__error` -- Removed `getContext` in favor of `request.locals` +- `svelte-check` has been added to the TypeScript template ([sveltejs/kit#1556](https://github.com/sveltejs/kit/pull/1556)) +- Support for https keypair [sveltejs/kit#1456](https://github.com/sveltejs/kit/pull/1456) +- Now bundling Vite with SvelteKit and using an upgraded version. Remove Vite from your `package.json` if it's there +- Etags for binary responses [sveltejs/kit#1382](https://github.com/sveltejs/kit/pull/1382) +- Renamed `$layout` to `__layout` and `$error` to `__error` +- Removed `getContext` in favor of `request.locals` - Renamed `.svelte` output directory to `.svelte-kit`. Update your `.gitignore` accordingly - `trailingSlash: 'never' | 'always' | 'ignore'` is now available in the config. This should make it easier to build sites that work with static hosting providers that expect a trailing slash for `index.html` pages, and provides an escape hatch for anyone that needs more complex behaviour. ## Notable bug fixes in SvelteKit -- `adapter-netlify` got a fix [sveltejs/kit#1467](https://github.com/sveltejs/kit/pull/1467) and new documentation in the readme https://github.com/sveltejs/kit/tree/master/packages/adapter-netlify + +- `adapter-netlify` got a fix [sveltejs/kit#1467](https://github.com/sveltejs/kit/pull/1467) and new documentation in the readme https://github.com/sveltejs/kit/tree/master/packages/adapter-netlify - The router will no longer intercept navigation for URLs that the app does not own. This fixes a crash for apps that have `` elements on the page with the same origin but don't share a base path with the app. - Hash only changes are now handled by the router fixing the browser's "back" navigation between hash changes in some circumstances. - - ## New in Svelte & Language Tools + - Svelte 3.38.1 and 3.38.2 fixed an issue with hydration that was causing duplicate elements. If you're seeing this in your project, be sure to update the latest version! - A new TypeScript plugin provides deeper integration with Svelte files within JavaScript or TypeScript files. This includes diagnostics, references and renaming of variables. It comes packaged with the VS Code extension but is turned off by default for now. You can enable it through [this setting](https://github.com/sveltejs/language-tools/tree/master/packages/svelte-vscode#svelteenable-ts-plugin). We encourage you to test it out and [provide feedback](https://github.com/sveltejs/language-tools/issues/580) - In the latest version of `svelte-check` you can now provide the path to your `tsconfig.json` or `jsconfig.json`. Example: `svelte-check --tsconfig "./tsconfig.json"`. This ensures the diagnostics are only run on files that are referenced in that config. It also runs diagnostics on JavaScript and/or TypeScript files which removes the need to run another check (like `tsc --noEmit`) for non-Svelte files (`svelte-check` version [**1.6.0**](https://github.com/sveltejs/language-tools/releases/tag/svelte-check-1.6.0)) @@ -46,7 +47,6 @@ This month, we saw lots of contributions to SvelteKit and its docs. The language - [Greedy Goblin](https://greedygoblin-fe11c.web.app/) is a recipe app for old-school Runescape players. - [hashbrown.geopjr.dev](https://hashbrown.geopjr.dev/) is a GNOME-shell inspired webpage to learn about, explore the source code and download the Hashbrown GTK app ([link to source](https://github.com/GeopJr/Hashbrown/tree/website)). - **Libraries, Tools & Components** - [svelte-image-crop](https://novacbn.github.io/svelte-image-crop/) is a simple click'n'drag image cropping library using Web APIs. @@ -56,10 +56,8 @@ This month, we saw lots of contributions to SvelteKit and its docs. The language - [svelte-entity-store](https://www.npmjs.com/package/svelte-entity-store) is to provide a simple, generic solution for storing collections of entity objects. - [svelte-animation-store](https://github.com/joshnuss/svelte-animation-store) is a store that is based on Svelte's tweened store, that lets you pause, continue, reset, replay, reverse or adjust speed of a tween. - **Want to contribute a component?** Submit a [Component](https://sveltesociety.dev/components) to the Svelte Society site by making [a PR to this file](https://github.com/svelte-society/sveltesociety.dev/blob/master/src/pages/components/components.json). - ## See you next month! Did we miss something? Join us on [Svelte Society](https://sveltesociety.dev/), [Reddit](https://www.reddit.com/r/sveltejs/) and [Discord](https://discord.com/invite/yy75DKs)! diff --git a/site/content/blog/2021-07-01-whats-new-in-svelte-july-2021.md b/site/content/blog/2021-07-01-whats-new-in-svelte-july-2021.md index 44d29beb2fb5..023028f0f8ca 100644 --- a/site/content/blog/2021-07-01-whats-new-in-svelte-july-2021.md +++ b/site/content/blog/2021-07-01-whats-new-in-svelte-july-2021.md @@ -8,22 +8,22 @@ authorURL: https://dreamindani.com As the northern hemisphere heats up, Svelte has stayed cool with lots of performance and bug fixes, better TypeScript support, and lots of new components & tools from around the ecosystem. Let's take a peek 👀 ## New in SvelteKit + - `adapter-node` now precompresses assets using gzip & brotli ([#1693](https://github.com/sveltejs/kit/pull/1693)) - Support for TypeScript transpilation has been added to the `svelte-kit package` tooling ([#1633](https://github.com/sveltejs/kit/pull/1633)) - Improved caching defaults in `adapter-node` ([#1416](https://github.com/sveltejs/kit/pull/1416)) - Allow configuring Rollup output options ([#1572](https://github.com/sveltejs/kit/pull/1572)) - Fixed usage of SSL with HMR ([#1517](https://github.com/sveltejs/kit/pull/1517)) +## Features & bug fixes from around svelte/\* - -## Features & bug fixes from around svelte/* - [Svelte 3.38.3](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md#3383) (released June 22) includes a bunch of performance and bug fixes - including hydration optimizations, `this` preservation in bubbled events, and more! - The latest language tools releases added support for prop renaming from outside of a component, PostCSS syntax grammar, and a `.d.ts` output target in `svelte2tsx` which can be used to create type definitions from Svelte files. - Also in language tools, some long-awaited experimental features for enhanced TypeScript support were added - including explicitly typing all possible component events or slots, and using generics. Have a look at [the RFC](https://github.com/sveltejs/rfcs/pull/38) for more details and leave feedback in [this issue](https://github.com/sveltejs/language-tools/issues/442) if you are using it. - `svelte-scroller` got some quality-of-life fixes in 2.0.7 - fixing an initial width bug and updating its `index` more conservatively - ## Coming soon to Svelte + - Constants in markup ([RFC](https://github.com/sveltejs/rfcs/blob/master/text/0000-markup-constants.md)): Adds a new `{@const ...}` tag that defines a local constant ([PR](https://github.com/sveltejs/svelte/pull/6413)) --- @@ -31,12 +31,13 @@ As the northern hemisphere heats up, Svelte has stayed cool with lots of perform ## Community Showcase **Apps & Sites** + - [SvelteThemes](https://sveltethemes.dev/) is a curated list of Svelte themes and templates built using svelte, sveltekit, elderjs, routify etc. - [Beatbump](https://github.com/snuffyDev/Beatbump) is an alternative frontend for YouTube Music created using Svelte/SvelteKit. - [Sveltuir](https://github.com/webspaceadam/sveltuir) is an app help you memorize the guitar fretboard - **Educational Content** + - [Svelte Radio: A Jolly Good Svelte Summer](https://share.transistor.fm/s/60880542) is a conversation about what's new in Svelte and a celebration of Svelte Radio's 1-year anniversary - [Class properties in Svelte](https://navillus.dev/blog/svelte-class-props) is a refresher on the power of `class` for developers switching over to Svelte from React - [Sveltekit Tutorial for Beginners](https://www.youtube.com/playlist?list=PLm_Qt4aKpfKjf77S8UD79Ockhwp_699Ms) is a video playlist for learning SvelteKit by WebJeda @@ -47,8 +48,8 @@ As the northern hemisphere heats up, Svelte has stayed cool with lots of perform - [Render Katex with Svelte from zero to hero](https://www.youtube.com/watch?v=euowJs9CblA) demonstrates how to implement Katex in a Svelte project - [Using Custom Elements in Svelte](https://css-tricks.com/using-custom-elements-in-svelte/) shows some of the quirks to look out for when using custom elements in a Svelte site - **Libraries, Tools & Components** + - [svelte-pipeline](https://github.com/novacbn/svelte-pipeline) provides custom JavaScript contexts and the Svelte Compiler as Svelte Stores, for REPLs, Editors, etc. - [Sveltotron](https://github.com/Salemmous/sveltotron) is an Electron-based app made to inspect your Svelte app - [svelte-qr-reader-writer](https://github.com/pleasemarkdarkly/svelte-qr-reader-writer) is a Svelte component that helps read and write data from QR codes @@ -56,10 +57,8 @@ As the northern hemisphere heats up, Svelte has stayed cool with lots of perform - [svelte-typed-context](https://www.npmjs.com/package/svelte-typed-context) provides an interface which, when provided to `getContext` or `setContext`, allows for stricter types - [svelte-modals](https://svelte-modals.mattjennings.io/) is a simple, flexible, zero-dependency modal manager for Svelte - **Want to contribute a component? Interested in helping make Svelte's presence on the web better?** Submit a Component to the Svelte Society site by making [a PR to this file](https://github.com/svelte-society/sveltesociety-2021/blob/main/src/routes/components/components.json) or check out [the list of open issues](https://github.com/svelte-society/sveltesociety-2021/issues) if you'd like to contribute to the Svelte Society rewrite in SvelteKit. - ## See you next month! Want more updates? Join us on [Reddit](https://www.reddit.com/r/sveltejs/) or [Discord](https://discord.com/invite/yy75DKs)! diff --git a/site/content/blog/2021-08-01-whats-new-in-svelte-august-2021.md b/site/content/blog/2021-08-01-whats-new-in-svelte-august-2021.md index f3de4edf8b4b..97bd24605fc4 100644 --- a/site/content/blog/2021-08-01-whats-new-in-svelte-august-2021.md +++ b/site/content/blog/2021-08-01-whats-new-in-svelte-august-2021.md @@ -20,6 +20,7 @@ July was the most active month for the Svelte core repo since late 2019 as we re For a full list of features and bug fixes, check out the [Svelte changelog](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md). ## SvelteKit Updates + - `prerender.force` is now `prerender.onError` which lets you fine-tune which errors fail the build and which do not ([#2007](https://github.com/sveltejs/kit/pull/2007)) - esbuild's configuration is now exposed for use with SvelteKit adapters ([#1914](https://github.com/sveltejs/kit/pull/1914)) - Error messages are friendlier now for common config errors ([#1910](https://github.com/sveltejs/kit/pull/1910)) and compiler errors ([#1827](https://github.com/sveltejs/kit/pull/1827)) @@ -30,7 +31,8 @@ For a full list of features and bug fixes, check out the [Svelte changelog](http To see all updates to SvelteKit, check out the [SvelteKit changelog](https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md). -## Features & bug fixes from around svelte/* +## Features & bug fixes from around svelte/\* + - Language Tools now better support the "Workplace Trust" functionality (used in VS Code) - In svelte2tsx, ambient type declarations are now renamed to avoid conflicting declarations in the future. Users are now expected to provide the ambient type definitions themselves - fixing JS output - Sapper released v0.29.2 which fixes regex routes, status codes when requesting a directory, and exports when a user has not provided a `base` tag ([changelog](https://github.com/sveltejs/sapper/blob/master/CHANGELOG.md)) @@ -40,6 +42,7 @@ To see all updates to SvelteKit, check out the [SvelteKit changelog](https://git ## Community Showcase **Apps & Sites** + - [Parsnip](https://www.parsnip.ai/) is a mobile-first, progressive-web-app that helps you to learn to cook at home. Check out the [conversation on Reddit](https://www.reddit.com/r/sveltejs/comments/oearb9/learning_to_cook_at_home_with_parsnip_built/) for all the geeky details. - [Central Bank Digital Currency (CBDC) tracker](https://www.atlanticcouncil.org/cbdctracker/) is a site that keeps track of how countries around the world are adopting digital currencies. - [Svelte Commerce](https://github.com/itswadesh/svelte-commerce) is an advanced frontend platform for eCommerce based on Sveltekit. @@ -48,6 +51,7 @@ To see all updates to SvelteKit, check out the [SvelteKit changelog](https://git **Looking for a Svelte project to work on? Interested in helping make Svelte's presence on the web better?** Check out [the list of open issues](https://github.com/svelte-society/sveltesociety-2021/issues) if you'd like to contribute to the Svelte Society rewrite in SvelteKit. **Educational Content** + - [How I Built a Cross-Platform Desktop Application with Svelte, Redis, and Rust](https://css-tricks.com/how-i-built-a-cross-platform-desktop-application-with-svelte-redis-and-rust/) is a blog post by Luke Edwards, Svelte maintainer and Developer Advocate from Cloudflare. - [How to Create a Blog with SvelteKit and Strapi](https://strapi.io/blog/how-to-create-a-blog-with-svelte-kit-strapi) is a step-by-step tutorial by Aarnav Pai from Strapi - [Sveltekit Markdown Blog](https://www.youtube.com/watch?v=sKKgT0SEioI&list=PLm_Qt4aKpfKgonq1zwaCS6kOD-nbOKx7V) is a YouTube tutorial series by WebJeda. @@ -56,6 +60,7 @@ To see all updates to SvelteKit, check out the [SvelteKit changelog](https://git - [How to add Magic Link to a SvelteKit application](https://magic.link/posts/magic-svelte) is a guide to the popular password-less login pattern. **Libraries, Tools & Components** + - [Svelte-Capacitor](https://github.com/drannex42/svelte-capacitor/) just released v2.0.0 - making it even easier to build hybrid mobile apps for iOS and Android using Svelte and Capacitor with near native performance. - [svelte-remixicon](https://github.com/ABarnob/svelte-remixicon) is an icon library for Svelte based on Remix Icon, consisting of more than 2000 icons. - [SveltePress](https://github.com/GeopJr/SveltePress) is a documentation tool built on top of SvelteKit. @@ -65,7 +70,6 @@ To see all updates to SvelteKit, check out the [SvelteKit changelog](https://git Check out the community site [sveltesociety.dev](https://sveltesociety.dev/templates/) for more templates, adders and adapters from across the Svelte ecosystem. - ## See you next month! Want more updates? Join us on [Reddit](https://www.reddit.com/r/sveltejs/) or [Discord](https://discord.com/invite/yy75DKs)! diff --git a/site/content/blog/2021-09-01-whats-new-in-svelte-september-2021.md b/site/content/blog/2021-09-01-whats-new-in-svelte-september-2021.md index 6a58136e9a5a..1cbffd5baf62 100644 --- a/site/content/blog/2021-09-01-whats-new-in-svelte-september-2021.md +++ b/site/content/blog/2021-09-01-whats-new-in-svelte-september-2021.md @@ -35,12 +35,12 @@ The focus this past month was on continuing to iron out any kinks, with well ove To see all updates to SvelteKit, check out the [SvelteKit changelog](https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md). - --- ## Community Showcase **Apps & Sites** + - [macos-web](https://github.com/PuruVJ/macos-web) by @puruvjdev has been rebuilt with Svelte from the ground up. Check out all the details in this [Twitter thread](https://twitter.com/puruvjdev/status/1426267327687847939) - [Brave Search](https://search.brave.com/) is using Svelte - [exatorrent](https://github.com/varbhat/exatorrent) is a self-hostable, easy-to-use, lightweight and feature-rich torrent client written in Go and Svelte @@ -55,6 +55,7 @@ To see all updates to SvelteKit, check out the [SvelteKit changelog](https://git **Looking for a Svelte project to work on? Interested in helping make Svelte's presence on the web better?** Check out [the list of open issues](https://github.com/svelte-society/sveltesociety-2021/issues) if you'd like to contribute to the Svelte Society rewrite in SvelteKit. **Educational Content** + - [Tauri with Standard Svelte or SvelteKit](https://medium.com/@cazanator/tauri-with-standard-svelte-or-sveltekit-ad7f103c37e7) walks through how to setup Svelte with Tauri, a new light-weight framework for developing cross-platform hybrid desktop applications - [Svelte - Web App Development Reimagined [An Intro to Svelte]](https://www.youtube.com/watch?v=4CGzFwHoD0A&list=PLEx5khR4g7PKSASVAXXiAhkyx02_OeruP) is a great intro talk from the goto; conference - [LevelUpTuts - Even More 5 Things I Like More In Svelte Than React](https://www.youtube.com/watch?v=ISmnG2sIOeM) highlights Svelte's approach to refs (don't need them), meta tags and more @@ -62,6 +63,7 @@ To see all updates to SvelteKit, check out the [SvelteKit changelog](https://git - [Migrating from Sapper to SvelteKit](https://shipbit.de/blog/migrating-from-sapper-to-svelte-kit/) is a review and retrospective of ShipBit's migration from Sapper **Libraries, Tools & Components** + - [svelte-stripe-js](https://github.com/joshnuss/svelte-stripe-js) is everything you need to add Stripe to your Svelte project. 100% SvelteKit compatible - [svelte-steps](https://github.com/shaozi/svelte-steps) is a customizable step component written in Svelte - [simple-optics-module](https://gitlab.com/Samzelot/simple-optics-module) is an online open source optics tool for experimenting and teaching geometrical optics @@ -77,7 +79,6 @@ To see all updates to SvelteKit, check out the [SvelteKit changelog](https://git Check out the community site [sveltesociety.dev](https://sveltesociety.dev/templates/) for more templates, adders and adapters from across the Svelte ecosystem. - ## See you next month! Want more updates? Join us on [Reddit](https://www.reddit.com/r/sveltejs/) or [Discord](https://discord.com/invite/yy75DKs)! diff --git a/site/content/blog/2021-10-01-whats-new-in-svelte-october-2021.md b/site/content/blog/2021-10-01-whats-new-in-svelte-october-2021.md index 51faa08a7374..c3611c255296 100644 --- a/site/content/blog/2021-10-01-whats-new-in-svelte-october-2021.md +++ b/site/content/blog/2021-10-01-whats-new-in-svelte-october-2021.md @@ -21,7 +21,7 @@ For a full list of features and bug fixes, check out the [Svelte changelog](http ## SvelteKit Updates -Nearly 100 PRs committed again this past month, but there's still lots to do and Svelte maintainers are [looking for help getting SvelteKit to 1.0](https://github.com/sveltejs/kit/issues/2100). Antony said it well in a [recent comment](https://github.com/sveltejs/kit/issues/2100#issuecomment-895446285) on the issue: +Nearly 100 PRs committed again this past month, but there's still lots to do and Svelte maintainers are [looking for help getting SvelteKit to 1.0](https://github.com/sveltejs/kit/issues/2100). Antony said it well in a [recent comment](https://github.com/sveltejs/kit/issues/2100#issuecomment-895446285) on the issue: > If you think you are too n00b to contribute (you're not), then add tests, or write tests for the feature you want to add, before you add it! Start small, and learn the codebase that way. @@ -41,22 +41,23 @@ Notable SvelteKit improvements this month include... To see all updates to SvelteKit, check out the [SvelteKit changelog](https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md). - --- ## Community Showcase **Apps & Sites** + - [radiofrance](https://www.radiofrance.fr/) just migrated their website to SvelteKit - [FLAYKS](https://flayks.com/) is the portfolio site for Félix Péault made with SvelteKit, Sanity, and Anime.js - [hirehive](https://www.hirehive.com/) is a candidate and job tracking site -- [Microsocial](https://microsocial.xyz/) is an experimental Peer-to-Peer Social Platform +- [Microsocial](https://microsocial.xyz/) is an experimental Peer-to-Peer Social Platform - [Dylan Ipsum](https://www.dylanlyrics.app/) is a random text generator to replace lorem ipsum with Bob Dylan lyrics - [Chip8 Svelte](https://github.com/mikeyhogarth/chip8-svelte) is a CHIP-8 emulator frontend, built on top of CHIP8 TypeScript **Looking for a Svelte project to work on? Interested in helping make Svelte's presence on the web better?** Check out [the list of open issues](https://github.com/svelte-society/sveltesociety-2021/issues) if you'd like to contribute to the Svelte Society rewrite in SvelteKit. **Podcasts Featuring Svelte** + - [Syntax Podcast: From React to SvelteKit](https://podcasts.apple.com/us/podcast/from-react-to-sveltekit/id1253186678?i=1000536276106) Scott talks with Wes about moving Level Up Tutorials from React to SvelteKit — why he did it, how, benefits, things to watch out for, and more! - [Web Rush Podcast: Svelte Tools and Svelte Society](https://www.webrush.io/episodes/episode-150-svelte-tools-and-svelte-society) Kevin Åberg Kultalahti talks about what Svelte Society is, what he's excited about with Svelte, how important documentation is to any product, and much _much_ more - [Svelte: The Compiled Future of Front End](https://www.arahansen.com/the-compiled-future-of-front-end/) details the history of component-based frontends and how a compiler changes everything @@ -65,6 +66,7 @@ To see all updates to SvelteKit, check out the [SvelteKit changelog](https://git - [JS Party: 1Password](https://twitter.com/geoffrich_/status/1441816829853253640?s=20) mentioned on the latest episode of The Changelog's JS Party that they use Svelte to power their in-page suggestions **Educational Content** + - [How I built a blog with Svelte and SvelteKit](https://fantinel.dev/blog-development-sveltekit/) is an introduction to Svelte, SvelteKit and Progressive Enhancement with code examples - [I built a decentralized chat dapp](https://www.youtube.com/watch?v=J5x3OMXjgMc) is a tutorial on how to use popular web3 technologies like GUN to build a decentralized web app (dapp) - [Writing a Svelte Store with TypeScript](https://javascript.plainenglish.io/writing-a-svelte-store-with-typescript-22fa1c901a4) is a deep dive into writing Svelte stores with TypeScript @@ -73,8 +75,9 @@ To see all updates to SvelteKit, check out the [SvelteKit changelog](https://git - [An early look at SvelteKit](https://www.infoworld.com/article/3630395/an-early-look-at-sveltekit.html) is a post from Infoworld walking through the features and onboarding of SvelteKit **Libraries, Tools & Components** + - [sveltekit-netlify-cms](https://github.com/buhrmi/sveltekit-netlify-cms) is a SvelteKit skeleton app configured for use with Netlify CMS -- [SvelteFireTS](https://github.com/jacobbowdoin/sveltefirets) is a SvelteKit + TypeScript + Firebase library inspired by Fireship.io +- [SvelteFireTS](https://github.com/jacobbowdoin/sveltefirets) is a SvelteKit + TypeScript + Firebase library inspired by Fireship.io - [stores-x](https://github.com/Anyass3/stores-x) lets you use Svelte stores just like vueX - [sveltekit-snippets](https://github.com/stordahl/sveltekit-snippets) is a VSCode extension that provides snippets for common patterns in SvelteKit & Vanilla Svelte - [svelte-xactor](https://github.com/wobsoriano/svelte-xactor) is a middleware that allows you to easily convert your xactor machines into a global store that implements the store contract @@ -86,10 +89,8 @@ To see all updates to SvelteKit, check out the [SvelteKit changelog](https://git - [focus-svelte](https://github.com/chanced/focus-svelte) is a focus trap for Svelte with zero dependencies - [filedrop-svelte](https://github.com/chanced/filedrop-svelte) is a file dropzone action & component for Svelte - Check out the community site [sveltesociety.dev](https://sveltesociety.dev/templates/) for more templates, adders and adapters from across the Svelte ecosystem. - ## Before you go, answer the call for speakers! Svelte Summit Fall 2021 (happening 20 November 2021) is looking for speakers. Submit your talk proposal before 30 October... all are welcome to present and attend. diff --git a/site/content/blog/2021-11-01-whats-new-in-svelte-november-2021.md b/site/content/blog/2021-11-01-whats-new-in-svelte-november-2021.md index ebe1cfb763ab..2ac151af8548 100644 --- a/site/content/blog/2021-11-01-whats-new-in-svelte-november-2021.md +++ b/site/content/blog/2021-11-01-whats-new-in-svelte-november-2021.md @@ -12,6 +12,7 @@ Also, don't miss out on [Svelte Summit](https://sveltesummit.com/) on November 2 Now onto what's new! ## New in Svelte and SvelteKit + - [svelte.dev](https://svelte.dev/) now runs on SvelteKit alongside [sveltesociety.dev](https://sveltesociety.dev). svelte.dev is a relatively complicated site with live code editing, authentication, and a markdown-based blog - making it a great way for us to really test out SvelteKit - A new compiler option, `enableSourcemap`, provides more control over the compiler output for JS and CSS sourcemaps (**3.44.0**). With this new feature, SvelteKit and the Vite Svelte plugin can now properly handle environment variables in `.svelte` templates (See [sveltejs/kit#720](https://github.com/sveltejs/kit/issues/720) and [sveltejs/vite-plugin-svelte#201](https://github.com/sveltejs/vite-plugin-svelte/pull/201)) - The Svelte Language Tools now support reading the configuration of the VS Code CSS settings ([#1219](https://github.com/sveltejs/language-tools/issues/1219)) @@ -20,15 +21,14 @@ Now onto what's new! - SvelteKit no longer supports Node 12 ([2604](https://github.com/sveltejs/kit/pull/2604)) - SvelteKit was upgraded from Vite 2.6.0 to Vite 2.6.12 fixing an issue where Vite would corrupt the Svelte runtime (https://github.com/vitejs/vite/issues/4306). It also included two fixes from the SvelteKit team to avoid or make diagnosing Vite issues in SvelteKit templates easier (https://github.com/vitejs/vite/pull/5192 and https://github.com/vitejs/vite/pull/5193). Vite 2.7 is currently available in beta with additional fixes for SSR - To see all updates to Svelte and SvelteKit, check out the [Svelte](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md) and [SvelteKit changelog](https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md), respectively. - --- ## Community Showcase **Apps & Sites** + - [Tangent](http://tangentnotes.com/) is a clean and powerful notes app for Mac & Windows - [The Pudding](https://pudding.cool/) is a digital publication that explains ideas debated in culture with visual essays - rebuilt in SvelteKit - [Power Switcher](https://powerswitcher.axpo.com/) is an interactive overview of the development of the power supply in Switzerland, as energy sources migrate to cleaner sources @@ -44,6 +44,7 @@ To see all updates to Svelte and SvelteKit, check out the [Svelte](https://githu - [Palitra App](https://palitra.app/) is a search-based color palette generator **Podcasts Featuring Svelte** + - [Svelte Radio](https://www.svelteradio.com/episodes/svelte-summit-is-coming-up-and-svelte-is-growing) dives into the tech behind the recently released Svelte Summit website and a bunch of other fun stuff! - [PodRocket](https://podrocket.logrocket.com/rich-harris), LogRocket's podcast, talks Svelte with Rich Harris - [PodRocket also dove deep](https://podrocket.logrocket.com/elderjs) into Elder.js with Nick Reese @@ -51,6 +52,7 @@ To see all updates to Svelte and SvelteKit, check out the [Svelte](https://githu - [devtools.fm](https://devtools.fm/episode/15) talks with Rich Harris about developing engaging data visualizations and building the tools of tomorrow **Educational Content** + - [Have Single-Page Apps Ruined the Web?](https://www.youtube.com/watch?v=860d8usGC0o) Rich Harris answers the controversial question at this year's Jamstack Conf - [Svelte vs SvelteKit - What's The Difference?](https://www.youtube.com/watch?v=IKhtnhQKjxQ) LevelUpTuts provides a quick guide to explaining the relationship between the two projects. You can check out the rest of Scott Tolinski's guides to Svelte in his new series, ["Weekly Svelte"](https://www.youtube.com/playlist?list=PLLnpHn493BHF-Onm1MQgKC1psvW-rJuYi) - [WebJeda's SvelteKit Hooks](https://www.youtube.com/watch?v=RarufLoEL08&list=PLm_Qt4aKpfKgzcTiMT2cgWGBDBIPK06DQ) series continues this month with Part 3 - Cookie Session Authentication @@ -61,6 +63,7 @@ To see all updates to Svelte and SvelteKit, check out the [Svelte](https://githu - [What Svelte's accessibility warnings won't tell you](https://geoffrich.net/posts/svelte-a11y-limits/) explains how Svelte's a11y warnings work and why you shouldn't count on them to make your app accessible **Libraries, Tools & Components** + - [svelte-adapter-azure-swa](https://github.com/geoffrich/svelte-adapter-azure-swa) is an adapter for Svelte apps that creates an Azure Static Web App, using an Azure function for dynamic server rendering - [Inlang](https://docs.inlang.dev/getting-started/svelte-kit) is a localization and internationalization toolkit that now supports SvelteKit - [svelte-translate-tools](https://github.com/noelmugnier/svelte-translate-tools) extract/generate/compile translation files for your Svelte App at build time diff --git a/site/content/blog/2021-12-01-whats-new-in-svelte-december-2021.md b/site/content/blog/2021-12-01-whats-new-in-svelte-december-2021.md index 199e20e026de..1f70a7c7e7cd 100644 --- a/site/content/blog/2021-12-01-whats-new-in-svelte-december-2021.md +++ b/site/content/blog/2021-12-01-whats-new-in-svelte-december-2021.md @@ -1,6 +1,6 @@ --- title: "What's new in Svelte: December 2021" -description: "Svelte Summit Fall 2021 Recap, Rich Harris joins Vercel, and Kevin goes full-time on Svelte Society" +description: 'Svelte Summit Fall 2021 Recap, Rich Harris joins Vercel, and Kevin goes full-time on Svelte Society' author: Dani Sandoval authorURL: https://dreamindani.com --- @@ -9,12 +9,12 @@ With SvelteKit getting more and more stable each day, there's not much to cover If you want to dive deep into the last month's worth of bug fixes, check out the [Svelte](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md) and [SvelteKit](https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md) changelogs, respectively. - ## What happened at Svelte Summit? If you missed Svelte Summit, you can watch the entire live stream on [YouTube](https://www.youtube.com/watch?v=1Df-9EKvZr0) and catch a recap in the [#svelte-summit channel on Discord](https://discord.gg/YmHcdnhu). Here are the highlights: + - [Rich Harris](https://twitter.com/rich_harris) took us through a tour of Svelte's history and announced [his move to Vercel](https://vercel.com/blog/vercel-welcomes-rich-harris-creator-of-svelte) - where he will be helping maintain Svelte full-time! ([20:00](https://www.youtube.com/watch?v=1Df-9EKvZr0&t=1200s)) - [Steph Dietz](https://twitter.com/steph_dietz_) explained how Svelte's simple abstractions makes it easy for beginners and experts alike to learn and use JavaScript - without the boilerplate ([29:00](https://www.youtube.com/watch?v=1Df-9EKvZr0&t=1740s)) - [Kevin Bridges](https://twitter.com/kevinast) dove deep into Svelte's reactivity logic by visualizing it through `ReflectiveCounter` and showing how to "fine tune" it, as needed. A full "syllabus" for the presentation is available on [Kevin's site](https://wiibridges.com/presentations/ResponsiveSvelte/). ([42:55](https://www.youtube.com/watch?v=1Df-9EKvZr0&t=2575s)) @@ -38,17 +38,17 @@ Thanks to [Kevin](https://twitter.com/kevmodrome) and all the Svelte Society vol If you have feedback on the Svelte Summit, Kev is [looking for feedback on the Svelte subreddit](https://www.reddit.com/r/sveltejs/comments/qzgo3k/svelte_summit_feedback/) 👀 - --- ## Community Showcase **Apps & Sites** + - [pixeldrain](https://github.com/Fornaxian/pixeldrain_web) is a free-to-use file sharing platform - [LifeHash](http://lifehash.info/) generates beautiful visual hashes from Blockchain Commons - [simple-cloud-music](https://github.com/dufu1991/simple-cloud-music) is a lightweight third-party NetEase cloud music player for modern browsers (likely only works on Chrome) - [palette.rocks](https://palette.rocks/) is a color palette generator with contrast-checking built-in -- [Kadium](https://github.com/probablykasper/kadium) is an app for staying on top of YouTube channel uploads +- [Kadium](https://github.com/probablykasper/kadium) is an app for staying on top of YouTube channel uploads - [Multi-Monitor Calculator](https://multimonitorcalculator.com/) is a tool for planning your multi-monitor setup - [Your Home](https://yourhome.fb.com/) is an interactive overview of Facebook's privacy settings - [Svelte Crush](https://svelte-crush.netlify.app/) is a Candy Crush style match-3 game @@ -56,8 +56,8 @@ If you have feedback on the Svelte Summit, Kev is [looking for feedback on the S **Looking for a Svelte project to work on? Interested in helping make Svelte's presence on the web better?** Check out [the list of open issues](https://github.com/svelte-society/sveltesociety-2021/issues) if you'd like to contribute to the Svelte Society rewrite in SvelteKit. - **Videos, Blogs and Podcasts** + - [How To Make and Publish a Svelte Library](https://www.youtube.com/watch?v=_TymiadmPrc) - [SvelteKit is now fully supported in WebContainers](https://blog.stackblitz.com/posts/sveltekit-supported-in-webcontainers/) - [Introducing Svelte, and Comparing Svelte with React and Vue](https://joshcollinsworth.com/blog/introducing-svelte-comparing-with-react-vue) @@ -72,6 +72,7 @@ If you have feedback on the Svelte Summit, Kev is [looking for feedback on the S - [Building SvelteKit applications with Serverless Redis](https://blog.upstash.com/svelte-with-serverless-redis) **Libraries, Tools & Components** + - [svelte-cubed](https://github.com/Rich-Harris/svelte-cubed) is a Three.js component library for Svelte - created by Rich Harris for his presentation at Svelte Summit Fall 2021 - [svelte-fsm](https://github.com/kenkunz/svelte-fsm) is a tiny, simple, expressive, pragmatic Finite State Machine (FSM) library, optimized for Svelte - [bromb](https://github.com/samuelstroschein/bromb) is a feedback widget for websites/web apps that is small and easy to integration/self-host diff --git a/site/content/blog/2022-01-01-whats-new-in-svelte-january-2022.md b/site/content/blog/2022-01-01-whats-new-in-svelte-january-2022.md index b55d38be6f5f..1e021fa54b2c 100644 --- a/site/content/blog/2022-01-01-whats-new-in-svelte-january-2022.md +++ b/site/content/blog/2022-01-01-whats-new-in-svelte-january-2022.md @@ -1,6 +1,6 @@ --- title: "What's new in Svelte: January 2022" -description: "Faster builds with SvelteKit and a much anticipated REPL feature" +description: 'Faster builds with SvelteKit and a much anticipated REPL feature' author: Dani Sandoval authorURL: https://dreamindani.com --- @@ -8,6 +8,7 @@ authorURL: https://dreamindani.com Happy new year, Svelte Community! Lots to share this month across Svelte, SvelteKit, Language Tools and the Showcase. Thanks to everyone who made 2021 a great year to use Svelte. Looking forward to the next one 🚀 ## What's new in SvelteKit + - `@sveltejs/adapter-static` for SvelteKit now has a `precompress` option to make brotli compression of assets and pages easier to do out of the box ([#3079](https://github.com/sveltejs/kit/pull/3079)) - Concurrency mode in SvelteKit will now prerender pages in parallel ([#3120](https://github.com/sveltejs/kit/pull/3120)). It is enabled by default in `1.0.0-next.205` and later - CSS is now automatically included before JS for improved page performance ([d13efe](https://github.com/sveltejs/kit/commit/d138efe21692f5925f1e89afc0a33f42d6a1a711)) @@ -17,18 +18,18 @@ Happy new year, Svelte Community! Lots to share this month across Svelte, Svelte - After the [update to Vite 2.7](https://github.com/sveltejs/kit/pull/3018), SvelteKit users are [reporting significant performance improvements](https://www.reddit.com/r/sveltejs/comments/rljhfc/sveltekit_massive_compiler_improvement_by/) and loading third-parties libraries in SSR has also been greatly improved - SvelteKit server will now automatically restart when the config files is changed ([vite-plugin-svelte#237](https://github.com/sveltejs/vite-plugin-svelte/pull/237)) - ## Other new bits from `svelte/*` + - [Svelte 3.44.3](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md#3443) is out with a few bug fixes in the binding and loop code - Svelte Language Tools has introduced support for the then/catch shorthands from Svelte 3.41 and TypeScript's "go to" functionality ([105.8.0 and later](https://github.com/sveltejs/language-tools/releases/tag/extensions-105.8.0)) - The Svelte REPL got a nice upgrade as well - letting you delete saved REPLs. Try it out by logging in at [svelte.dev/apps](https://svelte.dev/apps) - --- ## Community Showcase **Apps & Sites** + - [Discover Twitter Spaces](https://github.com/navneetsharmaui/discover-twitter-spaces) is a tool that helps you find the Twitter Spaces - [Modern Fluid Typography Editor](https://github.com/codeAdrian/modern-fluid-typography-editor) helps create beautiful fluid typography using CSS clamp - [Unnwhiteboard](https://github.com/AviKKi/unnwhiteboard) is a job board for companies (or teams) that don't do "whiteboard" interviews @@ -41,10 +42,10 @@ A lot of work this month has gone into migrating the Svelte main website and Sve If you're looking for a fun SvelteKit project to work on, [you can contribute to the Svelte Society site rewrite](https://github.com/svelte-society/sveltesociety-2021/issues) 💅 - **Learning and Listening** _To Read_ + - [Mutating Query Params in SvelteKit Without Page Reloads or Navigations](https://dev.to/mohamadharith/mutating-query-params-in-sveltekit-without-page-reloads-or-navigations-2i2b) by Mohamad Harith - [Svelte for Reactaholics : A guide for React developers](https://www.100ms.live/blog/svelte-guide-for-react-developers) by Puru Vijay - [Svelte's lifecycle methods can be used anywhere](https://geoffrich.net/posts/svelte-lifecycle-examples/) and [The many meanings of $ in Svelte](https://geoffrich.net/posts/svelte-$-meanings/) by Geoff Rich @@ -54,6 +55,7 @@ _To Read_ - [What happened in #Svelte language tools this year](https://twitter.com/dummdidumm_/status/1474158105395179525?t=ytj2K2Q52iD5-lNyLnQaAQ&s=19) by Simon H _To Watch_ + - [The Future of Svelte (Interview with Rich Harris)](https://www.youtube.com/watch?v=uQntFkK8Z54) by Lee Robinson, Director of Developer Relations at Vercel - [Svelte is becoming the go-to framework](https://www.youtube.com/watch?v=fo6BKY2xR2w&t=1834s) for Obsidian plugin developers - [Sveltekit WordPress Headless Blog](https://www.youtube.com/watch?v=c0UDVgjPxFw) by WebJeda @@ -61,10 +63,12 @@ _To Watch_ - [Deploy a full-stack SvelteKit app on Cloudflare Pages](https://www.youtube.com/watch?v=Wc1_U6Dy5Tw) by 1nf _To Listen To_ + - [Syntax podcast: How To Do Things In Svelte](https://podcasts.apple.com/ca/podcast/how-to-do-things-in-svelte/id1253186678?i=1000544796072) - [JS Party #205: So much Sveltey goodness (w/ Rich Harris)](https://changelog.com/jsparty/205) **Libraries, Tools & Components** + - [svelte-headlessui](https://github.com/rgossiaux/svelte-headlessui) is an unofficial, complete Svelte port of the Headless UI component library - [svelte-forms v2](https://chainlist.github.io/svelte-forms/) has been released - the author is [looking for feedback](https://www.reddit.com/r/sveltejs/comments/r6354j/svelteforms_v2_has_been_released/) - [Percival](https://github.com/ekzhang/percival) is a declarative data query and visualization language diff --git a/site/content/blog/2022-01-13-accelerating-sveltes-development.md b/site/content/blog/2022-01-13-accelerating-sveltes-development.md index 7860c2acbc44..db94a5ca2f41 100644 --- a/site/content/blog/2022-01-13-accelerating-sveltes-development.md +++ b/site/content/blog/2022-01-13-accelerating-sveltes-development.md @@ -1,6 +1,6 @@ --- title: "Accelerating Svelte's Development" -description: "Scaling the team, building partnerships, and growing the community" +description: 'Scaling the team, building partnerships, and growing the community' author: Ben McCann authorURL: https://www.benmccann.com/ --- @@ -16,6 +16,7 @@ To help developers build fully-featured applications with Svelte without worryin Rich Harris, Svelte’s creator, has [joined Vercel to work on Svelte full-time](https://vercel.com/blog/vercel-welcomes-rich-harris-creator-of-svelte). We’re incredibly excited to have Rich’s level of involvement in Svelte increase even more and have him steward Svelte into the future. Svelte has been made possible by the work of a large, dedicated community. Svelte has added numerous core maintainers over the course of the pandemic, including three this past week. In alphabetical order: + - [benmccann](https://github.com/benmccann) - primary maintainer of SvelteKit for much of 2021 - [bluwy](https://github.com/bluwy) - major contributor across SvelteKit, vite-plugin-svelte, and Vite - [dominikg](https://github.com/dominikg) - creator of vite-plugin-svelte @@ -42,7 +43,8 @@ We’ve also been working closely with the [Vite](https://vitejs.dev) team to ir [SvelteSociety](https://sveltesociety.dev/) just hosted the [4th Svelte Summit](https://sveltesummit.com/) — [read a summary here](https://svelte.dev/blog/whats-new-in-svelte-december-2021#what-happened-at-svelte-summit) — and Kevin Åberg Kultalahti is [going full-time to lead SvelteSociety](https://twitter.com/kevmodrome/status/1463151477174714373). In addition to hosting Svelte Summit, Kevin and SvelteSociety host and manage the [Svelte Radio podcast](https://www.svelteradio.com/), the [SvelteSociety YouTube channel](https://www.youtube.com/SvelteSociety), and the [Svelte subreddit](https://www.reddit.com/r/sveltejs). SvelteSociety has become the home of all things related to the Svelte community, with the sveltejs/community and sveltejs/integrations repos being retired in favor of [sveltesociety.dev](https://sveltesociety.dev/), which has been redesigned and rebuilt in SvelteKit. In October [Brittney Postma](https://github.com/brittneypostma), [Willow aka GHOST](https://ghostdev.xyz), [Steph Dietz](https://github.com/StephDietz), and [Gen Ashley](https://twitter.com/coderinheels) founded [Svelte Sirens](https://sveltesirens.dev/), a group for women & non-binary community members and their allies. -Hundreds of developers join the Svelte Discord every week to chat about Svelte. You may have noticed that, as of recently, some members of the server have purple names. These are people with the ambassadors role, which was created to recognise some of the community’s most valued members and help manage the demands of a rapidly growing community. Svelte ambassadors are people who are well known for their helpfulness and contributions and for upholding Svelte’s reputation as a friendly, welcoming community, and we’re deeply grateful for their involvement. The initial ambassadors in alphabetical order are: +Hundreds of developers join the Svelte Discord every week to chat about Svelte. You may have noticed that, as of recently, some members of the server have purple names. These are people with the ambassadors role, which was created to recognise some of the community’s most valued members and help manage the demands of a rapidly growing community. Svelte ambassadors are people who are well known for their helpfulness and contributions and for upholding Svelte’s reputation as a friendly, welcoming community, and we’re deeply grateful for their involvement. The initial ambassadors in alphabetical order are: + - [babichjacob](https://github.com/babichjacob) - [brady fractal](https://github.com/FractalHQ) - [brittney postma](https://github.com/brittneypostma) @@ -56,7 +58,7 @@ Hundreds of developers join the Svelte Discord every week to chat about Svelte. - [swyx](https://github.com/sw-yx) - [theo](https://github.com/theo-steiner) -We’re also testing out [GitHub discussions on SvelteKit](https://github.com/sveltejs/kit/discussions) and may bring this to other repos in the Svelte organization if feedback is positive. +We’re also testing out [GitHub discussions on SvelteKit](https://github.com/sveltejs/kit/discussions) and may bring this to other repos in the Svelte organization if feedback is positive. ## Things to watch diff --git a/site/content/blog/2022-02-01-whats-new-in-svelte-february-2022.md b/site/content/blog/2022-02-01-whats-new-in-svelte-february-2022.md index 4e4638e4c7df..ab11a2fac157 100644 --- a/site/content/blog/2022-02-01-whats-new-in-svelte-february-2022.md +++ b/site/content/blog/2022-02-01-whats-new-in-svelte-february-2022.md @@ -1,6 +1,6 @@ --- title: "What's new in Svelte: February 2022" -description: "Rapid-fire releases across Svelte, SvelteKit and the community" +description: 'Rapid-fire releases across Svelte, SvelteKit and the community' author: Dani Sandoval authorURL: https://dreamindani.com --- @@ -10,12 +10,14 @@ Happy February, everyone! Over the last month or so, we've seen Svelte and Svelt Let's take a look... ## Highlights from the Svelte changelog + - **3.45.0** brought a [new a11y warning `a11y-no-redundant-roles`](https://svelte.dev/docs#accessibility-warnings-a11y-no-redundant-roles), destructuring and caching fixes - **3.46.0** added the much requested [`{@const}` tag](https://svelte.dev/docs#template-syntax-const) and [`style:` directive](https://svelte.dev/docs#template-syntax-element-directives-style-property) - Check out **3.46.1 - 3.46.3** for fixes to the `{@const}` tag and `style:` directive, along with a number of fixes to animations - [AST output is now available in the Svelte REPL](https://svelte.dev/repl/hello-world) ## What's new in SvelteKit + - `inlineStyleThreshold` allows you to specify where inline stylesheets are inserted into the page ([Docs](https://kit.svelte.dev/docs/configuration#inlinestylethreshold), [#2620](https://github.com/sveltejs/kit/pull/2620)) - `beforeNavigate`/`afterNavigate` lifecycle functions lets you add functionality before or after a page navigation ([Docs](https://kit.svelte.dev/docs/modules#$app-navigation), [#3293](https://github.com/sveltejs/kit/pull/3293)) - Platform context can now be passed from adapters ([Docs](https://kit.svelte.dev/docs/adapters#supported-environments-platform-specific-context), [#3429](https://github.com/sveltejs/kit/pull/3429)) @@ -24,23 +26,26 @@ Let's take a look... - Fallthrough routes let you specify where to route when an route can't be loaded ([Docs](https://kit.svelte.dev/docs/routing#advanced-routing-fallthrough-routes), [#3217](https://github.com/sveltejs/kit/pull/3217)) **New configs** + - Content Security Policy (CSP) is now supported for increased security when using inline javascript or stylesheets ([Docs](https://kit.svelte.dev/docs/configuration#csp), [#3499](https://github.com/sveltejs/kit/pull/3499)) - `kit.routes` config allows you to customise public/private modules during build ([Docs](https://kit.svelte.dev/docs/configuration#routes), [#3576](https://github.com/sveltejs/kit/pull/3576)) - `prerender.createIndexFiles` config lets you prerender index.html files as their subfolder's name ([Docs](https://kit.svelte.dev/docs/configuration#prerender), [#2632](https://github.com/sveltejs/kit/pull/2632)) - HTTP methods can now be overridden using `kit.methodOverride` ([Docs](https://kit.svelte.dev/docs/routing#endpoints-http-method-overrides), [#2989](https://github.com/sveltejs/kit/pull/2989)) **Config changes** + - `config.kit.hydrate` and `config.kit.router` are now nested under `config.kit.browser` ([Docs](https://kit.svelte.dev/docs/configuration#browser), [3578](https://github.com/sveltejs/kit/pull/3578)) **Breaking change** -- use `Request` and `Response` objects in endpoints and hooks ([#3384](https://github.com/sveltejs/kit/pull/3384)) +- use `Request` and `Response` objects in endpoints and hooks ([#3384](https://github.com/sveltejs/kit/pull/3384)) --- ## Community Showcase **Apps & Sites** + - [timb(re)](https://paullj.github.io/timb) is a live music programming environment - [Music for Programming](https://musicforprogramming.net/latest/) is a series of mixes intended for listening while `${task}` to focus the brain and inspire the mind - [Team Tale](https://teamtale.app/) allows two authors to write the same story in a tag-team sort of fashion @@ -59,10 +64,10 @@ Let's take a look... Want to work on a SvelteKit site with others, [try contributing to the Svelte Society site](https://github.com/svelte-society/sveltesociety-2021/issues)! - **Learning and Listening** _To Read_ + - [Accelerating Svelte's Development](https://svelte.dev/blog/accelerating-sveltes-development) by Ben McCann - [Storybook for Vite](https://storybook.js.org/blog/storybook-for-vite/) - [Let's learn SvelteKit by building a static Markdown blog from scratch](https://joshcollinsworth.com/blog/build-static-sveltekit-markdown-blog) by Josh Collinsworth @@ -74,6 +79,7 @@ _To Read_ - [Comparing Svelte Reactivity Options](https://opendirective.net/2022/01/06/comparing-svelte-reactivity-options/) by Steve Lee _To Watch_ + - [Integrating Storybook with SvelteKit](https://www.youtube.com/watch?v=Kc1ULlfyUcw) and [Integrating FaunaDB with Svelte](https://www.youtube.com/watch?v=zaoLZc76uZM) by the Svelte Sirens - [SvelteKit Crash Course Tutorial](https://www.youtube.com/watch?v=9OlLxkaeVvw&list=PL4cUxeGkcC9hpM9ARM59Ve3jqcb54dqiP) by The Net Ninja - [Svelte for Beginners](https://www.youtube.com/watch?v=BrkrOjknC_E&list=PLA9WiRZ-IS_ylnMYxIFCsZN6xVVSvLuHk) by Joy of Code @@ -82,11 +88,13 @@ _To Watch_ - [Sveltekit - Get All Routes/Pages](https://www.youtube.com/watch?v=Y_NE2R3HuOU) by WebJeda _To Listen To_ + - [New Year, New Svelte!?](https://share.transistor.fm/s/36212cdc) from Svelte Radio - [So much Sveltey goodness (featuring Rich Harris)](https://changelog.com/jsparty/205) from JS Party - [The Other Side of Tech: A Documentarian Perspective (with Stefan Kingham)](https://codingcat.dev/podcast/2-4-the-other-side-of-tech-a-documentarian-perspective) from Purrfect.dev **Libraries, Tools & Components** + - [threlte](https://github.com/grischaerbe/threlte) is a three.js component library for Svelte - [svelte-formify](https://github.com/nodify-at/svelte-formify) is a library to manage and validate forms that uses decorators to define validations - [gQuery](https://github.com/leveluptuts/gQuery) is a GraphQL Fetcher & Cache for Svelte Kit diff --git a/site/content/blog/2022-03-01-whats-new-in-svelte-march-2022.md b/site/content/blog/2022-03-01-whats-new-in-svelte-march-2022.md index 2f1a149200d5..477ef1f2795c 100644 --- a/site/content/blog/2022-03-01-whats-new-in-svelte-march-2022.md +++ b/site/content/blog/2022-03-01-whats-new-in-svelte-march-2022.md @@ -1,6 +1,6 @@ --- title: "What's new in Svelte: March 2022" -description: "Svelte Summit Spring is coming... and page endpoints are here!" +description: 'Svelte Summit Spring is coming... and page endpoints are here!' author: Dani Sandoval authorURL: https://dreamindani.com --- @@ -12,29 +12,30 @@ Also, some long-requested features were added to SvelteKit this month... includi More on that and other new features and fixes below! ## What's new in SvelteKit + - The docs are now searchable and multipage with type definitions and hoverable code examples - Check them out at [kit.svelte.dev/docs](https://kit.svelte.dev/docs/) - Page endpoints significantly decrease the boilerplate needed when loading a page ([Issue](https://github.com/sveltejs/kit/issues/3532), [PR](https://github.com/sveltejs/kit/pull/3679), [Docs](https://kit.svelte.dev/docs/routing#endpoints-page-endpoints)) - Application versioning and update detection support lets you determine what to do when a route fails to load after an app update ([Issue](https://github.com/sveltejs/kit/issues/87), [PR](https://github.com/sveltejs/kit/pull/3412), [Docs](https://kit.svelte.dev/docs/configuration#version)) - A new option in `npm init svelte@next` will now set up Playwright automatically for testing ([PR](https://github.com/sveltejs/kit/pull/4056)) - **Breaking Changes** + - The `target` option is no longer available. Instead, the `init` script hydrates its `parentNode` ([#3674](https://github.com/sveltejs/kit/pull/3674)) - App-level types now live in the `App` namespace which allows you to type global types like `Stuff` or `Session` ([#3670](https://github.com/sveltejs/kit/pull/3670)) - `JSONString` is now `JSONValue` ([#3683](https://github.com/sveltejs/kit/pull/3683)) - `createIndexFiles` has been removed — it is now controlled by the `trailingSlash` option ([#3801](https://github.com/sveltejs/kit/pull/3801)) - SvelteKit will no longer exclude root-relative external links from prerendering, which will cause 404s if these URLs are intended to be served by a separate app. Use a custom [`prerender.onError`](https://kit.svelte.dev/docs/configuration#prerender) handler if you need to ignore them ([#3826](https://github.com/sveltejs/kit/pull/3826)) - ## New in Language Tools -- Accessing properties in markups has been improved in the Svelte language tools ([105.12.0](https://github.com/sveltejs/language-tools/releases/tag/extensions-105.12.0)) - working around some known issues with autocomplete ([#538](https://github.com/sveltejs/language-tools/issues/538) / [#1302](https://github.com/sveltejs/language-tools/issues/1302)) +- Accessing properties in markups has been improved in the Svelte language tools ([105.12.0](https://github.com/sveltejs/language-tools/releases/tag/extensions-105.12.0)) - working around some known issues with autocomplete ([#538](https://github.com/sveltejs/language-tools/issues/538) / [#1302](https://github.com/sveltejs/language-tools/issues/1302)) --- ## Community Showcase **Apps & Sites** + - [SvelteStorm](https://github.com/open-source-labs/SvelteStorm) is specifically tailored to provide all of the essential tools a Svelte developer needs to build a Svelte application - [Supachat](https://github.com/Lleweraf/supachat) is a real-time chat app using Svelte and Supabase - [Radicle](https://radicle.xyz/) is a peer-to-peer stack for building software together @@ -49,10 +50,10 @@ More on that and other new features and fixes below! Want to work on a SvelteKit site with others? [Contribute to the Svelte Society site](https://github.com/svelte-society/sveltesociety.dev/issues)! - **Learning Resources** _To Read_ + - [Svelte Components as Web Components](https://medium.com/@yesmeno/svelte-components-as-web-components-b400d1253504) by Matias Meno - [Simple Svelte Routing with Reactive URLs](https://bjornlu.com/blog/simple-svelte-routing-with-reactive-urls) by Bjorn Lu - [Leveling Up my Sveltekit / Sanity.io Blog Content with Featured Videos and Syntax Highlighting](https://ryanboddy.net/level-up-blog) by Ryan Boddy @@ -64,12 +65,13 @@ _To Read_ - [SvelteKit and the "Client pattern"](https://retro.cloud/sveltekit-and-the-client-pattern/) by Julian Laubstein _To Watch_ + - [~~Shadow~~ Page Endpoints In Svelte Kit - Weekly Svelte](https://www.youtube.com/watch?v=PoYPZT7ruqI) by LevelUpTuts - [Testing For Beginners (Playlist)](https://www.youtube.com/watch?v=y53wwdBr5AI&list=PLA9WiRZ-IS_z7KpqhPELfEMbhAGRwZrzn) by Joy of Code - [KitQL - The native SvelteKit library for GraphQL](https://www.youtube.com/watch?v=6pH4fnFN70w) by Jean-Yves COUËT - **Libraries, Tools & Components** + - [gosvelte](https://github.com/sachinbhutani/gosvelte) is a proof of concept to serve Svelte-generated pages on GoLang HTTP server with server data being sent as props to svelte components - [svelte-ethers-store](https://www.npmjs.com/package/svelte-ethers-store) uses the ethers.js library as a collection of readable Svelte stores for Svelte, Sapper or SvelteKit - [Fluid Grid](https://fluid-grid.com/) is a CSS grid system for future web diff --git a/site/content/blog/2022-04-01-whats-new-in-svelte-april-2022.md b/site/content/blog/2022-04-01-whats-new-in-svelte-april-2022.md index 6dedf92fab71..de7374f7cdcc 100644 --- a/site/content/blog/2022-04-01-whats-new-in-svelte-april-2022.md +++ b/site/content/blog/2022-04-01-whats-new-in-svelte-april-2022.md @@ -1,6 +1,6 @@ --- title: "What's new in Svelte: April 2022" -description: "Goodbye fallthrough routes, hello param validators!" +description: 'Goodbye fallthrough routes, hello param validators!' author: Dani Sandoval authorURL: https://dreamindani.com --- @@ -10,18 +10,19 @@ This month, we felt a shift in the way SvelteKit handles page properties. The la More on that, and what else is new in Svelte, as we dive in... ## What's new in SvelteKit + - Param matchers allow you to check if a url parameter matches before rendering a page - replacing the need for fallthrough routes for this purpose ([Docs](https://kit.svelte.dev/docs/routing#advanced-routing-matching), [#4334](https://github.com/sveltejs/kit/pull/4334)) - Explicit redirects can now be handled directly from endpoints ([#4260](https://github.com/sveltejs/kit/pull/4260)) - `svelte-kit sync` ([#4182](https://github.com/sveltejs/kit/pull/4182)), TypeScript 4.6 ([#4190](https://github.com/sveltejs/kit/pull/4190)) and Vite 2.9 were released - adding non-blocking dependency optimization and experimental CSS source maps in dev mode as well as a number of bug fixes contributed by the SvelteKit team ([#4468](https://github.com/sveltejs/kit/pull/4468)) - **New Config Options** + - `outDir` fixes path issues in monorepos and other situations where the desired output directory is outside the project directory ([Docs](https://kit.svelte.dev/docs/configuration#outdir), [#4176](https://github.com/sveltejs/kit/pull/4176)) - `endpointExtensions` prevents files other than .js and .ts files from being treated as endpoints, unless you specify endpointExtensions ([Docs](https://kit.svelte.dev/docs/configuration#endpointextensions), [#4197](https://github.com/sveltejs/kit/pull/4197)) - `prerender.default` lets you prerender every page without having to write `export const prerender = true` in every page file ([Docs](https://kit.svelte.dev/docs/configuration#prerender), [#4192](https://github.com/sveltejs/kit/pull/4192)) - **Breaking Changes** + - Fallthrough routes have been removed. For migration tips, check out the PR ([#4330](https://github.com/sveltejs/kit/pull/4330)) - `tabindex="-1"` is only added to `` during navigation ([#4140](https://github.com/sveltejs/kit/pull/4140) and [#4184](https://github.com/sveltejs/kit/pull/4184)) - Adapters are now required to supply a `getClientAddress` function ([#4289](https://github.com/sveltejs/kit/pull/4289)) @@ -29,8 +30,8 @@ More on that, and what else is new in Svelte, as we dive in... - The `\$` character is no longer allowed in dynamic parameters ([#4334](https://github.com/sveltejs/kit/pull/4334)) - `svelte-kit package` has been marked as experimental so changes to it after Kit 1.0 will not be considered breaking ([#4164](https://github.com/sveltejs/kit/pull/4164)) - ## New across the Svelte ecosystem + - Svelte: Lots of new types for TypeScript and Svelte plugin users - including `style:` directives and Svelte Actions (**3.46.4** and **3.46.5**) - Language Tools: Svelte project files are now importable/findable through references without having them imported in a TS file ([105.13.0](https://github.com/sveltejs/language-tools/releases/tag/extensions-105.13.0)) - Language Tools: Region folding is now supported in html with ``/`` ([105.13.0](https://github.com/sveltejs/language-tools/releases/tag/extensions-105.13.0)) @@ -40,6 +41,7 @@ More on that, and what else is new in Svelte, as we dive in... ## Community Showcase **Apps & Sites built with Svelte** + - [Launcher](https://launcher.team/) is an open-source app launcher powered by SvelteKit, Prisma, and Tailwind - [Paaster](https://paaster.io/) is a secure by default end to end encrypted pastebin built with Svelte, Vite, TypeScript, Python, Starlette, rclone & Docker. - [Simple AF Video Converter](https://github.com/berlyozzy/Simple-AF-Video-Converter) is an Electron wrapper around ffmpeg.wasm to make converting videos between formats easier @@ -50,7 +52,7 @@ More on that, and what else is new in Svelte, as we dive in... - [Multiply](https://www.multiply.us/) is an integrated PR and Social agency moving at the speed of culture - [yia!](https://www.yia.co.nz/) is a Young Innovator Award competition in New Zealand - [Write to Russia](https://www.writetorussia.org/index) is a community email writing platform to communicate with public `.ru` email addresses -- [Markdown Playground](https://github.com/Petros-K/markdown-playground) is an online playground dedicated for your markdown experiments. +- [Markdown Playground](https://github.com/Petros-K/markdown-playground) is an online playground dedicated for your markdown experiments. - [RatherMisty](https://rathermisty.com/) is a no frills weather app with weather data from Open-Meteo - [Minecraft Profile Pic (MCPFP)](https://github.com/MauritsWilke/mcpfp) is a site to generate Minecraft profile pictures with ease - [WebGL Fluid Simulation](https://github.com/jpaquim/svelte-webgl-fluid-simulation) is a configurable fluid simulation built with Svelte and WebGL @@ -58,13 +60,14 @@ More on that, and what else is new in Svelte, as we dive in... Itching to contribute to a modern SvelteKit website? [Help build the Svelte Society site](https://github.com/svelte-society/sveltesociety.dev/issues)! - **Learning Resources** _To Attend_ + - [Svelte Summit: Spring](https://www.sveltesummit.com/) will take place on April 30, 2022! Join us for the 5th virtual Svelte conference on [YouTube](https://www.sveltesummit.com/) and Discord 🍾 _To Read_ + - [Svelte(Kit) TypeScript Showcase + general TypeScript tips](https://github.com/ivanhofer/sveltekit-typescript-showcase) by Hofer Ivan - [Local constants in Svelte with the @const tag](https://geoffrich.net/posts/local-constants/) by Geoff Rich - [Design Patterns for Building Reusable Svelte Components](https://render.com/blog/svelte-design-patterns) by Eric Liu @@ -78,6 +81,7 @@ _To Read_ - [React ⇆ Svelte Cheatsheet](https://dev.to/joshnuss/react-to-svelte-cheatsheet-1a2a) lists the similarities and differences between the two libraries - by Joshua Nussbaum _To Watch_ + - [Svelte Extravaganza | Async](https://www.youtube.com/watch?v=mT4CLVHgtSg) by pngwn - [6 Svelte Packages You Should Know](https://www.youtube.com/watch?v=y5SrUKcX_Co) and [Basic React To Svelte Conversion](https://www.youtube.com/watch?v=DiSuwLlhOxs) by LevelUpTuts - [Page/Shadow Endpoint in SvelteKit](https://www.youtube.com/watch?v=j-9D5UDyVOM) by WebJeda @@ -86,8 +90,8 @@ _To Watch_ - [Fullstack SvelteKit Auth 🔐 with Firebase & Magic Links! 🪄](https://www.youtube.com/watch?v=MAHE4iQgh5Q) by Johnny Magrippis - [Firebase Authentication in SvelteKit! Full Stack App](https://www.youtube.com/watch?v=N6Y3hqhZvNI) by Ryan Boddy - **Libraries, Tools & Components** + - [SvelTable](https://sveltable.io/) is a feature rich, data table component built with Svelte - [svelte-cyberComp](https://github.com/Cybersteam00/svelte-cyberComp) is a powerful, lightweight component library written in Svelte and TypeScript - [Flowbite Svelte](https://github.com/shinokada/flowbite-svelte) is an unofficial Flowbite component library for Svelte diff --git a/site/content/blog/2022-05-01-whats-new-in-svelte-may-2022.md b/site/content/blog/2022-05-01-whats-new-in-svelte-may-2022.md index 72d2c837f0fe..8961260f77c6 100644 --- a/site/content/blog/2022-05-01-whats-new-in-svelte-may-2022.md +++ b/site/content/blog/2022-05-01-whats-new-in-svelte-may-2022.md @@ -1,6 +1,6 @@ --- title: "What's new in Svelte: May 2022" -description: "Dynamically switch between HTML element types with ``" +description: 'Dynamically switch between HTML element types with ``' author: Dani Sandoval authorURL: https://dreamindani.com --- @@ -8,10 +8,11 @@ authorURL: https://dreamindani.com With yesterday's Svelte Summit behind us, we've got a lot of news to share! Check out all of the recordings on the [Svelte Society YouTube Channel](https://www.youtube.com/sveltesociety) and the rest of this month's updates below... ## What's new in Svelte -- The `` element lets you render an element of a dynamically specified type. This is useful, for example, when rendering rich text content from a CMS. Check out the [docs](https://svelte.dev/docs#template-syntax-svelte-element) or the [tutorial](https://svelte.dev/tutorial/svelte-element) for more info (**3.47.0**)! +- The `` element lets you render an element of a dynamically specified type. This is useful, for example, when rendering rich text content from a CMS. Check out the [docs](https://svelte.dev/docs#template-syntax-svelte-element) or the [tutorial](https://svelte.dev/tutorial/svelte-element) for more info (**3.47.0**)! ## Language Tools updates + - `svelte:element` and `sveltekit:reload` are now supported - Invalid Svelte import paths will now be automatically detected - see PR for getting back the old behavior ([#1448](https://github.com/sveltejs/language-tools/pull/1448)) - `source.sortImports` lets you sort imports without deleting unused imports ([#1338](https://github.com/sveltejs/language-tools/issues/1338)) @@ -19,23 +20,24 @@ With yesterday's Svelte Summit behind us, we've got a lot of news to share! Chec - In VS Code, you can now wrap existing blocks of code in control flow tags using the `Insert Snippet` command ([#1373](https://github.com/sveltejs/language-tools/pull/1373)) ## What's new in SvelteKit + - Files and directories can now be named `__tests__` and `__test__` in the routes directory ([#4438](https://github.com/sveltejs/kit/pull/4438)) - Netlify Edge Functions ([#4657](https://github.com/sveltejs/kit/pull/4657)) and the Vercel build output API ([#4663](https://github.com/sveltejs/kit/pull/4663)) are now supported - Custom `load` dependencies, array of strings representing URLs the page depends on, are now available when loading routes ([Docs](https://kit.svelte.dev/docs/loading#output-dependencies), [#4536](https://github.com/sveltejs/kit/pull/4536)) - **Breaking Changes** + - Validators are now called "matchers" ([Docs](https://kit.svelte.dev/docs/routing#advanced-routing-matching), [#4358](https://github.com/sveltejs/kit/pull/4358)) - `__layout.reset` has been replaced by named layouts - which have much configurability for shared layout elements ([Docs](https://kit.svelte.dev/docs/layouts#named-layouts), [#4388](https://github.com/sveltejs/kit/pull/4388)) - Prerendering is now skipped for `rel="external"` links ([#4545](https://github.com/sveltejs/kit/pull/4545)) - `maxage` is now `cache` in `LoadOutput` ([#4690](https://github.com/sveltejs/kit/pull/4690)) - --- ## Community Showcase **Apps & Sites built with Svelte** + - [polySpectra AR](https://ar.polyspectra.com/) lets you prototype faster 3D Printing with seamless AR file handoffs ([video demo](https://www.youtube.com/watch?v=VhYCeVGcG3E)) - [Pixel Art Together](https://github.com/liveblocks/pixel-art-together) is a free multiplayer pixel art editor powered by Liveblocks - [Tooling Manager](https://tooling-manager.netlify.app/) lets you compare your JavaScript tech stack against industry standard boilerplates @@ -49,10 +51,10 @@ With yesterday's Svelte Summit behind us, we've got a lot of news to share! Chec Want to contribute to a modern SvelteKit website? [Help build the Svelte Society site](https://github.com/svelte-society/sveltesociety.dev/issues)! - **Learning Resources** _To Read_ + - [4 tips for cleaner Svelte components](https://geoffrich.net/posts/clean-component-tips/) by Geoff Rich - [Building a Clubhouse clone with Svelte and 100ms](https://www.100ms.live/blog/clubhouse-clone-with-svelte) By Seun Taiwo - [SvelteKit uvu Testing: Fast Component Unit Tests](https://rodneylab.com/sveltekit-uvu-testing/) by Rodney Lab @@ -61,21 +63,22 @@ _To Read_ - [Add Commitint, Commitizen, Standard Version, and Husky to SvelteKit Project](https://davipon.hashnode.dev/add-commitint-commitizen-standard-version-and-husky-to-sveltekit-project) by David Peng _To Watch or Hear_ + - [Rich Harris - The Road to SvelteKit 1.0 (Svelte Society NYC)](https://www.youtube.com/watch?v=s6a1pbTVcUs) by Svelte Society - [Svelte Fundamentals - Intro to Svelte](https://codingcat.dev/course/intro-to-svelte) by Coding Cat - [Svelte Components Using Custom Markdown Renderers - Weekly Svelte](https://www.youtube.com/watch?v=ZiEROAqobwM) by LevelUpTuts - [Implementing {@const} in if block](https://www.youtube.com/watch?v=f5iReGqjmG0) by lihautan - [Svelte and Contributing to Open-Source with Geoff Rich](https://podcast.20minjs.com/1952066/10417700-episode-6-svelte-and-contributing-to-open-source-with-geoff-rich) by 20minJS - **Libraries, Tools & Components** + - [KitDocs](https://github.com/svelteness/kit-docs) is a documentation integration for SvelteKit - like VitePress for Svelte. - [Svelte Copy](https://github.com/ghostdevv/svelte-copy) is a click/tap-to-copy library that makes it easy to copy to the clipboard - [Svend3r](https://github.com/oslabs-beta/svend3r) provides beautiful visualizations that harness the power of D3 to bring your data to life while abstracting away its imperative-style code - [Svelte Hamburgers](https://github.com/ghostdevv/svelte-hamburgers) is the easy to use Hamburger menu component for Svelte - [Svelte Droplet](https://github.com/probablykasper/svelte-droplet) is a file dropzone for Svelte -- [Svelte MP3](https://www.npmjs.com/package/svelte-mp3) is a light blazingly fast yet simple minimalistic audio player for Svelte -- [SvelteUI](https://github.com/Brisklemonade/svelteui) is a component library for building fully functional & accessible web applications faster than ever +- [Svelte MP3](https://www.npmjs.com/package/svelte-mp3) is a light blazingly fast yet simple minimalistic audio player for Svelte +- [SvelteUI](https://github.com/Brisklemonade/svelteui) is a component library for building fully functional & accessible web applications faster than ever - [svelte-spotlight](https://github.com/beynar/svelte-spotlight) is a headless spotlight component to help you build your site's global search box in minutes - [svelte-pdf-simple](https://github.com/gspasov/svelte-pdf-simple) is a simple svelte library for displaying PDFs and giving you all the control - [persistent-svelte-store](https://github.com/omer-g/persistent-svelte-store) is a generic persistent writable store, built from scratch in TypeScript according to the Svelte store contract diff --git a/site/content/blog/2022-06-01-whats-new-in-svelte-june-2022.md b/site/content/blog/2022-06-01-whats-new-in-svelte-june-2022.md index 24e2e6f455ca..0a551eed1397 100644 --- a/site/content/blog/2022-06-01-whats-new-in-svelte-june-2022.md +++ b/site/content/blog/2022-06-01-whats-new-in-svelte-june-2022.md @@ -1,6 +1,6 @@ --- title: "What's new in Svelte: June 2022" -description: "Cancellable dispatched events, deeper {@const} declarations and more!" +description: 'Cancellable dispatched events, deeper {@const} declarations and more!' author: Dani Sandoval authorURL: https://dreamindani.com --- @@ -10,17 +10,19 @@ With last month's [Svelte Summit](https://www.youtube.com/watch?v=qqj2cBockqE) b Let's dive in! ## What's new in Svelte + - Custom events can now be cancelled in the `createEventDispatcher` function (**3.48.0**, [Docs](https://svelte.dev/docs#run-time-svelte-createeventdispatcher), [PR](https://github.com/sveltejs/svelte/pull/7064)) - The `{@const}` tag can now be used in `{#if}` blocks to conditionally define variables (**3.48.0**, [Docs](https://svelte.dev/docs#template-syntax-const), [PR](https://github.com/sveltejs/svelte/pull/7451)) - Lots of bug fixes across ``, animations and various DOM elements. Check out the [CHANGELOG](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md#3480) for a deeper dive! - ## What's new in SvelteKit + - Vite 2.9.9 was released as one of the last Vite 2 releases. The Svelte team has been hard at work contributing to the Vite 3 release to make the integration between SvelteKit and Vite smoother than ever ([Vite 3.0 Milestone](https://github.com/vitejs/vite/milestone/5)) - `config.kit.alias` lets you more easily declare a custom alias to replace values in `import` statements ([Docs](https://kit.svelte.dev/docs/configuration#alias), [PR](https://github.com/sveltejs/kit/pull/4964)) - Pages marked for prerendering will now fail during SSR at runtime ([PR](https://github.com/sveltejs/kit/pull/4812)) **Breaking Changes** + - Node 14 is no longer supported ([PR](https://github.com/sveltejs/kit/pull/4922)) - Requests to `/favicon.ico` will no longer be suppressed and will instead be handled as a valid route ([PR](https://github.com/sveltejs/kit/pull/5046)) - AMP support has been moved to a separate `@sveltejs/amp` package ([Docs](https://kit.svelte.dev/docs/seo#manual-setup-amp), [PR](https://github.com/sveltejs/kit/pull/4710)) @@ -34,6 +36,7 @@ Let's dive in! ## Community Showcase **Apps & Sites built with Svelte** + - [Plantarium](https://github.com/jim-fx/plantarium) is a tool for the procedural generation of 3D plants. - [SPATULA](https://github.com/AlexWarnes/lamina-spatula) is a tool for building shading materials that are exportable as code material in any project that uses lamina and threejs - [Waaard](https://waaard.com/) lets you create and send protected links with a variety of SSO providers @@ -48,10 +51,10 @@ Let's dive in! Looking for a great SvelteKit website to contribute to? [Help build the Svelte Society site](https://github.com/svelte-society/sveltesociety.dev/issues)! - **Learning Resources** _To Read_ + - [Component party](https://component-party.dev/) is a site that compares common patterns in different frameworks - [Quick tip: style prop defaults](https://geoffrich.net/posts/style-prop-defaults/) by Geoff Rich - [Working with reduced motion in Svelte](https://ghostdev.xyz/posts/working-with-reduced-motion-in-svelte) by GHOST @@ -61,6 +64,7 @@ _To Read_ _To Watch_ From Svelte Society: + - [The Svelte Summit Spring 2022 stream recording](https://www.youtube.com/watch?v=qqj2cBockqE) has been updated with chapter markers to make it easy to watch again and again - [The full recording of Svelte London, April 2022](https://www.youtube.com/watch?v=zIxzJzTnoxA) is up! Check out the amazing talks from across the Svelte London community - [Persian Svelte Society](https://www.youtube.com/channel/UCfWH9lCsXN3j8oXq8dru82Q) is making Persian-language videos about Svelte @@ -70,8 +74,8 @@ From Svelte Society: - [Rendering your Svelte apps on Render](https://www.youtube.com/watch?v=SnV_hMLVyqs) on May 24 - [The story behind the (unofficial) Svelte newsletter](https://www.youtube.com/watch?v=aK0xXm3hPxk&list=PL8bMgX1kyZThkJ_Rk6AAFI4eY24g5XKwK&index=7) on May 27 - Across the Web: + - [Building vite-plugin-svelte-inspector](https://www.youtube.com/watch?v=udYB24IMtsY), [What is Singleton?](https://www.youtube.com/watch?v=xhi0m1QZue0) and [What is Navigation?](https://www.youtube.com/watch?v=Ym-OnGUps2c) by lihautan - [Auto Import Components In Svelte Kit - Weekly Svelte](https://www.youtube.com/watch?v=JXvKBtTPr64) by LevelUpTuts - [🧪 Test SvelteKit with TDD & VITEST 🧪](https://www.youtube.com/watch?v=5bQD3dCoyHA) by Johnny Magrippis @@ -80,6 +84,7 @@ Across the Web: - [SvelteKit Shiki Syntax Highlighting: Markdown Codeblocks](https://rodneylab.com/sveltekit-shiki-syntax-highlighting/) and [Svelte Capsize Styling: Typography Tooling](https://rodneylab.com/svelte-capsize-styling/) by Rodney Lab _To Hear_ + - Svelte Radio has been putting out weekly episodes: - [The Adventures of Running a Svelte Meetup](https://www.svelteradio.com/episodes/the-adventures-of-running-a-svelte-meetup) - [The other Rich! Geoff! (feat. Geoff Rich)](https://www.svelteradio.com/episodes/the-other-rich-geoff) @@ -87,8 +92,8 @@ _To Hear_ - [Stores Galore](https://www.svelteradio.com/episodes/stores-galore) - [Svelte and the Future of Frontend Development (feat. Rich Harris)](https://thenewstack.io/svelte-and-the-future-of-front-end-development/) from The New Stack - **Libraries, Tools & Components** + - [vite-plugin-svelte-console-remover](https://github.com/jhubbardsf/vite-plugin-svelte-console-remover) is a Vite plugin that removes all console statements (log, group, dir, error, etc) from Svelte, JS, and TS files during build so they don't leak into production - [Svelte Headless Tables](https://github.com/bryanmylee/svelte-headless-table) is an unopinionated and extensible data tables for Svelte - [y-presence](https://github.com/nimeshnayaju/y-presence) is a lightweight set of libraries to easily add presence (live cursors/avatars) to any web application (now with Svelte support!) @@ -105,7 +110,6 @@ There were lots of Svelte stores released this month from a number of authors... - [svelte-damped-store](https://github.com/aredridel/svelte-damped-store) is a derived writable store that can suspend updates while [svelte-lens-store](https://github.com/aredridel/svelte-lens-store) is a functional lens over Svelte stores - [svelte-persistent-store](https://github.com/furudean/svelte-persistent-store) is a writable svelte store that saves and loads data from `Window.localStorage` or `Window.sessionStorage`. - Did we miss anything? Join us on [Reddit](https://www.reddit.com/r/sveltejs/) or [Discord](https://discord.com/invite/yy75DKs) to add your voice. Don't forget that you can also join us in-person at the Svelte Summit in Stockholm! Come join us for two days of awesome Svelte content! [Get your tickets now](https://ti.to/svelte/svelte-summit-fall-edition). diff --git a/site/content/blog/2022-07-01-whats-new-in-svelte-july-2022.md b/site/content/blog/2022-07-01-whats-new-in-svelte-july-2022.md index 2ae21fcdb15e..13d61fa402e0 100644 --- a/site/content/blog/2022-07-01-whats-new-in-svelte-july-2022.md +++ b/site/content/blog/2022-07-01-whats-new-in-svelte-july-2022.md @@ -1,6 +1,6 @@ --- title: "What's new in Svelte: July 2022" -description: "Faster SSR, language tools improvements and a new paid contributor!" +description: 'Faster SSR, language tools improvements and a new paid contributor!' author: Dani Sandoval authorURL: https://dreamindani.com --- @@ -16,13 +16,14 @@ Svelte supporters have donated approximately $80,000 to [the project on OpenColl We will also be utilizing OpenCollective funds to allow Svelte core maintainers to attend [Svelte Summit](https://www.sveltesummit.com/) in person this fall. Thanks to everyone who has donated so far! ## What's new in Svelte & Language Tools + - [learn.svelte.dev](https://learn.svelte.dev/) is a new way to learn Svelte and SvelteKit from the ground up that is currently in development - Faster SSR is coming in the next Svelte release. A PR two years in the making, resulting in up to 3x faster rendering in some benchmarking tests! ([PR](https://github.com/sveltejs/svelte/pull/5701)) - "Find File References" ([0.14.28](https://github.com/sveltejs/language-tools/releases/tag/language-server-0.14.28)) and "Find Component References" ([0.14.29](https://github.com/sveltejs/language-tools/releases/tag/language-server-0.14.29)) in the latest versions of the Svelte extension shows where Svelte files and components have been imported and used ([Demo](https://twitter.com/dummdidumm_/status/1532459709604716544/photo/1)) - The Svelte extension now supports CSS path completion ([0.14.29](https://github.com/sveltejs/language-tools/releases/tag/language-server-0.14.29)) - ## What's new in SvelteKit + - Introduced `@sveltejs/kit/experimental/vite` which allows SvelteKit to interoperate with other tools in the Vite ecosystem like Vitest and Storybook ([#5094](https://github.com/sveltejs/kit/pull/5094)). Please [leave feedback](https://github.com/sveltejs/kit/issues/5184) as to whether the feature works and is helpful as we consider taking it out of experimental and making `vite.config.js` required for all users - Streaming in endpoints is now supported ([#3419](https://github.com/sveltejs/kit/issues/3419)). This was enabled by switching to the Undici `fetch` implementation ([#5117](https://github.com/sveltejs/kit/pull/5117)) - Static assets can now be symlinked in development environments ([#5089](https://github.com/sveltejs/kit/pull/5089)) @@ -33,6 +34,7 @@ We will also be utilizing OpenCollective funds to allow Svelte core maintainers ## Community Showcase **Apps & Sites built with Svelte** + - [Virtual Maker](https://www.virtualmaker.net/) lets you make interactive 3D and VR scenes in your browser - [Apple Beta Music](https://www.reddit.com/r/sveltejs/comments/v7ic2s/apple_beta_music_uses_svelte/) appears to have been written in some combination of Svelte and web components - [Itatiaia](https://www.itatiaia.com.br/), the largest radio station in the country of Brazil just relaunched its news portal in SvelteKit @@ -51,15 +53,16 @@ We will also be utilizing OpenCollective funds to allow Svelte core maintainers Want to contribute to a site using the latest SvelteKit features? [Help build the Svelte Society site](https://github.com/svelte-society/sveltesociety.dev/issues)! - **Learning Resources** _Starring the Svelte team_ + - [Svelte Origins: A JavaScript Documentary](https://www.youtube.com/watch?v=kMlkCYL9qo0) by OfferZen Origins - [Full Stack Documentation (announcing learn.svelte.dev)](https://portal.gitnation.org/contents/full-stack-documentation) by Rich Harris @ JSNation 2022 - [All About the Sirens](https://www.svelteradio.com/episodes/all-about-the-sirens) by Svelte Radio _To Watch_ + - [SvelteKit Page Endpoints](https://www.youtube.com/watch?v=yQRf2wmTu5w), [Named Layouts](https://www.youtube.com/watch?v=UHX9TJ0BxZY) and [Passing data from page component to layout component with $page.stuff](https://www.youtube.com/watch?v=CXaCstU5pcw) by lihautan - [🍞 & 🧈: Magically load data with SvelteKit Endpoints](https://www.youtube.com/watch?v=f6prqYlbTE4) by Johnny Magrippis - [Svelte for React developers](https://www.youtube.com/watch?v=7tsrwrx5HtQ) by frontendtier @@ -68,6 +71,7 @@ _To Watch_ - [Svelte + websockets: Build a real-time Auction app](https://www.youtube.com/watch?v=CqgsWFrwQIU) by Evgeny Maksimov _To Read_ + - [Up-To-Date Analytics on a Static Website](https://paullj.github.io/posts/up-to-date-analytics-on-a-static-website) and [Fast, Lightweight Fuzzy Search using Fuse.js](https://paullj.github.io/posts/fast-lightweight-fuzzy-search-using-fuse.js) by paullj - [Use SvelteKit as a handler in the ExpressJs project](https://chientrm.medium.com/use-sveltekit-as-a-handler-in-the-expressjs-project-15524b01128f) by Tran Chien - [Creating a desktop application with Tauri and SvelteKit](https://github.com/Stijn-B/tauri-sveltekit-example) by Stijn-B @@ -76,8 +80,8 @@ _To Read_ - [SvelteKit Hooks. Everything You Need To Know](https://kudadam.com/blog/understanding-sveltekit-hooks) by Lucretius K. Biah - [3 tips for upgrading the performance of your Svelte stores](https://www.mathiaspicker.com/posts/3-tips-for-upgrading-the-performance-of-your-svelte-stores) by Mathias Picker - **Libraries, Tools & Components** + - [Svend3r](https://github.com/oslabs-beta/svend3r) is a plug and play D3 charting library for Svelte - [Svelte Hover Draw SVG](https://github.com/davipon/svelte-hover-draw-svg) is a lightweight Svelte component to draw SVG on hover - [Svelte French Toast](https://svelte-french-toast.com/) provides buttery smooth toast notifications that are lightweight, customizable, and beautiful by default @@ -90,7 +94,6 @@ _To Read_ - [Svelte Component Snippets](https://marketplace.visualstudio.com/items?itemName=brysonbw.svelte-component-snippets) is a VS Code extension with access to common Svelte snippets - [Svelte Confetti](https://github.com/Mitcheljager/svelte-confetti) adds a little bit of flair to your app with some confetti 🎊 - What did we miss? Let us know on [Reddit](https://www.reddit.com/r/sveltejs/) or [Discord](https://discord.com/invite/yy75DKs) to add your voice. Don't forget that you can also join us in-person at the Svelte Summit in Stockholm! Come join us for two days of awesome Svelte content! [Get your tickets now](https://www.sveltesummit.com/). diff --git a/site/content/blog/2022-08-01-whats-new-in-svelte-august-2022.md b/site/content/blog/2022-08-01-whats-new-in-svelte-august-2022.md index 63aad912cedc..c10ed6df1614 100644 --- a/site/content/blog/2022-08-01-whats-new-in-svelte-august-2022.md +++ b/site/content/blog/2022-08-01-whats-new-in-svelte-august-2022.md @@ -12,6 +12,7 @@ Also, [@dummdidumm](https://github.com/dummdidumm) (Simon H) [has joined Vercel Now onto the rest of the updates... ## What's new in SvelteKit + - Dynamically imported styles are now included during SSR ([#5138](https://github.com/sveltejs/kit/pull/5138)) - Improvements to routes and prop updates to prevent unnecessary rerendering ([#5654](https://github.com/sveltejs/kit/pull/5654), [#5671](https://github.com/sveltejs/kit/pull/5671)) - Lots of improvements to error handling ([#4665](https://github.com/sveltejs/kit/pull/4665), [#5622](https://github.com/sveltejs/kit/pull/5622), [#5619](https://github.com/sveltejs/kit/pull/5619), [#5616](https://github.com/sveltejs/kit/pull/5616)) @@ -22,6 +23,7 @@ Now onto the rest of the updates... - `vite-plugin-svelte` has reached 1.0 and now supports Vite 3. You'll notice new default ports for `dev` (port 5173) and `preview` (port 4173) ([#5005](https://github.com/sveltejs/kit/pull/5005), [vite-plugin-svelte CHANGELOG](https://github.com/sveltejs/vite-plugin-svelte/blob/main/packages/vite-plugin-svelte/CHANGELOG.md)) **Breaking changes:** + - `mode`, `prod` and `server` are no longer available in `$app/env` ([#5602](https://github.com/sveltejs/kit/pull/5602)) - `svelte-kit` CLI commands are now run using the `vite` command and `vite.config.js` is required. This will allow first-class support with other projects in the Vite ecosystem like Vitest and Storybook ([#5332](https://github.com/sveltejs/kit/pull/5332), [Docs](https://kit.svelte.dev/docs/project-structure#project-files-vite-config-js)) - `endpointExtensions` is now `moduleExtensions` and can be used to filter param matchers ([#5085](https://github.com/sveltejs/kit/pull/5085), [Docs](https://kit.svelte.dev/docs/configuration#moduleextensions)) @@ -35,18 +37,18 @@ Now onto the rest of the updates... For a full list of changes, check out kit's [CHANGELOG](https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md). - ## What's new in Svelte & Language Tools + - The `@layer` [CSS at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/@layer) is now supported in Svelte components (**3.49.0**, [PR](https://github.com/sveltejs/svelte/issues/7504)) - The `inert` [HTML attribute](https://html.spec.whatwg.org/multipage/interaction.html#the-inert-attribute) is now supported in Svelte's language tools and plugins (**105.20.0**, [PR](https://github.com/sveltejs/language-tools/pull/1565)) - The Svelte plugin will now use `SvelteComponentTyped` typings, if available (**105.19.0**, [PR](https://github.com/sveltejs/language-tools/pull/1548)) - --- ## Community Showcase **Apps & Sites built with Svelte** + - [PocketBase](https://github.com/pocketbase/pocketbase) is an open source Go backend with a single file and an admin dashboard built with Svelte - [Hondo](https://www.playhondo.com/how-to-play) is a word guessing game with multiple rounds - [Hexapipes](https://github.com/gereleth/hexapipes) is a site for playing hexagonal pipes puzzle @@ -64,6 +66,7 @@ For a full list of changes, check out kit's [CHANGELOG](https://github.com/svelt **Learning Resources** _Starring the Svelte team_ + - [The Svelte Documentary is out!](https://www.svelteradio.com/episodes/the-svelte-documentary-is-out) on Svelte Radio - [Beginner SvelteKit](https://vercel.com/docs/beginner-sveltekit) by Vercel - [Challenge: Explore Svelte by Building a Bubble Popping Game](https://prismic.io/blog/try-svelte-build-game) by Brittney Postma @@ -71,6 +74,7 @@ _Starring the Svelte team_ - [Svelte Sirens July Talk - Testing in Svelte with Jess Sachs](https://sveltesirens.dev/event/testing-in-svelte) _To Watch_ + - [10 Awesome Svelte UI Component Libraries](https://www.youtube.com/watch?v=RkD88ARvucM) by LevelUpTuts - [Learn How SvelteKit Works](https://www.youtube.com/watch?v=VizuTy3uSNE) and [SvelteKit Endpoints](https://www.youtube.com/watch?v=XnVxDLTgCgo) by Joy of Code - [SvelteKit using TS, and Storybook setup](https://www.youtube.com/watch?v=L4F5dSu0FcQ) by Jarrod Kane @@ -78,6 +82,7 @@ _To Watch_ - [SvelteKit authentication, the better way - Tutorial](https://www.youtube.com/watch?v=Y98KipzwVdM) by Pilcrow _To Read_ + - [Some assorted Svelte demos](https://geoffrich.net/posts/assorted-svelte-demos/) by Geoff Rich - [Three ways to bootstrap a Svelte project](https://maier.tech/posts/three-ways-to-bootstrap-a-svelte-project) by Thilo Maier - [Design & build an app with Svelte](https://bootcamp.uxdesign.cc/design-build-an-app-with-svelte-ecd7ed0729da) by Hugo @@ -90,16 +95,17 @@ _To Read_ - [Transitional Apps with Phoenix and Svelte](https://nathancahill.com/phoenix-svelte) by Nathan Cahill _Tech Demos_ + - [Bringing the best GraphQL experience to Svelte](https://www.the-guild.dev/blog/houdini-and-kitql) by The Guild - [Style your Svelte website faster with Stylify CSS](https://stylifycss.com/blog/style-your-svelte-website-faster-with-stylify-css/) by Stylify - [Revamped Auth Helpers for Supabase (with SvelteKit support)](https://supabase.com/blog/2022/07/13/supabase-auth-helpers-with-sveltekit-support) by Supabase - **Libraries, Tools & Components** + - [Lucia](https://github.com/pilcrowOnPaper/lucia-sveltekit) is a simple, JWT based authentication library for SvelteKit that connects your SvelteKit app with your database - [Skeleton](https://github.com/Brain-Bones/skeleton) is a UI component library for use with Svelte + Tailwind - [pass-composer](https://pass-composer.vercel.app/) helps you compose your postprocessing passes for threlte scenes -- [@crikey/stores-*](https://whenderson.github.io/stores-mono/) is a collection of libraries to extend Svelte stores for common use-cases +- [@crikey/stores-\*](https://whenderson.github.io/stores-mono/) is a collection of libraries to extend Svelte stores for common use-cases - [Svelte Chrome Storage](https://github.com/shaun-wild/svelte-chrome-storage) is a lightweight abstraction between Svelte stores and Chrome extension storage - [Svelte Schema Form](https://github.com/restspace/svelte-schema-form) is a form generator for JSON schema - [svelte-gesture](https://github.com/wobsoriano/svelte-gesture) is a library that lets you bind richer mouse and touch events to any component or view diff --git a/site/content/blog/2022-09-01-whats-new-in-svelte-september-2022.md b/site/content/blog/2022-09-01-whats-new-in-svelte-september-2022.md index 88fee600ccaa..2127b5c79ce0 100644 --- a/site/content/blog/2022-09-01-whats-new-in-svelte-september-2022.md +++ b/site/content/blog/2022-09-01-whats-new-in-svelte-september-2022.md @@ -12,12 +12,14 @@ With the redesign of SvelteKit's filesystem-based router merging early last mont But the new routing isn't the only new feature in SvelteKit... ## What's new in SvelteKit + - `Link` is now supported as an HTTP header and works out of the box with Cloudflare's [Automatic Early Hints](https://github.com/sveltejs/kit/issues/5455) (**1.0.0-next.405**, [PR](https://github.com/sveltejs/kit/pull/5735)) - `$env/static/*` are now virtual to prevent writing sensitive values to disk (**1.0.0-next.413**, [PR](https://github.com/sveltejs/kit/pull/5825)) - `$app/stores` can now be used from anywhere on the browser (**1.0.0-next.428**, [PR](https://github.com/sveltejs/kit/pull/6100)) - `config.kit.env.dir` is a new config that sets the directory to search for `.env` files (**1.0.0-next.430**, [PR](https://github.com/sveltejs/kit/pull/6175)) **Breaking changes:** + - The filesystem-based router and `load` API improves the way routes are managed. **Before installing version `@sveltejs/kit@1.0.0-next.406` or later, [follow this migration guide](https://github.com/sveltejs/kit/discussions/5774)** ([PR](https://github.com/sveltejs/kit/pull/5778), [Issue](https://github.com/sveltejs/kit/discussions/5748)) - `event.session` has been removed from `load` along with the `session` store and `getSession`. Use `event.locals` instead (**1.0.0-next.415**, [PR](https://github.com/sveltejs/kit/pull/5946)) - Named layouts have been removed in favor of `(groups)` (**1.0.0-next.432**, [Docs](https://kit.svelte.dev/docs/advanced-routing#advanced-layouts), [PR & Migration Instructions](https://github.com/sveltejs/kit/pull/6174)) @@ -27,14 +29,15 @@ But the new routing isn't the only new feature in SvelteKit... For a full list of changes, check out kit's [CHANGELOG](https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md). **Updates to language tools** -- TypeScript doesn't resolve imports to SvelteKit's $types very well, the latest version of Svelte's language tools makes it better (**105.21.0**, [#1592](https://github.com/sveltejs/language-tools/pull/1592)) +- TypeScript doesn't resolve imports to SvelteKit's $types very well, the latest version of Svelte's language tools makes it better (**105.21.0**, [#1592](https://github.com/sveltejs/language-tools/pull/1592)) --- ## Community Showcase **Apps & Sites built with Svelte** + - [canno](https://twitter.com/a_warnes/status/1556724034959818754?s=20&t=RyKWALPByqMT5A_PkLtUew) is a simple interactive 3d physics game with adjustable gravity, cannon power, and debug visualizer - made with threlte - [straw.page](https://straw.page/) is an extremely simple website builder that lets you create unique websites straight from your phone - [Patra](https://patra.webjeda.com/) lets you share short notes just with a link. No database. No storage @@ -49,6 +52,7 @@ For a full list of changes, check out kit's [CHANGELOG](https://github.com/svelt **Learning Resources** _Starring the Svelte team_ + - [Supper Club × Rich Harris, Author of Svelte — Syntax Podcast 499](https://syntax.fm/show/499/supper-club-rich-harris-author-of-svelte) - [Let's talk routing with Rich Harris on Svelte Radio](https://www.svelteradio.com/episodes/lets-talk-routing-with-rich-harris) - [2.17 - Building the Future of Svelte at Vercel with Rich Harris](https://www.youtube.com/watch?v=F1sSUDVoij4) @@ -60,23 +64,25 @@ _Starring the Svelte team_ - [Svelte London August Recording](https://www.youtube.com/watch?v=ua6gE2zPulw) _Learning the new SvelteKit routing_ + - [Migrating Breaking Changes in SvelteKit](https://www.netlify.com/blog/migrating-breaking-changes-in-sveltekit/) by Brittney Postma (Netlify) - [Major Svelte Kit API Change - Fixing `load`, and tightening up SvelteKit's design before 1.0](https://www.youtube.com/watch?v=OUGn7VifUCg) - Video by LevelUpTuts - [SvelteKit Is Never Going To Be The Same](https://www.youtube.com/watch?v=eVFcGA-15LA) - Video by Joy of Code - [Let's learn SvelteKit by building a static Markdown blog from scratch](https://joshcollinsworth.com/blog/build-static-sveltekit-markdown-blog) by Josh Collinsworth (updated Aug 26th to keep up with the new changes) _To Watch_ + - [Svelte Guide For React Developers](https://www.youtube.com/watch?v=uWDBEUkTRGk) and [Svelte State Management Guide](https://www.youtube.com/watch?v=4dDjQiOVrOo) by Joy of Code - [What Is Bookit? The Svelte Kit Storybook Killer](https://www.youtube.com/watch?v=aOBGhvggsq0) and [What Is @type{import In Svelte Kit - JSDoc Syntax](https://www.youtube.com/watch?v=y0DvJTVO65M) by LevelUpTuts - [TWF Yet another JS Framework... or not? Svelte!](https://www.youtube.com/watch?app=desktop&v=nT8QtDBIKZA) by TWF meetup - _To Read_ + - [Creating a Figma Plugin with Svelte](https://www.lekoarts.de/javascript/creating-a-figma-plugin-with-svelte) by Lennart - [Svelte Video Blog: Vlog with Mux from your own SvelteKit Site](https://plus.rodneylab.com/tutorials/svelte-video-blog) and [Svelte Shy Header: Peekaboo Sticky Header with CSS](https://rodneylab.com/svelte-shy-header/) by Rodney Lab - **Libraries, Tools & Components** + - [@svelte-plugins/tooltips](https://github.com/svelte-plugins/tooltips) is a simple tooltip action and component designed for Svelte - [Lucia](https://github.com/pilcrowOnPaper/lucia-sveltekit) is a simple authentication library for SvelteKit that connects your SvelteKit app to your database - [remix-router-svelte](https://github.com/brophdawg11/remix-routers/tree/main/packages/svelte) is a Svelte implementation of the `react-router-dom` API (driven by `@remix-run/router`) @@ -91,11 +97,12 @@ _To Read_ - [vite-plugin-svelte-bridge](https://github.com/joshnuss/vite-plugin-svelte-bridge) lets you write Svelte components and use them from React & Vue _UI Kits and Starters_ + - [Svelte-spectre](https://github.com/basf/svelte-spectre) is a UI-kit based on spectre.css and powered by Svelte - [Skeleton](https://skeleton.brainandbonesllc.com/) allows you to build fast and reactive web UI using the power of Svelte + Tailwind - [iconsax-svelte](https://www.npmjs.com/package/iconsax-svelte) brings the popular icon kit to Svelte - [laravel-vite-svelte-spa-template](https://github.com/NukeJS/laravel-vite-svelte-spa-template) is a Laravel 9, Vite, Svelte SPA, Tailwind CSS (w/ Forms Plugin & Aspect Ratio Plugin), Axios, & TypeScript starter template -- [neutralino-svelte-boilerplate-js](https://github.com/Raffaele/neutralino-svelte-boilerplate-js) is a cross platform desktop template for Neutralino and Svelte +- [neutralino-svelte-boilerplate-js](https://github.com/Raffaele/neutralino-svelte-boilerplate-js) is a cross platform desktop template for Neutralino and Svelte - [figma-plugin-svelte-vite](https://github.com/candidosales/figma-plugin-svelte-vite) is a boilerplate for creating Figma plugins using Svelte, Vite and Typescript - [Urara](https://github.com/importantimport/urara) is a sweet & powerful SvelteKit blog starter - [SvelteKit Commerce](https://vercel.com/templates/svelte/sveltekit-commerce) is an all-in-one starter kit for high-performance e-commerce sites built with SvelteKit by Vercel diff --git a/site/content/blog/2022-10-01-whats-new-in-svelte-october-2022.md b/site/content/blog/2022-10-01-whats-new-in-svelte-october-2022.md index 8108f6027040..46e8a857df9c 100644 --- a/site/content/blog/2022-10-01-whats-new-in-svelte-october-2022.md +++ b/site/content/blog/2022-10-01-whats-new-in-svelte-october-2022.md @@ -1,17 +1,18 @@ --- title: "What's new in Svelte: October 2022" -description: "Svelte Summit, `use:enhance`, and a SvelteKit Release Candidate!" +description: 'Svelte Summit, `use:enhance`, and a SvelteKit Release Candidate!' author: Dani Sandoval authorURL: https://dreamindani.com --- -There's a bunch of updates this month... from new features in Svelte and SvelteKit to a whole 2-day *summit*! Plus, the Svelte extension gets some helpful new tools, new accessibility (a11y) warnings, and Tan Li Hau teaches us how to build our own Svelte and a Svelte spreadsheet 😎 +There's a bunch of updates this month... from new features in Svelte and SvelteKit to a whole 2-day _summit_! Plus, the Svelte extension gets some helpful new tools, new accessibility (a11y) warnings, and Tan Li Hau teaches us how to build our own Svelte and a Svelte spreadsheet 😎 ## What happened at Svelte Summit? A lot! Below you can find all the talks, by timestamp, from each livestream. Bite-size videos of the event will be coming soon to the Svelte Society channel, so be sure to [Subscribe](https://www.youtube.com/c/SvelteSociety), if you haven't already! _Day One_ + - [12:31](https://www.youtube.com/watch?v=pJcbZr5VlV4&t=751s) - How to get Svelte adopted at work - [33:21](https://www.youtube.com/watch?v=pJcbZr5VlV4&t=2001s) - Animating Data Visualization in Svelte - [2:20:36](https://www.youtube.com/watch?v=pJcbZr5VlV4&t=8436s) - Red flags & code smells @@ -24,6 +25,7 @@ _Day One_ - [8:20:49](https://www.youtube.com/watch?v=pJcbZr5VlV4&t=30049s) - Building the future, faster _Day Two_ + - [24:09](https://www.youtube.com/watch?v=A8jkJTWacow&t=1449s) - Scrollytell me why: Ain't nothing but a piece of cake - [2:02:40](https://www.youtube.com/watch?v=A8jkJTWacow&t=7360s) - I told you my dog wouldn’t run - [2:29:43](https://www.youtube.com/watch?v=A8jkJTWacow&t=8983s) - 10Xing Svelte @@ -31,17 +33,19 @@ _Day Two_ - [5:09:39](https://www.youtube.com/watch?v=A8jkJTWacow&t=18579s) - Having fun with stores: an interactive demo of Svelte’s built in state management library - [5:37:06](https://www.youtube.com/watch?v=A8jkJTWacow&t=20226s) - When Keeping it Svelte Goes Wrong. An Analysis of Some of the Worst Svelte I Have Ever Coded - [7:22:05](https://www.youtube.com/watch?v=A8jkJTWacow&t=26525s) - Getting started with Hooks -- [7:38:14](https://www.youtube.com/watch?v=A8jkJTWacow&t=27494s) - Special Announcement* +- [7:38:14](https://www.youtube.com/watch?v=A8jkJTWacow&t=27494s) - Special Announcement\* -*In the final talk of the summit, Rich Harris announces the first Release Candidate of SvelteKit! With no planned breaking changes left, the team is hard at work squashing bugs and adding the remaining features for 1.0... +\*In the final talk of the summit, Rich Harris announces the first Release Candidate of SvelteKit! With no planned breaking changes left, the team is hard at work squashing bugs and adding the remaining features for 1.0... ## More SvelteKit Updates + - `use:enhance` is the easiest way to progressively enhance a form ([Docs](https://kit.svelte.dev/docs/form-actions#progressive-enhancement-use-enhance), [#6633](https://github.com/sveltejs/kit/pull/6633), [#6828](https://github.com/sveltejs/kit/pull/6828), [#7012](https://github.com/sveltejs/kit/pull/7012)) - The demo app has been updated to add the Sverdle game, which Rich demoed at Svelte Summit and demonstrates `use:enhance` ([#6979](https://github.com/sveltejs/kit/pull/6979)) - Cloudflare Pages `_routes.json` specification is now supported by `adapter-cloudflare` ([#6530](https://github.com/sveltejs/kit/pull/6530)) - Improved build performance by running asset and page compression in parallel ([#6710](https://github.com/sveltejs/kit/pull/6710)) **Breaking changes:** + - Node 16.14 is now the minimum version to run SvelteKit ([#6388](https://github.com/sveltejs/kit/pull/6388)) - `App.PrivateEnv` and `App.PublicEnv` have been removed in favour of generated types ([#6413](https://github.com/sveltejs/kit/pull/6413)) - `%sveltekit.message%` has been replaced with `%sveltekit.error.message%` ([6659](https://github.com/sveltejs/kit/pull/6659)) @@ -51,6 +55,7 @@ _Day Two_ For a full list of changes, check out SvelteKit's [CHANGELOG](https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md). ## Svelte Updates + - New a11y warnings for `incorrect-aria-attribute-type`, `no-abstract-role`, `interactive-element-to-noninteractive-role` and `role-has-required-aria-props`.`no-noninteractive-tabindex` and `click-events-have-key-events` coming soon! (**3.50.0**) - New types for `ComponentEvents` and `SveltePreprocessor` (**3.50.0**) - Improved parsing speed when encountering large blocks of whitespace (**3.50.0**) @@ -59,6 +64,7 @@ For a full list of changes, check out SvelteKit's [CHANGELOG](https://github.com For all the changes to the Svelte compiler, including upcoming changes, check out the [CHANGELOG](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md). ## New in Language Tools + - Better code formatting for editor suggestion (**106.0.0**, [#1598](https://github.com/sveltejs/language-tools/pull/1598)) - Easily create SvelteKit route files from the context menu or command palette (**106.1.0**, [#1620](https://github.com/sveltejs/language-tools/pull/1620)) @@ -75,6 +81,7 @@ It can be used for anything you may be trying to accomplish using Svelte includi ## Community Showcase **Apps & Sites built with Svelte** + - [Timeflow](https://www.timeflow.site/) is a smart calendar & task manager that dynamically schedules your tasks between your events - [GeoQuest](https://github.com/woutdp/geoquest) is an open source geography game - [Houses Of](https://housesof.world/) is a project showcasing charismatic houses around the world @@ -84,25 +91,27 @@ It can be used for anything you may be trying to accomplish using Svelte includi - [RoomOS Device Widgets](https://github.com/wxsd-sales/roomos-device-widgets) is an app for demoing RoomOS device capabilities in Kiosk/PWA mode - [World Seed](https://store.steampowered.com/app/1870320/World_Seed/) is a full blown online multiplayer game - [Lirify](https://lirify-tan.vercel.app/) is a song lyrics writing web app tool made in Latvia -- [Splet Tech Konferencija](https://www.splet.rs/) is a tech conference in Serbia with a *very* fancy website +- [Splet Tech Konferencija](https://www.splet.rs/) is a tech conference in Serbia with a _very_ fancy website - [Unbounded](https://unbounded.polkadot.network/) is an open-source variable font - funded by blockchain (and an awesome-looking website) - [Porter's Paints](https://shop.porterspaints.com/) is an eCommerce site for (you guessed it) paints built with Svelte -- [CRAN/E](https://www.cran-e.com/) is a search engine for modern R-packages - +- [CRAN/E](https://www.cran-e.com/) is a search engine for modern R-packages **Learning Resources** _Starring the Svelte team_ + - [Upgrading SvelteKit](https://www.youtube.com/watch?v=vzeZskhjoeQ) by Svelte Sirens (with Brittney, Kev, and GHOST!) - [Build your own Svelte](https://www.youtube.com/watch?v=mwvyKGw2CzU) by lihautan - [Native Page Transitions in SvelteKit: Part 1](https://geoffrich.net/posts/page-transitions-1/) by Geoff Rich - [Build a cross platform app with Tauri](https://ghostdev.xyz/posts/build-a-cross-platform-app-with-tauri/) by GHOST _To Watch_ + - [How To Use Future CSS In Svelte](https://www.youtube.com/watch?v=eqwtoaP-0pk) and [Master Animation With Svelte](https://www.youtube.com/watch?v=3RlBfUQCiAQ) by Joy of Code - [Svelte Kit Form Actions 101 - New Svelte Kit API](https://www.youtube.com/watch?v=i5zdnv83mxY) and [Svelte Kit Form Actions - Real World Examples - Q&A](https://www.youtube.com/watch?v=PK2Mpt1q6K8) by LevelUpTuts _To Read_ + - [What's new in `svelte-kit, 1.0.0-next.445`: (group) layout](https://dev.to/parables/whats-new-in-svelte-kit-100-next445-group-layout-1ld5) by Parables - [Handling breaking changes in SvelteKit pre-1.0](https://maier.tech/posts/handling-breaking-changes-in-sveltekit-pre-1-0) by Thilo Maier - [Svelte Custom Stores Demystified](https://raqueebuddinaziz.com/blog/svelte-custom-stores-demystified/) by Raqueebuddin Aziz @@ -113,8 +122,8 @@ _To Read_ - [Deploying SvelteKit with NodeJS to a Server Using GitLab and PM2](https://abyteofcoding.com/blog/deploying-sveltekit-with-nodejs-pm2-to-server/) by A Byte of Coding - [Quality of Life Tips when using SvelteKit in VS Code](https://www.reddit.com/r/sveltejs/comments/xltgyp/quality_of_life_tips_when_using_sveltekit_in_vs/) by doa-doa - **Libraries, Tools & Components** + - [Svelte Fit](https://github.com/leveluptuts/svelte-fit) is an extremely simple, no dependency fit text library - [svelte-switch-case](https://github.com/l-portet/svelte-switch-case) is a switch case syntax for your Svelte components - [svelte-canvas-confetti](https://github.com/andreasmcdermott/svelte-canvas-confetti) uses a single canvas to render full-screen confetti @@ -126,9 +135,10 @@ _To Read_ - [whyframe](https://whyframe.dev/) gives iframes superpowers, making it easy to render anything in isolation - [@svelte-put/modal](https://github.com/vnphanquang/svelte-put/tree/main/packages/misc/modal) is a solution to async, declarative, type-safe modals in Svelte - [Kitty](https://github.com/grottopress/kitty) is a collection of libraries and handlers for developing secure frontend apps -- [svelte-turnstile](https://github.com/ghostdevv/svelte-turnstile) is a component for Cloudflare Turnstile, the privacy focused CAPTCHA replacement +- [svelte-turnstile](https://github.com/ghostdevv/svelte-turnstile) is a component for Cloudflare Turnstile, the privacy focused CAPTCHA replacement _UI Kits and Starters_ + - [QWER](https://github.com/kwchang0831/svelte-QWER) is a blog starter built with SvelteKit - [SvelteKit Zero API](https://github.com/Refzlund/sveltekit-zero-api) provides type-safety between the frontend and backend - creating a structure for easy APIs - [sveltekit-monorepo](https://github.com/sw-yx/sveltekit-monorepo) is monorepo starter with 2022 tech diff --git a/site/content/blog/2022-11-01-whats-new-in-svelte-november-2022.md b/site/content/blog/2022-11-01-whats-new-in-svelte-november-2022.md index 246a17ce1090..eccbff9cb97e 100644 --- a/site/content/blog/2022-11-01-whats-new-in-svelte-november-2022.md +++ b/site/content/blog/2022-11-01-whats-new-in-svelte-november-2022.md @@ -1,6 +1,6 @@ --- title: "What's new in Svelte: November 2022" -description: "Better forms, routes and inline styles across SvelteKit and Svelte" +description: 'Better forms, routes and inline styles across SvelteKit and Svelte' author: Dani Sandoval authorURL: https://dreamindani.com --- @@ -10,17 +10,20 @@ It's been a busy October for the Svelte community. `use:enhance` and Advanced Ro There's also a _huge_ showcase to cover... so let's jump in! ## What's new in SvelteKit + - The new `update` method for `use:enhance` lets you easily get back the default form behavior while augmenting it with your own logic ([docs](https://kit.svelte.dev/docs/form-actions#progressive-enhancement-use-enhance), [#7083](https://github.com/sveltejs/kit/pull/7083) and [#7326](https://github.com/sveltejs/kit/pull/7326)) - `[[optional]]` parameters are now available for routing ([docs](https://kit.svelte.dev/docs/advanced-routing#optional-parameters), [#7051](https://github.com/sveltejs/kit/pull/7051)) - `goto` now has `invalidateAll` to (re-)run all `load` functions belonging to the new active page ([docs](https://kit.svelte.dev/docs/modules#$app-navigation-goto), [#7407](https://github.com/sveltejs/kit/pull/7407)) - `config.kit.paths.base` is now used in adapters looking for static assets - fixing 404 issues across `adapter-netlify`, `adapter-vercel`, `adapter-cloudflare`, and `adapter-cloudflare-workers` ([#4448](https://github.com/sveltejs/kit/pull/4448)) **Breaking changes:** + - Errors will now be thrown when routes conflict ([#7051](https://github.com/sveltejs/kit/pull/7051)) - The global `fetch` override has been removed when prerendering ([#7318](https://github.com/sveltejs/kit/pull/7318)) - Route IDs have been prefixed with `/` ([#7338](https://github.com/sveltejs/kit/pull/7338)) ## Svelte changes + - New accessibility warnings, `a11y-click-events-have-key-events` and `a11y-no-noninteractive-tabindex`, will now warn when your components lack required key events or tabindex. While `a11y-role-has-required-aria-props` will no longer warn when elements match their semantic role (**3.51.0**) - `--style-props` are now supported on `` and `` (**3.51.0**, Component Example: [Before](https://svelte.dev/repl/48984f20503f4959b70f24f4130d164b?version=3.47.0) and [After](https://svelte.dev/repl/48984f20503f4959b70f24f4130d164b?version=3.51.0), SVG Example: [Before](https://svelte.dev/repl/b7a3f94255914044b35462234ccaea43?version=3.50.0) and [After](https://svelte.dev/repl/b7a3f94255914044b35462234ccaea43?version=3.51.0)) - "nullish" values for component event handlers are now supported (**3.51.0**, [Example](https://svelte.dev/repl/9228022922af4c76af68ce42349ccbf9?version=3.51.0)) @@ -35,6 +38,7 @@ Tom Smykowski also released a great summary of [all the changes in 3.52.0](https ## Community Showcase **Apps & Sites built with Svelte** + - [AttendZen](https://www.attendzen.io/) is an event management and marketing platform for in-person, virtual or hybrid events - [Gram Jam](https://gramjam.app/) is a challenging daily word game using SvelteKit - [Collabwriting](https://collabwriting.com/) is an actionable knowledge base for your team @@ -52,10 +56,10 @@ Tom Smykowski also released a great summary of [all the changes in 3.52.0](https - [splits](https://splits.best/) lets you track your splits, calculate your race pace, become a better athlete - [Weaver](https://jrende.xyz/weaver/) is an application for creating [weave drafts](https://www.gistyarn.com/blogs/how-to-weave/how-to-read-a-weaving-draft) - **Learning Resources** _To Watch_ + - [Starting With Svelte - Brittney Postma](https://www.youtube.com/watch?v=pdKJzrPA0DY) by fitcevents - [Learn Svelte from scratch with Geoff Rich: A Svelte tutorial](https://www.youtube.com/watch?v=QoR0AZ-Rov8) by Kelvin Omereshone - [How To Connect to MongoDB in Svelte Kit](https://www.youtube.com/watch?v=gwktlvFHLMA) by LevelUpTuts @@ -64,6 +68,7 @@ _To Watch_ - [Sybil - Episode 1 - Rust knowledge management with SurrealDB](https://www.youtube.com/watch?v=eC7IePI5rIk) by Raphael Darley _To Read_ + - [4 things I miss from Svelte after working in React](https://geoffrich.net/posts/4-things-i-miss-svelte/) and [Create dynamic social card images with Svelte components](https://geoffrich.net/posts/svelte-social-image/) by Geoff Rich - [First-class Vite support in Storybook 7.0](https://storybook.js.org/blog/first-class-vite-support-in-storybook/) (Svelte and SvelteKit included) by Ian VanSchooten - [Better Svelte support is coming to WebStorm](https://blog.jetbrains.com/webstorm/2022/09/webstorm-2022-3-eap1/#information_regarding_svelte_support) from JetBrains @@ -76,9 +81,8 @@ _To Read_ - [Creating a Svelte Tabs component with Slot props](https://blog.openreplay.com/creating-a-svelte-tabs-component-with-slot-props/) by Shinichi Okada - [Sky Cart: An Open Source, cloud-agnostic shopping cart using Stripe Checkout](https://dev.to/stripe/sky-cart-an-open-source-cloud-agnostic-shopping-cart-using-stripe-checkout-o5k) by Mike Bifulco for Stripe - - **Libraries, Tools & Components** + - [Threlte](https://threlte.xyz/) is a component library for Svelte to build and render three.js scenes declaratively and state-driven in Svelte apps. It's being featured again to highlight the new "Playground" button in its examples - [Svelte Turnstile](https://github.com/ghostdevv/svelte-turnstile) is a library to integrate Cloudflare's Turnstile (a new CAPTCHA alternative) into a Svelte app - [ActionStore](https://github.com/buhrmi/actionstore) allows you to push data directly into Svelte stores via ActionCable @@ -96,6 +100,7 @@ _To Read_ - [svelte-copy](https://github.com/ghostdevv/svelte-copy)'s new version lets you customize the events that cause text to be copied to the clipboard _UI Kits, Integrations and Starters_ + - [SvelteKit Statiko](https://github.com/ivodolenc/sveltekit-statiko) is a multi-featured assistant for SvelteKit static projects - [Svelte-TailwindCSS UI (STWUI)](https://github.com/N00nDay/stwui) is a Tailwind-based UI that is currently in pre-release beta - [KitBase](https://github.com/kevmodrome/kitbase) is a starter template for SvelteKit and PocketBase @@ -107,6 +112,7 @@ _UI Kits, Integrations and Starters_ - [hooks-as-store](https://github.com/micha-lmxt/hooks-as-store) lets you use React custom hooks in Svelte Apps _Fun ones_ + - [svelte-typewriter-store](https://github.com/paoloricciuti/svelte-typewriter-store) is the simplest way to get a rotating typewriter effect in Svelte - [Aksel](https://www.npmjs.com/package/aksel) is the seagull you needed on your site - [Svelte-Dodge](https://github.com/WbaN314/svelte-dodge) makes components dodge the pointer diff --git a/site/content/blog/2022-12-01-whats-new-in-svelte-december-2022.md b/site/content/blog/2022-12-01-whats-new-in-svelte-december-2022.md index 6b110b7d255a..2569733a210d 100644 --- a/site/content/blog/2022-12-01-whats-new-in-svelte-december-2022.md +++ b/site/content/blog/2022-12-01-whats-new-in-svelte-december-2022.md @@ -1,6 +1,6 @@ --- title: "What's new in Svelte: December 2022" -description: "Rounding the corner to SvelteKit 1.0" +description: 'Rounding the corner to SvelteKit 1.0' author: Dani Sandoval authorURL: https://dreamindani.com --- @@ -10,6 +10,7 @@ SvelteKit 1.0 is just around the corner! With [99% of the milestone issues compl Let's get to it! ## What's new in SvelteKit + - Use the `willUnload` property to find out if the navigation will result the app being unloaded (full page reload/closing/leaving to another page). ([#6813](https://github.com/sveltejs/kit/pull/6813)) - `__data.json` requests now allows for caching while ensuring we cache matching responses for all invalidation scenarios ([#7532](https://github.com/sveltejs/kit/pull/7532)) - Linking to `` tags is now supported ([#7596](https://github.com/sveltejs/kit/pull/7596)) @@ -19,8 +20,8 @@ Let's get to it! - `version` is now available via `$app/environment` ([#7689](https://github.com/sveltejs/kit/pull/7689), [#7694](https://github.com/sveltejs/kit/pull/7694)) - `handleError` can now return a promise ([#7780](https://github.com/sveltejs/kit/pull/7780)) - **Breaking changes:** + - `routeId` is now `route.id` ([#7450](https://github.com/sveltejs/kit/pull/7450)) - 'load' has been renamed to 'enter' and 'unload' to 'leave' in the `beforeNavigate` and `afterNavigate` methods. `beforeNavigate` is now called once with type 'unload' on external navigation and will no longer run during redirects ([#7502](https://github.com/sveltejs/kit/pull/7502), [#7529](https://github.com/sveltejs/kit/pull/7529), [#7588](https://github.com/sveltejs/kit/pull/7588)) - The `redirect` helper will now only allow status codes between 300-308 for redirects and only `error` status codes between 400-599 are allowed ([#7767](https://github.com/sveltejs/kit/pull/7767)) ([#7615](https://github.com/sveltejs/kit/pull/7615), [#7767](https://github.com/sveltejs/kit/pull/7767)) @@ -35,6 +36,7 @@ Let's get to it! - `SubmitFunction` has been moved from `$app/forms` into `@sveltejs/kit` ([#7003](https://github.com/sveltejs/kit/pull/7003)) ## New in Svelte + - The css compiler options of `css: false` and `css: true` have been replaced with `'external' | 'injected' | 'none'` settings to speed up compilation for `ssr` builds and improve clarity (**3.53.0**) For all the changes to the Svelte compiler, including unreleased changes, check out the [CHANGELOG](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md). @@ -44,6 +46,7 @@ For all the changes to the Svelte compiler, including unreleased changes, check ## Community Showcase **Apps & Sites built with Svelte** + - [Appwrite's new console](https://github.com/appwrite/console) makes its secure backend server for web, mobile & Flutter developers avaiable in the browser - [RepoMagic](https://www.repomagic.com/) is a search and analytics tool for GitHub - [Podman Desktop](https://github.com/containers/podman-desktop) is a graphical tool for developing on containers and Kubernetes @@ -54,34 +57,35 @@ For all the changes to the Svelte compiler, including unreleased changes, check - [Let's premortem](https://letspremortem.com/) helps avoid lengthy, frustrating post-mortems after a project fails - [BLKMARKET.COM](https://beta.blkmarket.com/) is an illustration library for commercial and personal use - [Sigil](https://sigilspace.com/) is a canvas for anything with spaces organized by the most-voted content -- [corpus-activity-streams](https://github.com/ryanatkn/corpus-activity-streams) is an unofficial ActivityStreams 2.0 vocabulary data set and alternative docs +- [corpus-activity-streams](https://github.com/ryanatkn/corpus-activity-streams) is an unofficial ActivityStreams 2.0 vocabulary data set and alternative docs - [nodeMyAdmin](https://github.com/Andrea055/nodeMyAdmin) is an alternative to phpMyAdmin written with SvelteKit - [Image to Pattern Conversion](https://www.thread-bare.com/convert) is a cross-stitch pattern conversion tool with [a list of pre-made patterns](https://www.thread-bare.com/store) to start with - [Verbums](https://verbums.vdoc.dev/) is an English vocabulary trainer to improve language comprehension - [SVGPS](https://svgps.app/) removes the burden of working with a cluster of SVG files by converting your icons into a single JSON file - [This 3D retro-themed asteroid shooter](https://photon-alexwarnes.vercel.app/showcase/asteroids) was made with threlte - **Learning Resources** _To Hear_ + - [Catching up after Svelte Summit](https://www.svelteradio.com/episodes/catching-up) and [3D, WebGL and AI](https://www.svelteradio.com/episodes/3d-webgl-and-ai) by Svelte Radio _To Watch_ + - [Domenik Reitzner - The easy way, an introduction to Sveltekit](https://www.youtube.com/watch?v=t-LKRrNedps) from Svelte Society Vienna - [Sirens: Form Actions](https://www.youtube.com/watch?v=2OISk5-EHek) - Kev joins the Sirens again to chat about Form actions in SvelteKit and create a new form for speaker submissions on SvelteSirens.dev - [Introduction To 3D With Svelte (Threlte)](https://www.youtube.com/watch?v=89LYeHOncVk), [How To Use Global Styles In SvelteKit](https://www.youtube.com/watch?v=jHSwChkx3TQ) and [Progressive Form Enhancement With SvelteKit](https://www.youtube.com/watch?v=6pv70d7i-3Q) by Joy of Code _To Read_ + - [Building tic-tac-toe with Svelte](https://geoffrich.net/posts/tic-tac-toe/) by Geoff Rich - [Speed up SvelteKit Pages With a Redis Cache](https://www.captaincodeman.com/speed-up-sveltekit-pages-with-a-redis-cache) by Captain Codeman - [Understanding environment variables in SvelteKit](https://www.okupter.com/blog/environment-variables-in-sveltekit), [Form validation with SvelteKit and Zod](https://www.okupter.com/blog/sveltekit-form-validation-with-zod) and [Build a SvelteKit application with Docker](https://www.okupter.com/blog/build-a-sveltekit-application-with-docker) by Justin Ahinon - [Why I failed to create the "Solid.js's store" for Svelte, and announcing svelte-store-tree v0.3.1](https://dev.to/igrep/why-i-failed-to-create-the-solidjss-store-for-svelte-and-announcing-svelte-store-tree-v031-1am2) by YAMAMOTO Yuji - [Create an offline-first and installable PWA with SvelteKit and workbox-precaching](https://www.sarcevic.dev/offline-first-installable-pwa-sveltekit-workbox-precaching) by Antonio Sarcevic - - **Libraries, Tools & Components** + - [Skeleton](https://www.skeleton.dev/) is a UI toolkit to build fast and reactive web interfaces using Svelte + Tailwind CSS - [svelte-svg-spinners](https://github.com/luluvia/svelte-svg-spinners) is a collection of SVG Spinners components - [Svelte Floating UI](https://github.com/fedorovvvv/svelte-floating-ui) enables floating UIs with actions - no wrapper components or component bindings required @@ -96,7 +100,6 @@ _To Read_ - [svelte-lazyimage-cache](https://github.com/binsarjr/svelte-lazyimage-cache) is a Lazy Image component with IntersectionObserver and cache action - [threlte v5.0](https://www.reddit.com/r/sveltejs/comments/ywit18/threlte_v50_is_here_a_completely_new_developer/) is a completely new developer experience that is faster, more powerful, and incredibly flexible - That's it for this month! Let us know if we missed anything on [Reddit](https://www.reddit.com/r/sveltejs/) or [Discord](https://discord.gg/svelte) See ya next near 🎆 diff --git a/site/content/blog/2023-01-01-whats-new-in-svelte-january-2023.md b/site/content/blog/2023-01-01-whats-new-in-svelte-january-2023.md index cde11b245301..f42c15636ce5 100644 --- a/site/content/blog/2023-01-01-whats-new-in-svelte-january-2023.md +++ b/site/content/blog/2023-01-01-whats-new-in-svelte-january-2023.md @@ -1,6 +1,6 @@ --- title: "What's new in Svelte: January 2023" -description: "SvelteKit 1.0, learn.svelte.dev, and type definitions for Svelte elements." +description: 'SvelteKit 1.0, learn.svelte.dev, and type definitions for Svelte elements.' author: Dani Sandoval authorURL: https://dreamindani.com --- @@ -10,11 +10,13 @@ It's been just two weeks since the release of [SvelteKit 1.0](https://svelte.dev Let's dive into the details... ## What's new in SvelteKit + - `@sveltejs/kit` 1.0 is out! All future releases will follow semver and changes will be listed as major/minor/patch in the [CHANGELOG](https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md#100). - Improved support for Storybook and Histoire ([#7990](https://github.com/sveltejs/kit/pull/7990)). Work is ongoing to fully support those tools ([storybook#20239](https://github.com/storybookjs/storybook/pull/20239)). - `vitePreprocess` is now the default preprocessor. Please see [the docs](https://kit.svelte.dev/docs/integrations#preprocessors) for differences between `vitePreprocess` and `svelte-preprocess` ([#8036](https://github.com/sveltejs/kit/pull/8036)). **Breaking changes:** + - Unknown exports (except when starting with an underscore) are no longer allowed from `+(layout|page)(.server)?.js` and `+server.js` files ([#7878](https://github.com/sveltejs/kit/pull/7878)) - `__data.json` is now stripped from URL ([#7979](https://github.com/sveltejs/kit/pull/7979)) - `sveltekit()` will now return a promise for an array of Vite plugins ([#7994](https://github.com/sveltejs/kit/pull/7994)) @@ -27,17 +29,21 @@ Let's dive into the details... - Warnings and errors about removed/changed APIs have been removed ([#8019](https://github.com/sveltejs/kit/pull/8019)) ## What's new in Svelte + - The `options.direction` argument can now be passed to custom transition functions (**3.54.0**, [#3918](https://github.com/sveltejs/svelte/issues/3918)) - Variables can now be updated from a `@const` declared function (**3.54.0**, [#7843](https://github.com/sveltejs/svelte/issues/7843)) - `svelte/elements` has been added for Svelte/HTML type definitions (**3.55.0**, [#7649](https://github.com/sveltejs/svelte/pull/7649)) ## What's new in Language Tools + The Svelte extension and language tools now have a few new minimum version requirements: + - Node version is now 16 - TypeScript version is now 4.9 - Svelte version is now 3.55 The following features have also been released: + - missing handler quick fix ([#1731](https://github.com/sveltejs/language-tools/pull/1731)) - add Svelte anchor missing attribute code action ([#1730](https://github.com/sveltejs/language-tools/pull/1730)) - better commit characters handling ([#1742](https://github.com/sveltejs/language-tools/pull/1742)) @@ -53,6 +59,7 @@ For all the changes to the Svelte compiler, including unreleased changes, check ## Community Showcase **Apps & Sites built with Svelte** + - [Svelte Recipes 🧑‍🍳](https://svelte.recipes/) provides code snippets for common data visualization problems - [Everything Svelte](https://www.everythingsvelte.com/) is a new course teaching everything you need to know to build a modern web application - [CSS Timeline](https://css-timeline.vercel.app/) is a Timeline of the history and evolution of CSS @@ -66,6 +73,7 @@ For all the changes to the Svelte compiler, including unreleased changes, check **Learning Resources** _From Svelte Society_ + - [Svelte Society - London December 2022](https://www.youtube.com/watch?v=2ijSarsHfN0) featuring two talks by Antony and Rich, respectively. Rich's talk, "Mistakes were made" is a SvelteKit 1.0 retrospective. - [SvelteKit with Netlify Edge Functions](https://twitter.com/BrittneyPostma/status/1603402599742537729?s=20&t=Lw08QNMpdEP1JZzMQGXLDA) by Brittney Postma - [Sirens Stream: Skeleton - A fully featured UI Toolkit](https://www.youtube.com/watch?v=2OnJYCXJPK4) with Chris Simmons and Brittney Postma @@ -73,11 +81,13 @@ _From Svelte Society_ - [Sirens: Form Actions](https://www.youtube.com/watch?v=2OISk5-EHek) - Kev joins the Sirens again to chat about Form actions in SvelteKit and create a new form for speaker submissions on SvelteSirens.dev _To Watch_ + - [SvelteKit is my mistress](https://www.youtube.com/watch?v=uEJ-Rnm2yOE) by Fireship - [Sveltekit 1.0 in under 3 minutes](https://www.youtube.com/watch?v=3KGKDgwIrkE) by Gui Bibeau - [What Svelte UI Library Should You Use?](https://www.youtube.com/watch?v=O0mNU0maItY) and [The Best Icon Library For Svelte (Iconify)](https://www.youtube.com/watch?v=iGVhzsTZSa8) by Joy of Code _To Read_ + - [Rendering emails with Svelte](https://escape.tech/blog/sveltemails/) by Gautier Ben Aïm - [Now That React is Dead, What’s the Next Big Thing?](https://javascript.plainenglish.io/now-that-react-js-is-dead-whats-the-next-big-thing-7fa72a36a69b) by Somnath Singh - [What is SvelteKit? And Why Should You Care?](https://blog.tiia.rocks/what-is-sveltekit-and-why-should-you-care) by Tila @@ -86,6 +96,7 @@ _To Read_ - [Creating A Custom Svelte Media Query Store](https://pqina.nl/blog/svelte-media-query-store/) by Rik Schennink **Libraries, Tools & Components** + - [Konsta UI](https://konstaui.com/) is a library of pixel perfect mobile UI components built with Tailwind CSS for React, Vue & Svelte - [probablykasper/modal-svelte](https://github.com/probablykasper/modal-svelte) is a modal component for Svelte - [deepcrayon/scrolltron](https://spacecruft.org/deepcrayon/scrolltron) is a news ticker overlay for OBS Studio diff --git a/site/content/docs/01-getting-started.md b/site/content/docs/01-getting-started.md index 2362925beb3b..753f571ebb97 100644 --- a/site/content/docs/01-getting-started.md +++ b/site/content/docs/01-getting-started.md @@ -7,6 +7,7 @@ title: Getting started To try Svelte in an interactive online environment you can try [the REPL](https://svelte.dev/repl) or [StackBlitz](https://node.new/svelte). To create a project locally we recommend using [SvelteKit](https://kit.svelte.dev/), the official application framework from the Svelte team: + ``` npm create svelte@latest myapp cd myapp @@ -16,7 +17,7 @@ npm run dev SvelteKit will handle calling [the Svelte compiler](https://www.npmjs.com/package/svelte) to convert your `.svelte` files into `.js` files that create the DOM and `.css` files that style it. It also provides all the other pieces you need to build a web application such as a development server, routing, and deployment. [SvelteKit](https://kit.svelte.dev/) utilizes [Vite](https://vitejs.dev/) to build your code and handle server-side rendering (SSR). There are [plugins for all the major web bundlers](https://sveltesociety.dev/tools#bundling) to handle Svelte compilation, which will output `.js` and `.css` that you can insert into your HTML, but most others won't handle SSR. -If you don't need a full-fledged app framework and instead want to build a simple frontend-only site/app, you can also use Svelte (without Kit) with Vite by running `npm init vite` and selecting the `svelte` option. With this, `npm run build` will generate HTML, JS and CSS files inside the `dist` directory. +If you don't need a full-fledged app framework and instead want to build a simple frontend-only site/app, you can also use Svelte (without Kit) with Vite by running `npm init vite` and selecting the `svelte` option. With this, `npm run build` will generate HTML, JS and CSS files inside the `dist` directory. The Svelte team maintains a [VS Code extension](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) and there are integrations with various other [editors](https://sveltesociety.dev/tools#editor-support) and tools as well. diff --git a/site/content/docs/02-component-format.md b/site/content/docs/02-component-format.md index 8cc6a7fc591d..90fbc3cd30ed 100644 --- a/site/content/docs/02-component-format.md +++ b/site/content/docs/02-component-format.md @@ -351,7 +351,7 @@ If you want to make @keyframes that are accessible globally, you need to prepend The `-global-` part will be removed when compiled, and the keyframe then be referenced using just `my-animation-name` elsewhere in your code. -```html +```svelte
``` -Importantly, these rules are *scoped to the component*. You won't accidentally change the style of `

` elements elsewhere in your app, as we'll see in the next step. +Importantly, these rules are _scoped to the component_. You won't accidentally change the style of `

` elements elsewhere in your app, as we'll see in the next step. diff --git a/site/content/tutorial/01-introduction/05-nested-components/text.md b/site/content/tutorial/01-introduction/05-nested-components/text.md index ae022967552a..82d363af9f3b 100644 --- a/site/content/tutorial/01-introduction/05-nested-components/text.md +++ b/site/content/tutorial/01-introduction/05-nested-components/text.md @@ -10,7 +10,7 @@ Each `.svelte` file holds a component that is a reusable self-contained block of Let's add a ` @@ -18,7 +18,7 @@ Let's add a ` ``` -> Just like `$:`, this may feel a little weird at first. That's not how `export` normally works in JavaScript modules! Just roll with it for now — it'll soon become second nature. \ No newline at end of file +> Just like `$:`, this may feel a little weird at first. That's not how `export` normally works in JavaScript modules! Just roll with it for now — it'll soon become second nature. diff --git a/site/content/tutorial/03-props/02-default-values/text.md b/site/content/tutorial/03-props/02-default-values/text.md index 17b486d0add7..7048d05c0175 100644 --- a/site/content/tutorial/03-props/02-default-values/text.md +++ b/site/content/tutorial/03-props/02-default-values/text.md @@ -4,15 +4,15 @@ title: Default values We can easily specify default values for props in `Nested.svelte`: -```html +```svelte ``` -If we now add a second component *without* an `answer` prop, it will fall back to the default: +If we now add a second component _without_ an `answer` prop, it will fall back to the default: -```html +```svelte ``` diff --git a/site/content/tutorial/03-props/03-spread-props/text.md b/site/content/tutorial/03-props/03-spread-props/text.md index 1480ad80650b..941a128f348f 100644 --- a/site/content/tutorial/03-props/03-spread-props/text.md +++ b/site/content/tutorial/03-props/03-spread-props/text.md @@ -4,7 +4,7 @@ title: Spread props If you have an object of properties, you can 'spread' them onto a component instead of specifying each one: -```html +```svelte ``` diff --git a/site/content/tutorial/03-props/meta.json b/site/content/tutorial/03-props/meta.json index 7b9e0a27831f..d03965c7cbf7 100644 --- a/site/content/tutorial/03-props/meta.json +++ b/site/content/tutorial/03-props/meta.json @@ -1,3 +1,3 @@ { "title": "Props" -} \ No newline at end of file +} diff --git a/site/content/tutorial/04-logic/01-if-blocks/text.md b/site/content/tutorial/04-logic/01-if-blocks/text.md index 33915070cb99..b43e8cef9524 100644 --- a/site/content/tutorial/04-logic/01-if-blocks/text.md +++ b/site/content/tutorial/04-logic/01-if-blocks/text.md @@ -2,11 +2,11 @@ title: If blocks --- -HTML doesn't have a way of expressing *logic*, like conditionals and loops. Svelte does. +HTML doesn't have a way of expressing _logic_, like conditionals and loops. Svelte does. To conditionally render some markup, we wrap it in an `if` block: -```html +```svelte {#if user.loggedIn} -``` \ No newline at end of file +``` diff --git a/site/content/tutorial/05-events/meta.json b/site/content/tutorial/05-events/meta.json index c5f088e20879..42460e989b45 100644 --- a/site/content/tutorial/05-events/meta.json +++ b/site/content/tutorial/05-events/meta.json @@ -1,3 +1,3 @@ { "title": "Events" -} \ No newline at end of file +} diff --git a/site/content/tutorial/06-bindings/01-text-inputs/text.md b/site/content/tutorial/06-bindings/01-text-inputs/text.md index 7bfe4bb86ca2..ea806586c4f8 100644 --- a/site/content/tutorial/06-bindings/01-text-inputs/text.md +++ b/site/content/tutorial/06-bindings/01-text-inputs/text.md @@ -2,13 +2,13 @@ title: Text inputs --- -As a general rule, data flow in Svelte is *top down* — a parent component can set props on a child component, and a component can set attributes on an element, but not the other way around. +As a general rule, data flow in Svelte is _top down_ — a parent component can set props on a child component, and a component can set attributes on an element, but not the other way around. -Sometimes it's useful to break that rule. Take the case of the `` element in this component — we *could* add an `on:input` event handler that sets the value of `name` to `event.target.value`, but it's a bit... boilerplatey. It gets even worse with other form elements, as we'll see. +Sometimes it's useful to break that rule. Take the case of the `` element in this component — we _could_ add an `on:input` event handler that sets the value of `name` to `event.target.value`, but it's a bit... boilerplatey. It gets even worse with other form elements, as we'll see. Instead, we can use the `bind:value` directive: -```html +```svelte ``` diff --git a/site/content/tutorial/06-bindings/02-numeric-inputs/text.md b/site/content/tutorial/06-bindings/02-numeric-inputs/text.md index 1ede244301d4..9e4ed04b8b5a 100644 --- a/site/content/tutorial/06-bindings/02-numeric-inputs/text.md +++ b/site/content/tutorial/06-bindings/02-numeric-inputs/text.md @@ -6,7 +6,7 @@ In the DOM, everything is a string. That's unhelpful when you're dealing with nu With `bind:value`, Svelte takes care of it for you: -```html +```svelte -``` \ No newline at end of file +``` diff --git a/site/content/tutorial/06-bindings/03-checkbox-inputs/text.md b/site/content/tutorial/06-bindings/03-checkbox-inputs/text.md index 621d9fbb7b77..1feac27f949c 100644 --- a/site/content/tutorial/06-bindings/03-checkbox-inputs/text.md +++ b/site/content/tutorial/06-bindings/03-checkbox-inputs/text.md @@ -4,6 +4,6 @@ title: Checkbox inputs Checkboxes are used for toggling between states. Instead of binding to `input.value`, we bind to `input.checked`: -```html +```svelte -``` \ No newline at end of file +``` diff --git a/site/content/tutorial/06-bindings/04-group-inputs/text.md b/site/content/tutorial/06-bindings/04-group-inputs/text.md index b48b23921f9c..e721080dfb8b 100644 --- a/site/content/tutorial/06-bindings/04-group-inputs/text.md +++ b/site/content/tutorial/06-bindings/04-group-inputs/text.md @@ -6,23 +6,19 @@ If you have multiple inputs relating to the same value, you can use `bind:group` Add `bind:group` to each input: -```html +```svelte ``` In this case, we could make the code simpler by moving the checkbox inputs into an `each` block. First, add a `menu` variable to the ` @@ -14,7 +14,7 @@ Just as you can bind to DOM elements, you can bind to component instances themse Now we can programmatically interact with this component using `field`. -```html +```svelte diff --git a/site/content/tutorial/06-bindings/meta.json b/site/content/tutorial/06-bindings/meta.json index 8bb0142eccc9..b6b01225e3ba 100644 --- a/site/content/tutorial/06-bindings/meta.json +++ b/site/content/tutorial/06-bindings/meta.json @@ -1,3 +1,3 @@ { "title": "Bindings" -} \ No newline at end of file +} diff --git a/site/content/tutorial/07-lifecycle/01-onmount/text.md b/site/content/tutorial/07-lifecycle/01-onmount/text.md index 6baa254e9f28..517a9304dfe9 100644 --- a/site/content/tutorial/07-lifecycle/01-onmount/text.md +++ b/site/content/tutorial/07-lifecycle/01-onmount/text.md @@ -2,13 +2,13 @@ title: onMount --- -Every component has a *lifecycle* that starts when it is created, and ends when it is destroyed. There are a handful of functions that allow you to run code at key moments during that lifecycle. +Every component has a _lifecycle_ that starts when it is created, and ends when it is destroyed. There are a handful of functions that allow you to run code at key moments during that lifecycle. The one you'll use most frequently is `onMount`, which runs after the component is first rendered to the DOM. We briefly encountered it [earlier](/tutorial/bind-this) when we needed to interact with a `` element after it had been rendered. We'll add an `onMount` handler that loads some data over the network: -```html +```svelte ``` -While it's important to call lifecycle functions during the component's initialisation, it doesn't matter *where* you call them from. So if we wanted, we could abstract the interval logic into a helper function in `utils.js`... +While it's important to call lifecycle functions during the component's initialisation, it doesn't matter _where_ you call them from. So if we wanted, we could abstract the interval logic into a helper function in `utils.js`... ```js import { onDestroy } from 'svelte'; @@ -33,7 +33,7 @@ export function onInterval(callback, milliseconds) { ...and import it into our component: -```html +```svelte ``` -Open and close the timer a few times and make sure the counter keeps ticking and the CPU load increases. This is due to a memory leak as the previous timers are not deleted. Don't forget to refresh the page before solving the example. \ No newline at end of file +Open and close the timer a few times and make sure the counter keeps ticking and the CPU load increases. This is due to a memory leak as the previous timers are not deleted. Don't forget to refresh the page before solving the example. diff --git a/site/content/tutorial/07-lifecycle/03-update/text.md b/site/content/tutorial/07-lifecycle/03-update/text.md index 0255e845a8d2..3c791245b079 100644 --- a/site/content/tutorial/07-lifecycle/03-update/text.md +++ b/site/content/tutorial/07-lifecycle/03-update/text.md @@ -13,7 +13,7 @@ let div; let autoscroll; beforeUpdate(() => { - autoscroll = div && (div.offsetHeight + div.scrollTop) > (div.scrollHeight - 20); + autoscroll = div && div.offsetHeight + div.scrollTop > div.scrollHeight - 20; }); afterUpdate(() => { diff --git a/site/content/tutorial/07-lifecycle/04-tick/text.md b/site/content/tutorial/07-lifecycle/04-tick/text.md index 8f5603a361af..a457247346bd 100644 --- a/site/content/tutorial/07-lifecycle/04-tick/text.md +++ b/site/content/tutorial/07-lifecycle/04-tick/text.md @@ -4,7 +4,7 @@ title: tick The `tick` function is unlike other lifecycle functions in that you can call it any time, not just when the component first initialises. It returns a promise that resolves as soon as any pending state changes have been applied to the DOM (or immediately, if there are no pending state changes). -When you update component state in Svelte, it doesn't update the DOM immediately. Instead, it waits until the next *microtask* to see if there are any other changes that need to be applied, including in other components. Doing so avoids unnecessary work and allows the browser to batch things more effectively. +When you update component state in Svelte, it doesn't update the DOM immediately. Instead, it waits until the next _microtask_ to see if there are any other changes that need to be applied, including in other components. Doing so avoids unnecessary work and allows the browser to batch things more effectively. You can see that behaviour in this example. Select a range of text and hit the tab key. Because the ` + +