voorhoede / riotjs-style-guide

Opinionated RiotJS Style Guide for teams.
Creative Commons Zero v1.0 Universal
287 stars 22 forks source link

Should we revisit the `.tag.html` extension rule? #58

Open petergoes opened 7 years ago

petergoes commented 7 years ago

I think we need to revisit the rule about having the .tag.html extension for tags. I think it should actually be .tag.

The rule states in the Why section:

The first one is quite clear, a developer knows that he/she is dealing with a riot tag because of the .tag part in .tag.html. I think that having .html in the extension is quite distracting to the developer. Dropping the .html part makes it even more clear to the developer that he/she is working with a riot tag.

The second one was relevent in the past, but might not be anymore. For webstorm users, there is an easy way to have .tag files treated as html. For Sublime Text, Atom and Visual Studio Code users, there are plugins available, or it is not that hard to treat .tag files as html files either.

Besides that, if we want to support server side rendering, only .tag files are supported at the moment. All though I put up an issue to discuss adding custom extensions on the server side.

tas12 commented 7 years ago

As a user of the guide I think this would be a good idea. I've ended up abandoning the .html extension altogether :)

jfbrennan commented 7 years ago

You should remove "Riot introduces a new concept called tags". Tags are not a new concept. Tags are standard HTML, which everyone is already familiar with (https://www.w3schools.com/TAgs/ref_byfunc.asp). Riot enables you to create custom HTML tags and is another example of Riot's philosophy to stay true to web standards rather than introduce new concepts and framework idioms.

shaban commented 6 years ago

the html extension's purpose is to have great defaults in the editor.

If an organization or individual configures the editor in a way that apply html coding rules to the .tag extension they will and should ignore this rule.

But there is definitely no harm in suggesting .tag.html since it is the most straightforward way of getting the right ruleset in the editor.

For example in Vue.js i never used the .vue extension since the vue specific plugin turned out to be inferior to the default html extension.

The only thing one could complain about is the urgency of the guideline. Maybe an urgency label for a given guideline would be in order in general.

e.g

an actual implementation of a style guide that uses such a pattern is:

https://bestof.js.org/projects/front-end-checklist

But honestly doesn't sound like the most important thing :-)

SassNinja commented 6 years ago

I agree 100% to you @petergoes :+1: As a new riot user I've read the whole guide in detail and decided to use everything for our project instead of the extension rule.

As you already pointed out the common IDEs (sublime, visual studio code) provide appropriate plugins for riot syntax highlighting.

Imo *.tag.html is wrong because the files are not 100% HTML but may also contain Riot syntax. Thus it should rather be *.html.tag to emphasize the HTML part. However I'd also appreciate to drop the whole .html part in the extension and stay with *.tag.

But honestly doesn't sound like the most important thing :-)

No offense, but imo this is a very important part in the style guide because it affects a huge part of any riot project that is built on this guide. So if a rule is not up to date anymore it should be reworked / removed.