4 ms·
Single file components like .svelte and .vue are nice at first glance. But I want typescript, eslint and prettier understand my code natively and not wrapped in
by sod 4y ago
Single file components like .svelte and .vue are nice at first glance. But I want typescript, eslint and prettier understand my code natively and not wrapped in custom syntax and smushed into one file that every tooling now has to support.
Maybe it's finally time for someone to standardize this - even if just pointing at what vue & svelte already do - so every tooling can go ahead and support amalgams of filetypes in a single file for any framework that wants to work like this.
It's a wonder how react managed to force their jsx and angular forced annotations into typescript just to get a good typescript experience out of the box.
- girvo 4y agoFunnily enough, IDEs a decade ago (more, even) solved this for PHP already, as even back then a lot of PHP was still HTML and PHP (and JS) intermixed in one file. It’s a shame we haven’t solved it properly in modern editors without having to rebuild the tooling over and over again for every new framework.
- pragmatic 4y agoAlso asp and asp.net etc. I'm sure there's some on the java side I'm forgetting also.
- magic123_ 4y agoYou just gave me flashbacks of the 3000+ lines .phtml files I was working on a few years back, definitely not the most pleasant experience I had as a developer.
- girvo 4y agoGod it was such a horrible mess haha. I have weird Stockholm syndrome fond memories of it.
- e12e 4y agoShouldn't really be a problem - I've had reasonable syntax highlighting of markdown files with support for inline code-blocks in different languages for a while in (neo)vim. Mixing languages/dsls in a single file shouldn't be a problem. Should also work for things like in-line sql fragments for orms etc?