Helge
Helge
Explore posts from servers
SSolidJS
Created by Helge on 1/28/2024 in #support
Use solid as middleware
Goal: parse existing html from third party server, read all data-component attributes from HTML, load dynamic component based on data-component attribute and then return newly rendered HTML w/ interactivity. Hi I would like to create a Solid-Middleware so to speak. I want to parse a given HTML and look for tells to load components dynamically and then return it all to the browser. How would you start doing this? The following markup would be for example fetched dynamically based on given slug
<html>
<body>
<h1>this is a headline</h1>
<p>some para text</p>
<div data-component="features"></div>
<p>some more text</p>
</body>
</html>
<html>
<body>
<h1>this is a headline</h1>
<p>some para text</p>
<div data-component="features"></div>
<p>some more text</p>
</body>
</html>
The goal is to parse, load features.tsx, render it on the server and also make it so that it can be used with interacitivty on the client Any advice is welcome.
15 replies