New SvelteKit feature: `import { read } from '$app/server'`

  Рет қаралды 14,291

Rich Harris

Rich Harris

4 ай бұрын

You can now read data directly from the filesystem with no mucking about
Demo links:
- fowl-play.vercel.app/
- sveltekit-pdf-demo.vercel.app/
Source code:
- github.com/Rich-Harris/fowl-play
- github.com/Rich-Harris/svelte...

Пікірлер: 56
@ScriptRaccoon
@ScriptRaccoon 4 ай бұрын
It's very cool to get these updates directly from you, Rich :). Just a small suggestion for improvement: can you please increase the font size in your editor? Currently you show about 50 lines, for KZbin (which is also consumed on mobile devices) it would better to have around 25 lines. Then it is easier to follow what is happening in the code.
@rich_harris
@rich_harris 4 ай бұрын
i know, sorry - still new at this 😅 i thought it was recording at a higher res
@Joseph-zd8jw
@Joseph-zd8jw 4 ай бұрын
@@rich_harris The audio was also a little low
@kirso
@kirso 4 ай бұрын
​@@rich_harris will be a proper KZbin Tech influencer in no time!
@lian1238
@lian1238 4 ай бұрын
KZbin has pinch to zoom.
@lolotronop
@lolotronop 4 ай бұрын
@@rich_harris It's not about res, it's about size on screen. Even at 4k code that small would be really hard to read on a phone. Sorry if I'm overexplaining a bit, just to be 100% clear
@todormarkov2860
@todormarkov2860 Ай бұрын
Even before the first release I have been following the progress, I can't wait for Svelte 5 to come out.Congratulations Rich for the brilliant design, simplicity and intuitiveness behind Svelte
@afrowave
@afrowave 4 ай бұрын
This is excellent. It will work really well for static sites that are Markdown driven.
@Ryguy12543
@Ryguy12543 4 ай бұрын
Love all the KZbin content you’ve been featured in lately. About time I found your channel. Thanks for the content big man very helpful as always🔥
@mazedeux
@mazedeux 4 ай бұрын
Thank you for the tutorial on duck typing sir
@Huntabyte
@Huntabyte 4 ай бұрын
This is dope!
@scaffus
@scaffus 4 ай бұрын
And you are too!
@readywhen
@readywhen 4 ай бұрын
@@scaffus hihi compliments
@scaffus
@scaffus 4 ай бұрын
@@readywhen 😄
@peppi69
@peppi69 4 ай бұрын
Very nice that is exactly what i need for my current projects. Instead of writing some very sketchy code or having to store base64 in a database I'd rather do this.
@gabrielmfern
@gabrielmfern 4 ай бұрын
4:47 you've been slacked
@SilvestreVivo
@SilvestreVivo 4 ай бұрын
In Rich we trust
@computerfan1079
@computerfan1079 4 ай бұрын
Amen
@hellodefhellow
@hellodefhellow 3 ай бұрын
Bruh rich is cool ashit, i like how he tryna make sveltekit the modern ruby on rails,long story short im starting a new business, choosing the right stack was difficult for me as i have only 1 year of web dev knowledge, i was confused between laravel and sveltekit, but i choose sveltekit.
@scaffus
@scaffus 4 ай бұрын
So that's what sveltekit-pdf-demo was, very cool!
@-ion
@-ion 4 ай бұрын
This sounds very useful for me. I import certain images on pages to get an immutable file that can be cached for a long time with a hash in the URL. However, I would also like the pages to have og:image:url metadata which needs a permanent URL for the image which should mutate when updated. Once read works with other adapters, it sounds like I will be able to use it to solve this nicely.
@junaga2
@junaga2 4 ай бұрын
jo jo gang
@damnnn.
@damnnn. 4 ай бұрын
I LOVE SVELTE+
@jenslindo
@jenslindo 4 ай бұрын
cool! is there already a solution for responsive images in sveltekit that adapts the image on the width needed for the current screen size - that would be more of a real world image problem (maybe)
@pietraderdetective8953
@pietraderdetective8953 4 ай бұрын
Cool feature! Can you please increase your font size? It's too small for mobile phone users. Please make it larger, thanks!
@Programming-Fun-With-Hima
@Programming-Fun-With-Hima 4 ай бұрын
💗💙💜💛❤🧡
@coolemur976
@coolemur976 4 ай бұрын
Dude needs a glass of water
@Kevin192291
@Kevin192291 4 ай бұрын
Svelte becomes better and better :)
@mustofa_id
@mustofa_id 4 ай бұрын
I can't believe Rich uses dark theme
@sahar23391
@sahar23391 4 ай бұрын
rich the content creator > rich the developer
@seabass_1
@seabass_1 4 ай бұрын
My usual comment of I don't fully get it but when I watch it 5 more times over the next week I'll be wowed. I already think I'll use it in a case where I have an endpoint to get permissioned files and I get my dirty signed supabase url and want to pass that to the user through my pretty endpoint like /storage/[some_id] or something. I'm guessing this will improve my current implementation once I understand it more
@fredguth1315
@fredguth1315 4 ай бұрын
I can't see the code very well. Is there a higher res version?
@jonathangamble
@jonathangamble 4 ай бұрын
Hey Rich, this would go well with vercel/og image if you could speak to Vercel to make it compatible with SvelteKit.
@rich_harris
@rich_harris 4 ай бұрын
yep, perfect use case! you _can_ use satori (the thing that powers vercel/og) with SvelteKit - Geoff did a great write-up [here](geoffrich.net/posts/svelte-social-image/). We use this technique to render the OG cards on svelte.dev (e.g. svelte.dev/blog/runes/card.png), and [here's a PR](github.com/sveltejs/svelte/pull/10246/files) to remove all the hackery that's no longer required thanks to this new feature
@jonathangamble
@jonathangamble 4 ай бұрын
Problem is it won't work on the edge until Vercel fixes a font error. Maybe you could push it up the chain 😊
@rich_harris
@rich_harris 4 ай бұрын
ah, well `read` doesn't work on the edge either at present - there's no filesystem. experimenting with using `fetch` to just grab the asset from the CDN (which is obviously less good than reading from the same machine but probably still perfectly usable). will see which buttons i can push
@BaptistPiano
@BaptistPiano 4 ай бұрын
@@rich_harris **love** the shameless use of markdown where it’s not supported! I do the same thing
@c3cris2
@c3cris2 4 ай бұрын
Upload with at least 1080p so the code isn’t a blurry mess. Thank you.
@ScriKidding-eg6vn
@ScriKidding-eg6vn 4 ай бұрын
🎉🎉🎉🎉🎉🎉🎉🎉🎉 my idol
@maxburkhardt1
@maxburkhardt1 4 ай бұрын
Why can I not use $lib or get it from static?
@samuswarner
@samuswarner 4 ай бұрын
Awesome - I had exactly the same 'your file read doesn't work in prod because the build doesn't know to include them' issue and had to build a brittle fix for it. Now I can remove all of that code. @richharris, since you asked, my specific use-case for this is serving js scripts (as text with permissive CORS headers) from my sveltekit application, for consumption by other frontend apps.
@Woeden
@Woeden 4 ай бұрын
Hello Mr. Rich
@chepossofare
@chepossofare 4 ай бұрын
GOOSE PALOOOSE
@wyndmill
@wyndmill 4 ай бұрын
RADICAL
@look997
@look997 4 ай бұрын
Oh.
@zomakaja
@zomakaja 4 ай бұрын
First
@whatplan4335
@whatplan4335 4 ай бұрын
Larger font size please Unwatchable on mobile
@aurorapaisley7453
@aurorapaisley7453 4 ай бұрын
Why is your video quality in 720p
@asimshamim113
@asimshamim113 4 ай бұрын
"fowl play" lmaoooo
@DanteMishima
@DanteMishima 4 ай бұрын
Zoom your code Rich, I implore you
@MaxHDeveloping
@MaxHDeveloping 4 ай бұрын
Please upload your Videos in a higher quality or increase your text size. It is very hard to read the code
@RasmusSchultz
@RasmusSchultz 4 ай бұрын
can't hear you. normalize your audio, please.
@aralroca
@aralroca 4 ай бұрын
In the framework I'm doing I preferred to create a prebuild folder where the server assets are placed and then an environment variable to access it but with more flexibility for developers. For example when loading compiled files to use FFI you have to specify the path, read is not useful here. I think it is better to give flexibility to use the own api of the runtime platform.
5 Things I Wish I Knew When I Started Using SvelteKit
7:27
Ben Davis - Tech
Рет қаралды 9 М.
Laravel's secret weapon: macros (watch me code)
23:46
Aaron Francis
Рет қаралды 18 М.
Как быстро замутить ЭлектроСамокат
00:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 13 МЛН
IS THIS REAL FOOD OR NOT?🤔 PIKACHU AND SONIC CONFUSE THE CAT! 😺🍫
00:41
Sprinting with More and More Money
00:29
MrBeast
Рет қаралды 171 МЛН
Svelte 5 runes: what's the deal with getters and setters?
11:22
Rich Harris
Рет қаралды 40 М.
i didn't know these svelte tips
18:56
Nev the Dev
Рет қаралды 2,3 М.
I Tried Every Svelte UI Library
20:57
Joy of Code
Рет қаралды 40 М.
Is HTMX a Joke??
32:15
Syntax
Рет қаралды 16 М.
Why SvelteKit is Great
22:18
Ben Davis - Tech
Рет қаралды 7 М.
Svelte 5 is a beast, but is it worth switching?
37:55
Syntax
Рет қаралды 19 М.
Rich Harris on frameworks, the web, and the edge
34:10
Vercel
Рет қаралды 107 М.
Svelte Hot Takes - Reacting To Web Hot Takes from Rich Harris
1:01:07
Theo - t3․gg
Рет қаралды 52 М.
Crafting Magical Spells Using Svelte's Powerful Reactivity
13:53
Joy of Code
Рет қаралды 10 М.