square-oyster-36295
10/09/2022, 1:18 PMmergeHead function and related functions - https://github.com/hotwired/turbo/blob/4e8ba783419cc01c0aa42d01cbca313e28b35016/src/core/drive/page_renderer.ts#L62
Their implementation even manages to perfectly merge, for example, in the case of the DEV mode of web development in Astro, which inserts inline or tags into the in addition to external links to JS/CSS. Everything is inserted and interpreted correctly. Duplicate content is not inserted there when browsing the web. At the same time, what happens is that the and tags are not removed, only added, because that would cause flickering and broken content when replaced.
Unlike HTMX, Turbo has a very limited use, but it can merge headers flawlessly.
By the way, I've mentioned it somewhere before, but we're looking to use HTMX by having a headless CMS and using Astro for the frontend. We use it for projects either in SSG mode, or for more dynamic projects with filter forms, in SSR mode. We generate 99% of HTML code only in SSR mode. In any case, we no longer want to strive for an isomorphic code, which is why we choose the Astro + HTMX way.
All pages and their URLs return complete HTML. Astro uses Vite and generates in the only the CSS and JS needed on the page. The production build includes a couple of external JS/CSS chunks in the related to current page. We also have little inline JS/CSS in selected components.