3 ms·
On the part about adding interactivity: > "To include this in a page component, one can just use the component normally. Fresh will take care of automaticall
by gavinray 4y ago
On the part about adding interactivity:
> "To include this in a page component, one can just use the component normally. Fresh will take care of automatically mounting the island component on the client with the correct props:"
How does a developer know what rendering is going to take place client-side vs server-side, and is there any way to control this?
Or is it all fully "magical"
- gigatexal 4y agoYeah this seems like a pain. I don’t like magic. Magic is hard to debug.
- lucacasonato 4y agoIt's not magic. There is an `islands/` folder that you must place all of your client components in. 1 component per file. See https://fresh.deno.dev/docs/getting-started/adding-interactivity https://fresh.deno.dev/docs/getting-started/adding-interacti...
- norman784 4y agoIf I understood correctly, it all renders server side and then adds the interactivity where it's necessary, and in a react app is kinda easy to spot which components are interactive or not, the biggest difference here, vs a traditional react framework, is that fresh is more similar to astro[0] than next.js/remix, so it ships less js. What I read from other comments is that fresh does code splitting, so for example if the interactivity is out of your viewport and you scroll down to that element, it will then load the js required to make it interactive, while I find that idea cool, what worries my is that it could take a few ms to load the js and then other few ms to boot that component and render it interactive. But I don't have experience with any of the frameworks (besides next.js where I build a small demo project to try it out). [0] https://astro.build https://astro.build
- justshowpost 4y agoWell, you know by seeing that the component is located in the special `islands` folder.