Closed karimfromjordan closed 1 year ago
Regarding the split, I think I'm erring on the side of fewer examples here, i.e. merge 1/2 and 3/4 into one each, or even all into one - not sure. The general idea is good 👍
Ok, yeah merging them as much as possible is probably better. I could create a Node.js and S3 example.
Btw. how much styling should examples have? Are examples allowed to be pretty (CSS, Svelte transitions) or would that add too much noise?
I'd say the should be pretty - people also decide what to chose based on looks I'd guess. That said, it shouldn't be so much that it distracts from the core thing. So for example a bunch of CSS is fine (because that's tucked away in <style>
blogs) and a transition here and there is nice, but if it requires a bunch of extra JS/HTML code/logic then that's probably too much.
Should we adopt a specific naming convention or file structure? For example, since this repo is for both Svelte and Kit examples should kit examples always start with sveltekit-
or should we perhaps not use prefixes at all or use sub folders instead?
Good question. We could go top level sveltekit-examples
and svelte-examples
One 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
becausefetch
does not support progress calculation yetfiles/+server.js
route to demonstrate how to serve user uploaded filesXMLHttpRequest
becausefetch
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.