-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] TypeScript sample on front page with JS in a code editor #491
Conversation
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<script src="/node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"></script> | ||
<script src="/node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to use the bundle over the loader?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easier loading process I think? i forget
} | ||
} | ||
|
||
customElements.define('custom-greeting', CustomGreeting); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use the customElement
decorator too:
@customElement('custom-greeting')
export class CustomGreeting extends LitElement {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you also then have to add the interface HTMLElementTagThingStuff
?
Seems noisier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@katejeffreys No, as in #291 this was changed to only be a string. Before it would actually check if the string was part of HTMLElementTagNameMap
. Probably the comment in the source code should also be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we then remove customElements.define('custom-greeting', CustomGreeting);
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@katejeffreys Yes, @customElement('custom-greeting')
and customElements.define('custom-greeting', CustomGreeting);
do the same thing. Only one is needed.
Co-Authored-By: katejeffreys <katejeffreys@google.com>
Co-Authored-By: katejeffreys <katejeffreys@google.com>
Co-Authored-By: katejeffreys <katejeffreys@google.com>
Co-Authored-By: katejeffreys <katejeffreys@google.com>
Co-Authored-By: katejeffreys <katejeffreys@google.com>
@@ -0,0 +1 @@ | |||
import './custom-greeting.ts'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with separate files for elements in most cases (trying to show only how two elements can compose might be easier with two very small elements in one file).
The stackblitz limitations should be gone with the lit-html
project template, which will hopefully be usable tomorrow. We can think about migrating to that later...
No description provided.