michaelgmcd / vscode-language-babel

VSCode syntax highlighting for today's JavaScript

Home Page:https://marketplace.visualstudio.com/items?itemName=mgmcdermott.vscode-language-babel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sublime Babel

mattmacpherson opened this issue · comments

What's the difference between this and Sublime Babel?

In regular JavaScript, there are only subtle differences (import/export statements and function calls), however the real difference is that this package has improved Flow support as well as syntax highlighting for GraphQL and styled-components. While Sublime Babel supports React and JSX pretty well, I personally prefer the highlighting provided by this package (mainly that JSX components are treated the same as classes).

It's all obviously a matter of preference and this is mine!

Sublime Babel:
screen shot 2017-06-12 at 10 14 02 pm

Babel JavaScript:
screen shot 2017-06-12 at 10 17 15 pm

Sublime Babel:
screen shot 2017-06-12 at 10 10 51 pm
Babel JavaScript:
screen shot 2017-06-12 at 10 10 15 pm

Sublime Babel:
screen shot 2017-06-12 at 10 11 40 pm
screen shot 2017-06-12 at 10 13 23 pm
Babel JavaScript:
screen shot 2017-06-12 at 10 09 37 pm

Sublime Babel:
screen shot 2017-06-12 at 10 16 07 pm
Babel JavaScript:
screen shot 2017-06-12 at 10 08 55 pm

@mgmcdermott Thanks for the detailed response. I respect your attention to detail and I'm definitely giving it a try!

also comment that in this package commenting inside JSX works better than in sublime babel

Sublime babel comments JSX with // xxx
this package comments JSX in the correct way with {/* xxx */}

Regarding the screenshots:
The import screenshots seem switched - the first screenshot shows Babel JavaScript, the second Sublime Babel (using "Material Theme").

Regarding the JSX Tags:
I can't see why the Babel JavaScript color should be correct. Open an HTML file, write a few tags. They're not yellow, they're red. Hence, the JSX tags should be red as well (like Sublime Babel).

All screenshots were taken using the "Theme - Oceanic Next" theme.

Regarding your second point, valid html tags (input, p, span, h1, etc) will be red just like html. Components (with a capital letter) are NOT valid html and hence they are colored like the classes that they are.

I wanted to show the differences in this issue. Both Sublime Babel and Babel JavaScript will highlight default html tags as red.

I see, that makes sense. Had not noticed that (subtle but important) difference :)

Sorry, can you provide screenshots for any differences in flow-types as well?

can you please tell me what font is this??

@hamzashahab1610 It is Operator Mono