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

fix(compiler-sfc): Show location of >>> / /deep/ in the ...combinators have been deprecated message #8596

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

AliceLanniste
Copy link

close #6404

# Conflicts:
#	packages/compiler-sfc/src/style/pluginScoped.ts
@github-actions
Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 85.9 kB 32.7 kB 29.5 kB
vue.global.prod.js 132 kB 49.3 kB 44.3 kB

Usages

Name Size Gzip Brotli
createApp 47.9 kB 18.9 kB 17.2 kB
createSSRApp 50.7 kB 20 kB 18.2 kB
defineCustomElement 50.3 kB 19.6 kB 17.9 kB
overall 61.2 kB 23.7 kB 21.6 kB

@netlify
Copy link

netlify bot commented Oct 20, 2023

Deploy Preview for vue-next-template-explorer failed.

Name Link
🔨 Latest commit 2c72be3
🔍 Latest deploy log https://app.netlify.com/sites/vue-next-template-explorer/deploys/6532590e70a9050008c737e4

@netlify
Copy link

netlify bot commented Oct 20, 2023

Deploy Preview for vue-sfc-playground failed.

Name Link
🔨 Latest commit 2c72be3
🔍 Latest deploy log https://app.netlify.com/sites/vue-sfc-playground/deploys/6532590ed755c300085cdbcb

Copy link
Contributor

@skirtles-code skirtles-code left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried testing this locally, after merging in main. The line numbers seem to be off. I think they're only counting lines within the <style> section, not within the file as a whole.

Not sure whether fixing that would be in scope for this PR, but including the line number in the warning isn't currently very helpful.

I've made some other suggestions for changes to the warnings below, though I haven't taken into account the inaccurate line numbers.

Comment on lines +104 to +105
`the >>> and /deep/ combinators have been deprecated. ` +
`Use :deep() instead.(${filename}(${n.source?.start?.line} : ${n.source?.start?.column}))`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spacing of this message seems a bit off, as does the nested bracketing. I also wonder whether the column is really that useful in this context. Perhaps something like this instead?

Suggested change
`the >>> and /deep/ combinators have been deprecated. ` +
`Use :deep() instead.(${filename}(${n.source?.start?.line} : ${n.source?.start?.column}))`
`the >>> and /deep/ combinators have been deprecated. ` +
`Use :deep() instead. Line ${n.source?.start?.line}, ${filename}`,

@@ -131,7 +136,7 @@ function rewriteSelector(
// .foo ::v-deep .bar -> .foo[xxxxxxx] .bar
warn(
`${value} usage as a combinator has been deprecated. ` +
`Use :deep(<inner-selector>) instead of ${value} <inner-selector>.`
`Use :deep(<inner-selector>) instead of ${value} <inner-selector>.(${filename}(${n.source?.start?.line} : ${n.source?.start?.column}))`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the other message, perhaps something like this?

Suggested change
`Use :deep(<inner-selector>) instead of ${value} <inner-selector>.(${filename}(${n.source?.start?.line} : ${n.source?.start?.column}))`
`Use :deep(<inner-selector>) instead of ${value} <inner-selector>. Line ${n.source?.start?.line}, ${filename}`,

@@ -4,15 +4,18 @@ import { warn } from '../warn'

const animationNameRE = /^(-\w+-)?animation-name$/
const animationRE = /^(-\w+-)?animation$/
type pluginParam = { id: string; filename?: string }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type names usually begin with uppercase letters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Review
Development

Successfully merging this pull request may close these issues.

Show location of >>> / /deep/ in the ...combinators have been deprecated message
4 participants