Closed mikabytes closed 8 months ago
Apologies for the delay here! I hope to have a look at this later today.
Excellent work!
I want it to be treated as a named export, but JavaScript doesn't allow me to specify such metadata. The consequence is that imports can be added, but not matched or removed.
You're right that ImportJS doesn't have support for that, but you're wrong about your solution being horrible. :)
I'm not too happy about the way I'm checking the type-of-export based on the adding <> characters to the name. I AM happy about using <> to have ImportJS give me distinct messages about importing a custom element though.
I think this is fine.
import /* <my-custom-element> from */ './my-custom-element.js'
I like this idea. If you can make this work, go for it. If not, I think it's fine if removing the imports is a manual process.
but you're wrong about your solution being horrible
Haha, agree to disagree ;-)
import /* <my-custom-element> from */ './my-custom-element.js'
I'll have something ready once I have some time to do it. Might not be this week, we'll see!
Based on #550, this PR indeed adds support for importing files that define custom elements. It has a few quirks though.
Quirks
One idea
Maybe we could add support for "that which has a name but is not named in JS spec" as a comment? Maybe something like:
OR
Separating multiple named exports with comma. Or something. I'm happy to hear your ideas.
other
Not too bad for 3 hours work on a foreign codebase.... :)