sveltejs / examples Goto Github PK
View Code? Open in Web Editor NEWA collection of Svelte(Kit) examples
License: MIT License
A collection of Svelte(Kit) examples
License: MIT License
Similar to #3. and a very frequently asked question on Discord. I'm not sure however if this example should use plain websockets or the socket.io library. And to make this example self contained we probably have to use the Vite development server to setup the websocket server and mention that you need a separate websocket server in production.
For the actual content, would a simple chat app to demonstrate the bidirectional nature of websockets be too much for an example? Also, this example could use either plain Svelte or SvelteKit. I think the most important part to show here would be how to manage a websocket connection with a custom store. And if it's a chat app the store could just be extended with a store.send_message()
function.
This surprisingly came up several times this week on Discord โ a page that should fetch, filter and search some data through a <form>
and search params in load
. My idea was a simple products, words, fruits etc. page which:
<input type="search" />
to search for specific items<input type="search" />
submits the form on:input
(debounced)on:change
Map
that acts as a databaseOne question that regularly comes up is how to handle file uploads in SvelteKit. Maybe this could be broken down into four examples.
files/+server.js
route to demonstrate how to serve user uploaded filesXMLHttpRequest
because fetch
does not support progress calculation yetfiles/+server.js
route to demonstrate how to serve user uploaded filesXMLHttpRequest
because fetch
does not support progress calculation yetFor the UI each example could show a simple form with a file input and upload button. Underneath it we could show a list of uploaded files, optionally with a delete button.
A minimal blog with simple DX that supports markdown would be a great addition.
SvelteKit makes it really easy to do page transitions with svelte/transition
. It would be cool to have a go-to example for this. This is how I've been doing it, but would love to know if there's a better way:
I'm not sure how complex an SSE (Server Sent Events) example should be. But since the actual SSE part on the backend is super simple we could combine it with a toast component to make it more "real world". SSE and websockets are also great to demonstrate custom stores.
+server.js
route to return a ReadableStream
response for the SSE connectionA declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.