ElMassimo / iles

🏝 The joyful site generator
https://iles.pages.dev
MIT License
1.07k stars 31 forks source link

Allow Vue islands to be nested #165

Open ElMassimo opened 2 years ago

ElMassimo commented 2 years ago

Description 📖

In some use cases it can be convenient to ignore client directives when an ancestor component is already an island.

An example from this thread:

  - EventContent
     - EventDetails (client:load)
         - NewsSubscription
             - EmailSubscription (client:load)

and

  - EventsContent
     - NewsSubscription
         - EmailSubscription (client:load)

Implementation Details ⚙️

During page generation, it would be necessary for Island to provide a context, which can be detected by nested islands, to avoid rendering an additional client-side script and instead simply render the inner component.

Additionally, when building the client bundle, it would be necessary to replace Island with a no-op implementation, to avoid injecting an additional script to hydrate that inner component.

Further discussion is needed to understand the impact on style extraction, and whether these two changes are actually implementable.