DenoDDeno
Powered by
BhauminB
Deno•13mo ago•
5 replies
Bhaumin

What are the best possible ways to create islands in Fresh?

We are developing a SaaS product using Fresh and are exploring the best ways to structure our islands for optimal organization and maintainability. We've come across two primary methods for defining islands and would appreciate your insights.

Our Current Understanding:

Option 1: Root-Level Islands:
As per the official Fresh documentation (https://fresh.deno.dev/docs/canary/concepts/islands), we can create island components at the root level within the islands folder.


Option 2: Colocated Islands:
According to the Fresh 1.4 release blog (https://deno.com/blog/fresh-1.4#colocated-islands-components-and-more), we can create an (_islands) folder within a route directory, signaling to Fresh that all files within that folder should be treated as islands.
Our Questions:

1. Are there any other recommended or supported methods for defining island components in Fresh, beyond the two options mentioned above? We are looking for the most scalable and maintainable solution for our SaaS product.
2. Is it possible to use a naming convention, such as .island.tsx or .islands.tsx, to designate a component as an island? We are curious if this type of implicit declaration is supported or planned for future releases.

We are aiming to establish a clear and consistent pattern for managing our islands as our project grows. Any advice or best practices you can share would be greatly appreciated.
Deno Blog
Fresh 1.4 – Faster Page Loads, Layouts and More
Discover new improvements in Fresh 1.4 that makes your site quicker to load and comes with several improvements to make authoring complex projects easier.
Fresh 1.4 – Faster Page Loads, Layouts and More
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,944Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

window variable in fresh islands
rnbguyRrnbguy / help
4y ago
How to load islands in Fresh 2.0 plugins?
Donald BidenDDonald Biden / help
2y ago
[Fresh 2] How to reference DOM types in Islands?
vicaryVvicary / help
6mo ago