Closed tpluscode closed 7 years ago
Personally I'm against magic like that. Had similar magic things in meteor (auto including etc) and it was terrible on the long run. Also having template imported by annotation explicitly makes things easier to check where stuff is coming from. Additionally, checking for template existence would make the tool a bit slower, as it would always make additional FS operation for each module no matter if template will be fetched from the file or not.
It was just a thought I had yesterday. The performance argument does make sense.
How about an opt-in feature?
I'm not strongly in favor though. It's your call
I could provide a flag to either use implicit template or not, but that would just bring more confusion in my opinion. Maybe in the future if the tool is popular and more people ask for that feature, I could add it, but for now I want to boost the performance (created a task for it already) and keep the options to minimum (some people really hate config files :P). Nevertheless, thanks for the idea, I appreciate the input ;).
OK. Let's kill it. For now :)
I think that given adjacent ts and html files like
it could enough to only export the class and have twc automatically pick up the matching HTML file as element's template, i.e. without using the
@template
decorator.