
LayerChart 2.0 Released
This includes the Svelte 5 rewrite, CSS framework agnostic, improved API and state, numerous new components and chart types, and so much more!
u/thebreadmanrises — 2 days ago

This includes the Svelte 5 rewrite, CSS framework agnostic, improved API and state, numerous new components and chart types, and so much more!
Logic can now be used via vite.config.ts: Update
Example:
import
{ sveltekit }
from
'@sveltejs/kit/vite';
import
{ defineConfig }
from
'vite';
import
tailwindcss
from
'@tailwindcss/vite';
import
adapter
from
'@sveltejs/adapter-auto';
import
{ vitePreprocess }
from
'@sveltejs/vite-plugin-svelte';
export
default
defineConfig({
plugins: [
sveltekit({
preprocess: vitePreprocess(),
compilerOptions: {
experimental: {
async: true
}
},
alias: {
$db: 'src/lib/server/db',
$ui: 'src/lib/components/ui',
$utils: 'src/lib/utils',
$constants: 'src/lib/constants'
},
experimental: {
remoteFunctions: true
},
adapter: adapter()
}),
tailwindcss()
],
ssr: {
noExternal: ['layerchart']
}
});
Variables and state can now be defined in templates with a much more svelte-approach {let cool = $state(true)}
Also means state in snippets.
Has there been any indication when remote functions/async svelte will be moved out of the experimental phase?
Has anyone else found Tanstack Start + Query very complex?
Looking as this createFileRoute & the component page there is a lot of boilerplate going on:
export
const Route = createFileRoute('/(app)/_layout/clients/')({
component: ClientListPage,
validateSearch: searchSchema,
errorComponent: () => <div>Error loading clients</div>,
loaderDeps: ({ search: { sort, order } }) => ({ sort, order }),
loader: async ({ context: { queryClient }, deps: { sort, order } }) => {
await
queryClient.ensureQueryData({
queryKey: clientKeys.list(sort, order),
queryFn: () => getClients({ data: { sort, order } }),
})
},
})
function ClientListPage() {
const queryClient = useQueryClient()
const navigate = useNavigate()
const { sort, order } = Route.useSearch()
const { data: clients } = useSuspenseQuery({
queryKey: clientKeys.list(sort, order),
queryFn: () => getClients({ data: { sort, order } }),
staleTime: 5 * 60 * 1000,
})
I also find the use of the query client with the router complex.