-
Notifications
You must be signed in to change notification settings - Fork 915
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
implement a feature of defaultLang
(#497)
#500
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
/ping @vuejs/vue-loader-vueify
I think that is useful.
What do you think?
Hmm I think specifying Lang attributes is useful, especially for large projects. A new starter to a project may not be aware of the toolset in use. So specifying the Lang attribute in the code can help them navigate to a correct resource. Only a minor thought. |
@blake-newman then just don't use this feature, it's not required. |
i don't understand why you need a default language option. |
If I'm using stylus in every .vue file, with this feature we don't need to write Please notice that, it's not required, if you don't like it, you can just don't use it. |
Of course, you also could overwrite the language with the original syntax |
In your stylus everywhere scenario, wouldn't you be able to set stylus-loader as the default loader for css just by setting the vue-loader options? As in http://vue-loader.vuejs.org/en/configurations/advanced.html
|
The option But with the |
Please don't. This makes it impossible to write textmate grammar that syntax-highlights embedded code correctly. https://github.com/vuejs/vue-syntax-highlight will break for whoever that's changing default lang. All users of Sublime / Atom / VSCode will be affected. |
@octref OMG, it is just an optional feature, OK? You don't need it? Just don't use it. |
I agree with @blake-newman in that this adds implicitness which makes code less readable. As scss/less/postcss are syntactically similar, with this feature you can write them all in This also strongly couples code with config, so a piece of vue SFC code can't be used in another project if they don't have the same setting. And as @barraponto pointed out, if you really want to do it you can change the config yourself. Just beaware the syntax highlighting will break, and it's impossible to change the grammar to support this feature. |
I guess that's not the point. It is, of course, up to the maintainer to choose whether to merge or not your PR. Yet features do not come for free -- they require tests, documentation and maintenance. And as this feature has its own effects on code legibility, it's worth weighing them out. Open source means you can add all the features you want to your versions (forks) of any piece of code. Yet it doesn't mean every PR should be merged upstream. Try not to take the outcome of this PR personally. |
No description provided.