What is the appetite for changing from using custom HTML tags to instead using tags from an XML namespace and prefix? This will avoid IDE / parser warnings, and allow (if desired) for a DTD to help with auto-completion in IDEs.
The following example uses no more characters in the tag than the current
turbo-frame, at the expense of an XML namespace declaration in the
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:turbo="https://turbo.hotwire.dev" lang="en"> <body> ... <turbo:frame id="the_frame"> <p>Hello, <span>world</span>!</p> </turbo:frame> </body> </html>
For correctness, this would require the turbo.js to inspect the
html element for an
xmlns with the appropriate URL (e.g.
https://turbo.hotwire.dev) and extract the nominated prefix (e.g.
turbo) and use that value in the logic where it currently looks for elements called
turbo-frame. Each loaded page could (although normally wouldn’t) have a different prefix.
Nonetheless, an initial implementation need not do that work and simply assume a
turbo namespace prefix is used in the xmlns declaration. The existing implementation could even fall-back to
turbo-frame when no xmlns was specified (for “legacy” code).