{Bhide}.Svelte

@bhidesvelte.bsky.social

I Love Svelte Building Svelte Animations, Svelte AI Elements, Marketing Blocks https://bhide.dev

📊 LayerChart 2.0 is officially released! After ~16 months of development and 67 pre-releases, the official 2.0.0 release has been published! 🎉 This includes the Svelte 5 rewrite, CSS framework agnostic, improved API and state, numerous new components and chart types, and so much more!

Bild

SvelteKit 2.63.0 just got released, and env vars are now handled much better than before! 🔥 Here is a quick recap:

<!-- Before -->
<script>
  // Requires running at least `svelte-kit sync` to discover
  // Requires `publicPrefix` prefix
  // Always `string`
  import { PUBLIC_APP_ID } from "$env/static/public";
  // Properties require `publicPrefix` prefix
  // Properties can be arbitrary, thus typoed
  // Properties always `string | undefined`
  // Conflicts with the same import from `$env/dynamic/private`
  import { env } from "$env/dynamic/public";
  // Same logic with the `.../private"` counterparts (without
  // the prefix limitation)
</script>// After
// `src/env.ts`
import { defineEnvVars } from "@sveltejs/kit/hooks";
import * as v from "valibot"; // or any Standard Schema-compatible lib

export const variables = defineEnvVars({
  DEBUG: {
    public: true, // defaults to private (`false`), no need for a prefix
    static: true, // evaluated at build-time (like `"$env/static/...`), can be used for treeshaking (defaults to `false` = evaluated at runtime)
    description: "Enable debug logs and devtools", // LSP documentation!
    schema: v.pipe( // optional validation schema
      v.optional(v.string(), ""), // can both be validated...
      v.transform(str => !!str) // ...and converted to any type with a single schema!
    )
  },
  // ...
});

// Can then be imported with:
import { DEBUG } from "$app/env/public"; // or `/private` if `public: false`
// Typed as `boolean`, eliminates conditional branches depending on its value,
// AND carries its description on hover!// Still experimental! Enable it since Sveltekit 2.63 with the following config:
// svelte.config.js
export default {
  kit: {
    experimental: {
      explicitEnvironmentVariables: true
    }
  }
};

// OR
// vite.config.ts
import adapter from "@sveltejs/adapter-auto";
import { sveltekit } from "@sveltejs/kit/vite";
import { defineConfig } from "vite";

export default defineConfig({
  plugins: [
    sveltekit({
      // ...
      adapter: adapter(),
      experimental: {
        explicitEnvironmentVariables: true
      }
    })
  ]
});

the single biggest criticism svelte has received over the years is 'you can't have multiple components in a file'. so we fixed it! by making them unnecessary. with declaration tags (svelte.dev/docs/svelte/...), snippets/each blocks/etc can have their own state: svelte.dev/playground/a...

a screenshot of https://svelte.dev/playground/aaac159f0f73466bb3859dfed6792cab?version=latest, demonstrating state-in-snippets
Antoine@antleth.fr · 2mo ago

@const is dead, long live const! Svelte 5.56 allows for raw let/const ANYWHERE in the markup within {} brackets, deprecating {@const} This is huge! svelte-changelog.dev/pull/sveltej...

📊 LayerChart: Dodge, Waffle, and more 🏃 New Dodge component 🧇 New Waffle component 🖼️ Canvas: Blur support, improved Pattern (pixel-perfect alignment with SVG, high DPI) 🏎️ Perf improvements details👇

TIL from @syntax.fm (#997) about github.com/SikandarJODD...: It’s a Svelte version of www.agentation.com and enables UI annotations as feedback for agents. And then I open this month‘s what’s new in Svelte newsletter and it’s featured there as well: svelte.dev/blog/whats-n...

GitHub - SikandarJODD/sv-agentation: Svelte Agentation : The visual feedback tool for agents.

Svelte Agentation : The visual feedback tool for agents. - SikandarJODD/sv-agentation

github.com

📊 LayerChart: "svelte" edition 🪶 The latest release reduces bundle sizes by 50-70%+ ✔︎ Layer-specific components/imports ✔︎ New `ChartCore` for further reduced bundles ✔︎ Lazy load interactivity ✔︎ Faster Svelte REPL usage ✔︎ SSR images (0KB client-side) 🧵 more...

Bild

Some random facts: - current Svelte version is 5.55.5 - it’s the 587th update for Svelte 5 (est. 2023-11-10) - SvelteKit had 213 - April 2026 means that I’ve been using v5 for ~2 years now I’m still discovering new perks each week, but by now I think I’ve looked at each API & config once at least?

Svelte 5 & SvelteKit 2 Journey

lab.fubits.dev