-
Notifications
You must be signed in to change notification settings - Fork 15
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
Allow import of x-element with lit-html imported from unpkg. #61
Comments
@klebba — what would you think about this? I think that if there's not a dead-simple way to "try it before you Obviously, feel free to suggest different names. |
Let's discuss; I'm not sure I follow how this would impact the code yet. A diff depicting |
It's just the imports. You can see the diff in #58. To be clear, it's not a diff, it would be a new file. I think what you're asking for is what's different between x-element.js and x-element-bundle.js? Here's that:
|
Ok I think I understand — does this need to be included with #58 or can we review it independently? I'm not averse to the idea, but would want more time to deliberate |
No it doesn't need to be included — I'm just feeling that if we call #58 Also, I only added it there because I figured you'd ask to look at it 😉 |
I guess either way, what'd be more important is some documentation on how to use Either way, the idea is that it's a lot to ask folks to do all these backflips before they even know if they want to use it. |
I see — let's not couple the merge of #58 to 1.0.0 necessarily, but it should follow soon after. If you want to open a PR that bases off that branch, I'm happy to deliberate this approach in more detail in a separate thread |
Any reason we can't just come to an agreement in this issue thread? Perhaps I'm misunderstanding though — is your ask for me to try and think of other ways we might be able to do this and enumerate them? |
I can also open up a different branch. But the change set isn't really that interesting.
|
Yeah, I do think we should address this separately — I want to discuss potential alternatives and possibly fiddle a bit |
Summarizing our chat: if we remove |
Going to close this down since @klebba already set us up for success here 🎉 |
While the supported way to use
x-element
is to perform a flat-install oflit-html
as a sibling to thex-element
such that the import../../lit-html/lit-html.js
will work — this presents a barrier to entry to tryingx-element
.Since lit-html supports import from
unpkg
, we could expose a file with alternative imports that don't require the special setup. It would also allow online code editors import and use the element.The following script would simply replace the import strings with new ones:
E.g.,
Then, you could pop into a code pen or something and write
import XElement from 'https://unpkg.com/@netflix/x-elementx-element.js'
and it would just work. I think this is pretty powerful and worthwhile.I'd like to add this as part of #58.
Note that a simple gut-check test could be as follows where we minimally check functionality and assert that the text in the bundle file is as expected:
The text was updated successfully, but these errors were encountered: