Replies: 5 comments 1 reply
-
It seems that what I'm asking is similar to what is discussed in #326 (comment) and proposed in #350 |
Beta Was this translation helpful? Give feedback.
-
I suppose I should have posted this question in the discussion tab. I'm sorry. |
Beta Was this translation helpful? Give feedback.
-
Components are static, islands are dynamic. They should be split across folders as such. You should never have static islands. Interactive means you need to do some logic client side, for example |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm trying to figure out how to best distinguish islands and components. As far as I understand,
On this ground, I have tested in my own project and found that: While 3 and 4 work in a certain condition, I suppose both 3 and 4 are against "all components should be static". If all these are true, how one can explain "Carousel" component from the gallery? useSignal and useEffect are used there, and clicking events are something that must be handled client side. I've read #326 as well:
I suppose this might be the reason and, here I'm confused: should we strictly build something an island as long as it is interactive? or just OK to make it as a component to avoid island nesting? |
Beta Was this translation helpful? Give feedback.
-
I'm new to fresh, but as far as I understand:
All in all, I think the purpose of fresh is to encourage static server rendered pages. Nowadays, most websites make use of React, Angular and other frameworks which make it easy to create static sites or SSR sites, but they both require some javascript to work client side. Instead, Fresh only serves static content by default, without any javascript, which is restricted to islands alone. |
Beta Was this translation helpful? Give feedback.
-
/components
folder for my.tsx
components if they are not strictly interactive like islands supposed to be? Or do I need to put such components inside/island
directory no matter if they are interactive or not?.tsx
files in/islands
directory) treated differently from just regular.tsx
components? If I do this......how exactly it is being treated differently from this...
I did read about island architecture and somewhat understood it, so my questions are more about best practices (or at least how people think it should be done) of creating an app with Fresh.
Beta Was this translation helpful? Give feedback.
All reactions