The issue with JS is that each page gets its own execution context so they don’t share any memory. I am actually curious what does the WebView do to save on RAM here?
It doesn't have to "do" anything special if you just use it for rendering HTML, and not for running gargantuan layers of JS frameworks.
If you run gargantuan layers of JS frameworks in a WebView it will perform just as badly as a full browser. After all, a browser is (more or less) just a process wrapped around a WebView.
A decision to move native because of the crisis seems like an expensive populist move to please not very solvent users. Why bother with that if many predict the RAM crisis will last merely until 2027?
Supply of RAM isn't really limited by natural resources - silicon is literally one of the most abundant materials on the planet. It's limited by the construction of billion dollar factories.
And yet if I open Activity Monitor right now: "Emoji & Symbols" is using 1GB of memory, "Spotlight" using 749MB, "Control Center" using 727MB, despite not having used any of the features recently (and additionally restricting Spotlight to index basically nothing or else it'll drain my battery). Each one of those is larger than any of the Electron apps I always have running (Claude, Cursor, Signal, 1Password).
I am currently working on something I call HTMXNative, which is what it sounds like: using HTMX in WebViews for hybrid apps.
I haven't really looked much at memory consumption, but when I've looked so far it's been very comparable to equivalent apps using native UI.