Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Lit templates in Vite dev and prod mode (#12204)
* In dev mode, read templates from - {projectRoot}/frontend - {projectRoot}/node_modules/@vaadin/flow-frontend - {projectRoot}/node_modules (if not "./"-prefixed) In prod mode, copy templates from the above.
- Loading branch information
Johannes Eriksson
committed
Nov 8, 2021
1 parent
a04b2e5
commit ad39b06
Showing
61 changed files
with
1,168 additions
and
653 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 0 additions & 47 deletions
47
flow-lit-template/src/test/resources/META-INF/VAADIN/config/stats.json
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
...te/src/test/resources/META-INF/VAADIN/config/templates/frontend/MyElementFaultyMethods.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Import an element | ||
import { LitElement, html } from 'lit'; | ||
|
||
// Define an element class | ||
export class MyLitElement extends LitElement { | ||
|
||
// Define public API properties | ||
// Define the element's template | ||
render() { | ||
return ` | ||
<style> | ||
:host{ | ||
margin: 5px; | ||
} | ||
.response { margin-top: 10px; } | ||
</style> | ||
<div id="test" class="response">Web components like you, too.</div> | ||
`; | ||
} | ||
} | ||
|
||
// Register the element with the browser | ||
customElements.define('my-element', MyLitElement); |
23 changes: 23 additions & 0 deletions
23
...mplate/src/test/resources/META-INF/VAADIN/config/templates/frontend/MyGreedyLitElement.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Import an element | ||
import { LitElement, html } from 'lit'; | ||
|
||
// Define an element class | ||
export class MyGreedyLitElement extends LitElement { | ||
|
||
// Define the element's template | ||
render() { | ||
return html` | ||
<style> | ||
:host{ | ||
margin: 5px; | ||
} | ||
.response { margin-top: 10px; } | ||
</style> | ||
<div>\`Tag name doesn't match the JS module name<div>inner</div></div> <div id='test' class='response'>greedy</div> | ||
`;} | ||
static get styles() { return css`:host { background-color: pink } <span>incorrect content</span>`; } | ||
} | ||
|
||
// Register the element with the browser | ||
customElements.define('my-greedy-element', MyGreedyLitElement); |
Oops, something went wrong.