Refactor AstroIsland for readability and extensibility
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3591340. -->
Reported by: [longwave](https://www.drupal.org/user/246492)
Related to !1143
>>>
<h3 id="overview">Overview</h3>
<p><code>\Drupal\canvas_ssr\Element\AstroIsland</code> has a large <code>preRenderIsland()</code> method that does a lot of work and that could be refactored for readability and extensibility.</p>
<p>Also <code>generateSsrTemplate()</code> could use Drupal's Attribute mechanism to build the tags in a cleaner way.</p>
<p>It is difficult to modify this class in custom code without copy-pasting.</p>
<h3 id="proposed-resolution">Proposed resolution</h3>
<p>Refactor the class for readability and extensibility.</p>
<h3 id="ui-changes">User interface changes</h3>
issue