Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use <script> & etc #3

Closed
JSmith01 opened this issue Feb 8, 2017 · 8 comments
Closed

Use <script> & etc #3

JSmith01 opened this issue Feb 8, 2017 · 8 comments

Comments

@JSmith01
Copy link

JSmith01 commented Feb 8, 2017

I hope you're kiddin with this recommendation. Nowadays most IDEs got nice defaults for <script> and, hey, HTML5 went towards simplification, not exausting developers by endless useless xmlns and other stuff. For example Webstorm insists that you'll use type="text/babel" for script tag to correctly interpret ES6 (skipping defaults). But it only means that this IDE is buggy and we'll need to force their devs to fix this bug. There are many IDEs on the market, and you have a freedom to choose the right one.

Anyway, thank you for sharing this doc. Our team has internal document on component styling for Vue.js, part of it is comparable with your proposal, but definitely you have a worth things that we missed.

I also should say that it would be nice to take 1.0 into account.

@pablohpsilva
Copy link
Owner

pablohpsilva commented Feb 8, 2017

Hello @JSmith01 ! Thank you for this issue :)

Yeap, I'm not kidding. The reason why I recommended it was exactly what you say about the buggy IDE's. I hope you're working on an environment where your can choose and switch IDEs whenever you want, but that's not the case for some companies where they strict the use of IDEs. I can go round and round about this subject and explain why companies do it but... I think you can figure it out why, right?

I believe by the end of this year I will remove this rule. Like you said, most IDEs are upgrading their syntax highlight/autcomplete/etc. so, soon enough I'll remove this rule.

Really? I know its an internal document, but, if its OK, would your company mind to share some of it? The idea here is to have a good style guide and I would love to read it, if its OK.

About the Vue1.0: it could be done. But I don't see a very good reason right now, specially because Vue is moving fast and changing quickly. But nothing can stop you for helping me writing it. What do you think? :D

Once again, thank you very much for this issue.

@franciscolourenco
Copy link
Contributor

franciscolourenco commented Feb 8, 2017

I doubt any of your have tested all IDE's available to know if it generally problematic. Would be useful if you listed here the IDE(s) you personally know have problem, and the attributes needed to fix it.

@kartsims
Copy link
Contributor

kartsims commented Feb 8, 2017

I agree with @JSmith01 for the good reason that <script> tag's type attribute now defaults to text/javascript so it is rather on the IDE side to keep up...

We've had problems with WebStorm and since it is a rather widely used IDE, I see your point of forcing it. That's what we did in our team's projects.

Still I don't think it should be part of this guide that is intended to define what should be considered "best practice".

@miljan-aleksic
Copy link

miljan-aleksic commented Feb 8, 2017

@pablohpsilva, you could leave it as recommendation if you still want it listed, but I agree is IDEs issue about to be solved not affecting everyone.

@franciscolourenco
Copy link
Contributor

franciscolourenco commented Feb 8, 2017

I still think it would be interesting to have a list of editors with problems and how to fix them, on a case by case basis.

@pablohpsilva
Copy link
Owner

Thank you @aristidesfl and @kartsims ! :D

@kartsims your last statement convinced me. If someone is using anything else besides JS while developing their component, they will use some attr on <script> so the Vue compiler can compile their component, right?

OK, I'll remove it then.

Thank you @JSmith01 @aristidesfl @miljan-aleksic and @kartsims

@franciscolourenco
Copy link
Contributor

If someone is using anything else besides JS while developing their component, they will use some attr on <script> so the Vue compiler can compile their component, right?

Although that attribute will be lang not type

@pablohpsilva
Copy link
Owner

@aristidesfl about the list:

I think it goes off the context here. Like I said in the README.md its just a precaution and something to tell other devs what the code was written in. In the end of the day, the vue compiler will compile the .vue file anyways.

pablohpsilva pushed a commit that referenced this issue Feb 8, 2017
Thanks to @JSmith01 @aristidesfl @miljan-aleksic and @kartsims on issue #3 .

`<script type="text/javascript">`

removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants