How much smaller is an Astro build compared to Next?

  Рет қаралды 3,293

Web Dev Cody

Web Dev Cody

Күн бұрын

Пікірлер: 24
@SeibertSwirl
@SeibertSwirl Жыл бұрын
Good job babe!!!! Also almost to 90k 😳 ❤ Happy Valentine’s Day everyone but especially Cody 😘
@WebDevCody
@WebDevCody Жыл бұрын
thank you beautiful!
@analogsensor
@analogsensor Жыл бұрын
Great video! Btw Astro has its own Image component @astro/image, it can optimize images to save a lot of space
@WebDevCody
@WebDevCody Жыл бұрын
Nice I didn’t know that
@KoOcie92
@KoOcie92 Жыл бұрын
The difference between bundle sizes has been explained in recent video posted by Jack Herrington
@WebDevCody
@WebDevCody Жыл бұрын
Yeah I saw he posted something, still need to wat h
@MaxProgramming
@MaxProgramming Жыл бұрын
From what I know about Astro to take full advantage of the Islands Architecture, the interactive part like the email input should be put in another component. And all the other static code that you have like everything except that input or form, can be directly put in the astro file so that it doesn't take time to load In the example, all the index code was in React, which might take away the benefits of Astro a little bit I guess
@WebDevCody
@WebDevCody Жыл бұрын
yup, which is what I ended up doing in this video near the end. I put all the static stuff inside .astro and moved the interactive form into a react component.
@MaxProgramming
@MaxProgramming Жыл бұрын
@@WebDevCody Yeah actually I commented right when you showed the code and said "Tell me if I'm doing something wrong" 🙂
@WebDevCody
@WebDevCody Жыл бұрын
@@MaxProgramming haha yeah I spoke too soon in my video 😂 but thanks for the feedback!
@haiiry
@haiiry Жыл бұрын
You don't need onchange for keeping email, aren't you? You can simply handle onsubmit, since you are already wrapping in in the form. Correct me if I'm missing something.
@WebDevCody
@WebDevCody Жыл бұрын
That’s correct I do not need state, I could just use an uncontrolled input, but react doesn’t recommend that
@haiiry
@haiiry Жыл бұрын
@@WebDevCody I've seen your video a while back where you were talking about uncontrolled using ref. For that case, when you want to access inputs to restore default values, I think controlled version is undoubtedly a winner. However when you just need to get input's value after form submission (like in this case, for news subscription), you can handle onSubmit and get values from event.currentTarget.
@jasinrefiku2914
@jasinrefiku2914 Жыл бұрын
@@WebDevCody Handle it via a useRef or react-form hook, it's entirely worthless to use a state and re-render a whole component for a single onChange (I suppose that's what you did)
@Andres-it2du
@Andres-it2du Жыл бұрын
I have a question about Astro routing. I've tried it for a somewhat static blog site, but I had a react component that was responsible for the table of contents, and when I looked at what was transfrerred over the network I noticed that the base react code (around 500kB) was downloaded for each static (mdx) page. Did I miss something there or is it just how Astro routing works?
@WebDevCody
@WebDevCody Жыл бұрын
Do you have dev tools setup? You need to make sure you open in an incognito window and that you host the built static site and not just do a npm run dev. If you’re react component contains no logic, it shouldn’t download JavaScript unless you do client:load on the component
@Andres-it2du
@Andres-it2du Жыл бұрын
@@WebDevCody Thank you so much, Cody! Turns out I misinterpreted the script that was loaded, it was some Chrome extension, not the page code. I'm using preact and the ToC does have some js logic and there is a client:load on the component, but the code being loaded is just 113 bytes, so it's totally fine. It does still load on every page that uses ToC though since it isn't an SPA and we are basically getting a new page every time. Thanks a lot again, you really helped me a lot :)
@omomer3506
@omomer3506 Жыл бұрын
Now imagine using it with something like qwik or svelte, where the js is compiled and no unnecessary js is shipped
@noahwinslow3252
@noahwinslow3252 Жыл бұрын
So solid is the next one you're trying then, huh
@WebDevCody
@WebDevCody Жыл бұрын
I haven’t really looked into it yet
@noahwinslow3252
@noahwinslow3252 Жыл бұрын
@@WebDevCody let us know how it goes! I'm still feeling out react but for all the canvas and three js stuff it seems like the performance gains will be worth it
@abdulhajiyev
@abdulhajiyev Жыл бұрын
Great video 🔥Can we get the video about deno and fresh ?
@SabarMohamed
@SabarMohamed Жыл бұрын
Great video, I think I might give Astro a shot
@WebDevCody
@WebDevCody Жыл бұрын
It’s interesting!
Astro Crash Course in 20 Minutes!
22:07
Coding in Public
Рет қаралды 57 М.
Astro makes websites faster & easier to build
22:55
Kevin Powell
Рет қаралды 121 М.
Остановили аттракцион из-за дочки!
00:42
Victoria Portfolio
Рет қаралды 3,7 МЛН
escape in roblox in real life
00:13
Kan Andrey
Рет қаралды 89 МЛН
когда не обедаешь в школе // EVA mash
00:57
EVA mash
Рет қаралды 3,4 МЛН
pumpkins #shorts
00:39
Mr DegrEE
Рет қаралды 9 МЛН
Everyone's Making Fun of Next.js 14.0
7:16
Josh tried coding
Рет қаралды 134 М.
You don't need a frontend framework
15:45
Andrew Schmelyun
Рет қаралды 126 М.
Laravel vs Rails for Javascript developers
19:50
Sam Lewis
Рет қаралды 2,5 М.
Here's an overview of all my revenue generating side projects
19:38
Learn How To Use Svelte 5 Snippets
17:41
Joy of Code
Рет қаралды 8 М.
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 478 М.
You may not ACTUALLY understand Content Collections…
42:03
Coding in Public
Рет қаралды 12 М.
How modern web apps are rendered
6:52
Awesome
Рет қаралды 19 М.
The BEST way to host Next.js websites
17:37
ByteGrad
Рет қаралды 47 М.
Thoughts About Unit Testing | Prime Reacts
11:21
ThePrimeTime
Рет қаралды 225 М.
Остановили аттракцион из-за дочки!
00:42
Victoria Portfolio
Рет қаралды 3,7 МЛН