Ancestors

Toot

Written by Keith J Grant on 2024-12-12 at 18:01

Lit folks: are there any good patterns for managing imports?

Right now, my Lit project has an index.js that just imports ALL my components, but it's kind of a pain to update it every time I add a new component. I'd kind of prefer to import a component in the file of the parent component -- but there's not really a reason to since the class itself is unused in that file.

[#]lit #webdev

=> More informations about this toot | More toots from keithjgrant@front-end.social

Descendants

Written by Keith J Grant on 2024-12-12 at 18:03

I also miss that in React, I can Cmd-click a component in the parent component's JSX, and VS Code will open the component's file for me. With Lit, since there's no actual reference to the child component object, the editor can't do that.

I really do miss JSX, and would love to find a way to fake it: import a component and somehow (cleanly) inject it into the html template of the parent component

=> More informations about this toot | More toots from keithjgrant@front-end.social

Written by Keith J Grant on 2024-12-12 at 18:03

auto-registering components would be really great, too

=> More informations about this toot | More toots from keithjgrant@front-end.social

Written by Alexis Deveria on 2024-12-12 at 18:11

@keithjgrant https://marketplace.visualstudio.com/items?itemName=runem.lit-plugin should let you do this.

=> More informations about this toot | More toots from Fyrd@front-end.social

Written by Keith J Grant on 2024-12-12 at 18:11

@Fyrd oooh! thanks!

=> More informations about this toot | More toots from keithjgrant@front-end.social

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113641161114879820
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
272.357896 milliseconds
Gemini-to-HTML Time
0.827383 milliseconds

This content has been proxied by September (ba2dc).