With svelte you can compile to custom elements, so it would be relatively easy to enhance the web app without going all-in on a framework. If you have a part of the page you want to enhance, you can create a svelte component and have it available as <cool-component>
in your html. You don’t need to go the SPA way.
However, when it comes to enhance existing dom nodes, without re-rendering everything, I’m not sure of how it would work with svelte.
As a side note, Andrea Giammarchi’s libraries are excellent for that; the combination of uhtml(or lighterhtml ) with wicked-elements(or maybe even hooked-elements) is great for enhancing certain parts of your web app. I’ve been progressively replacing some parts of my app with custom elements build with those libraries and it’s been a nice experience so far. They’re tiny, fast and leverage the web platform instead of creating a whole new paradigm.
Worth noting, they’re libraries, and sadly not as popular as svelte(though featured in some webs and platforms like components.studio and webcomponents.dev ). It’s not a framework or platform with opinions on how you should design your components or the data flow.
You can render everything from the component, or enhance existing dom nodes like you would with stimulus, but for a fraction if it’s size. The choice is yours.
To me, the basic(and painful) problems when enhancing some part of a web page were automatically mounting behavior on certain elements, securely(and ergonomically) defining it’s markup(no innerhtml nor string concatenation), and efficiently re-rendering when data changes(dom diffing). Those tiny libraries helped a lot to solve those problems.