Rendering a page from an .html files results in a different HTML output than rendering a page from an .mjs template file with that doesn't use the store.
Problem
The problem is that this makes for an inconsistent author experience and complicates page level styling as there is an extra layer that is sometimes there that they then may or may not have to deal with.
Current situation
Rendering from .mjs
// api/test.mjs
export function get () {
return {
'json': {},
};
}
// pages/test.mjs
export default function test () {
return html`
<h1>This is a title</h1>
`;
}
Results in:
<body>
<page-test>
<h1>This is a title</h1>
</page-test>
</body>
Rendering from .html
<!-- pages/test.html -->
<h1>This is a title</h1>
Results in:
<body>
<h1>This is a title</h1>
</body>
Desired situation
At the very least, both situations should result in the same output so authors have a predictable output where they can apply styling to.
The most desired situation is that .mjs files are rendered like the .html files without the wrapper element so the framework is as little in the way as possible and authors can decide if they want a wrapper element, and if so what its signature is.
If a wrapper element is needed, changing the signature from <page-test> to something like <enhance-page route="test"> is preferable. That way there is a predictable element name that can be targeted with CSS and is easier queryable for folks that want JS access for some reason.
Rendering a page from an
.htmlfiles results in a different HTML output than rendering a page from an.mjstemplate file with that doesn't use the store.Problem
The problem is that this makes for an inconsistent author experience and complicates page level styling as there is an extra layer that is sometimes there that they then may or may not have to deal with.
Current situation
Rendering from
.mjsResults in:
Rendering from
.htmlResults in:
Desired situation
At the very least, both situations should result in the same output so authors have a predictable output where they can apply styling to.
The most desired situation is that
.mjsfiles are rendered like the.htmlfiles without the wrapper element so the framework is as little in the way as possible and authors can decide if they want a wrapper element, and if so what its signature is.If a wrapper element is needed, changing the signature from
<page-test>to something like<enhance-page route="test">is preferable. That way there is a predictable element name that can be targeted with CSS and is easier queryable for folks that want JS access for some reason.