marko-js-archive / marko-starter

MIT License
30 stars 8 forks source link

Throw error in development mode if a page is served without a `<head>` and `<body>` #6

Open mlrawlings opened 7 years ago

mlrawlings commented 7 years ago

marko-starter injects stylesheets and scripts at the end of the <head> and <body> tags. If they're not there, the page doesn't have styling or functionality.

I imaging this could be confusing if you created a page that just had

<h1>Hello world</h1>
<counter/>

and your counter just wasn't working.

I'm thinking we may need to monkeypatch response.end to do this, but it would only be in development mode. Is there a better way we could display this error?