-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
feat(compiler-sfc): [BREAKING] default <script>
lang option for parser
#7176
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
base: main
Are you sure you want to change the base?
Conversation
<script>
& <script setup>
<script>
lang options
<script>
lang options<script>
lang option
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
❌ Deploy Preview for vuejs-coverage failed.
|
<script>
lang option<script>
lang option for parser
@hydrati Sure |
I have my a doubts about this change - not about what it does (I think it makes sense), but when to introduce it. It feels like a breaking change that would have to wait for Vue 4. Even if it's not to be considered a breaking change, it should only be introduced in a minor release, not a patch version. For one, today some libraries choose to publish raw .vue files, which works particularly well if they re already written in plain JS and CSS. Those might break if the consuming app has set the default script lang to ts. Furthermore, once we introduce this, there will quickly be pressure from users for all the tooling (Volar, eslint-plugin-vue ...) to support this, which we should prepare for in a coordinated manner. |
Maybe I need to add an "scope" option to keep the compatibility for those libraries.
I know the problem, but I don't know how to deal with it. |
<script>
lang option for parser<script>
lang option for parser
eaa323c
to
01f0891
Compare
Would be amazing to have this also for the |
Add option
defaultScriptLang
for the parser.If the
lang
attribute of the script block is empty, this option will be applied.Example
Note: This feature may break some syntax highlighters and language servers (like Volar).
Close #7173