Good job babe!!!! Also almost to 90k 😳 ❤ Happy Valentine’s Day everyone but especially Cody 😘
@WebDevCody Жыл бұрын
thank you beautiful!
@analogsensor Жыл бұрын
Great video! Btw Astro has its own Image component @astro/image, it can optimize images to save a lot of space
@WebDevCody Жыл бұрын
Nice I didn’t know that
@KoOcie92 Жыл бұрын
The difference between bundle sizes has been explained in recent video posted by Jack Herrington
@WebDevCody Жыл бұрын
Yeah I saw he posted something, still need to wat h
@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 Жыл бұрын
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 Жыл бұрын
@@WebDevCody Yeah actually I commented right when you showed the code and said "Tell me if I'm doing something wrong" 🙂
@WebDevCody Жыл бұрын
@@MaxProgramming haha yeah I spoke too soon in my video 😂 but thanks for the feedback!
@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 Жыл бұрын
That’s correct I do not need state, I could just use an uncontrolled input, but react doesn’t recommend that
@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 Жыл бұрын
@@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 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
@@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 Жыл бұрын
Now imagine using it with something like qwik or svelte, where the js is compiled and no unnecessary js is shipped
@noahwinslow3252 Жыл бұрын
So solid is the next one you're trying then, huh
@WebDevCody Жыл бұрын
I haven’t really looked into it yet
@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 Жыл бұрын
Great video 🔥Can we get the video about deno and fresh ?