Skip to content
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

fix: testing for instanceof TemplateResult #129

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eddyloewen
Copy link
Contributor

when code is coming from a different module

Needs tests + a real solution and not just some small bandaid...

when code is coming from a different module
@eddyloewen eddyloewen requested a review from quarkus September 23, 2024 14:06
@@ -98,6 +98,10 @@ const getValue = (value) => {
case Array.isArray(value):
return value.map(getValue).join('');
case value instanceof TemplateResult:
// TODO: instanceof is not working when element-js is used in different modules...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the todo here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not to use instanceof maybe?! We could go back to setting some $$__magic_varibales on the classes and check for those.
But there could be another problem. This happens when npm can't hoist element-js and the bundler uses two different versions. If we changed the instanceof check to something else - we could end up with different versions of element-js that are not compatible with each other?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants