This is intentional. Carton doesn't offer a lot of integration with existing web apps.
I wanted a more realistic approach, where you write the UI in JavaScript/TypeScript, not JavaScriptKit, and then just call into a Swift module for your business logic.
I tried building the Connect Four example using Carton and JavaScriptKit, but I wouldn't recommend going down that road. Code using JavaScriptKit is just as ugly and unsafe as actual JavaScript code, with even more complexities and less IDE support.
WASI imports and exports are probably the way to go, but they currently require complicated workarounds if you want to pass strings or structs. WASI Preview 2 should remove the need for those workarounds, but I have no idea when that will be supported in SwiftWasm.