jesseweed / seti-ui

A subtle dark colored UI theme for Atom.
MIT License
941 stars 283 forks source link

Display React icon for .tsx files #620

Closed tjbulick closed 2 years ago

tjbulick commented 2 years ago

Hi I saw a couple of issues with the same question (https://github.com/microsoft/vscode/issues/118162, https://github.com/jesseweed/seti-ui/issues/610), but see no progress so opening a new one Also I saw people there saying that they use .tsx files in non-react projects (#557, https://github.com/microsoft/vscode/issues/93347), but this makes no sense since tsx is derived from JSX, and JSX itself is bound to React and can't be used in any other-than-react project. The icon has already showed React previously, before this change https://github.com/jesseweed/seti-ui/pull/566 by @orta, and i guess that was reasonable. Can we finally get back tsx showing React icon and don't confuse people? I can submit a PR if there's no one who's in the context and is able to do it quickly Image 8-12-21 at 12 28 AM

P.S. Typescript clearly says that .tsx files have such extension because of JSX

orta commented 2 years ago

JSX itself is bound to React and can't be used in any other-than-react project.

This isn't really true, (preact, stencil, vue all have jsx support). I think the original reasoning for switching is fine, so we'll keep it as is.

tjbulick commented 2 years ago

JSX itself is bound to React and can't be used in any other-than-react project.

This isn't really true, (preact, stencil, vue all have jsx support). I think the original reasoning for switching is fine, so we'll keep it as is.

Okay this is indeed not true, but wait, this is the most common use case though? The analogy here would be that not all people write javascript in .js files, but we don't really care about them because they are the minority.

The same thing with tsx, most people write React + TypeScript code in those files, and they want to see proper icon next to their files. Shouldn't we do a favor for the majority?

tjbulick commented 2 years ago

And furthermore, the extension of the file doesn't tell anything about its contents, so i may write any code inside of .js, .ts or .tsx. It rather serves to indicate most used file format (which is typescriptreact in our case), and any IDE or operating system will highlight them as corresponding programming language.

The same story goes for the '.doc' and '.docx' file extensions. There were many document editors ~20 years back, and they were fighting for these extensions to be their (to be associated with that particular software vendor and his application). But only few of them survived and now Windows, Linux and macOS associate .docx with Microsoft Word file. And this is reasonable, actually, although not all people store Word documents within files with '.docx' extension. So the sane majority won here. Totally the same goes for this situation, i think.

I (and community) respect people who write JSX in '.tsx' files not using React, but showing React icon looks like a logical step here.

And also one interesting fact: JSX was originally invented by React. So whenever you use JSX outside of React environment (e.g. with Vue), you actually are using a port of that original implementation, and paying respect to React for bringing it. So showing React icon in this case should be fine too.

So i guess we should act in the interest of the vast majority of users.

landisdesign commented 1 year ago

This isn't really true, (preact, stencil, vue all have jsx support). I think the original reasoning for switching is fine, so we'll keep it as is.

The only original reasoning I see is from #557:

The way we [AirTable] think about it is .tsx is version 2 of the TypeScript dialect so we should just use it everywhere instead of supporting multiple dialects of TypeScript.

Does it really make more sense to say "TSX is TypeScript version 2.0" than "TSX is a TypeScript extension to JSX"? If so, shouldn't we look for a new icon for TypeScript 3, 4, 5...