File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
packages/compiler-sfc/src/script Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 9
9
unwrapTSNode
10
10
} from './utils'
11
11
import { BindingTypes } from '@vue/compiler-dom'
12
+ import { warnOnce } from '../warn'
12
13
13
14
export const DEFINE_MODEL = 'defineModel'
14
15
@@ -26,6 +27,14 @@ export function processDefineModel(
26
27
if ( ! ctx . options . defineModel || ! isCallOf ( node , DEFINE_MODEL ) ) {
27
28
return false
28
29
}
30
+
31
+ warnOnce (
32
+ `This project is using defineModel(), which is an experimental ` +
33
+ ` feature. It may receive breaking changes or be removed in the future, so ` +
34
+ `use at your own risk.\n` +
35
+ `To stay updated, follow the RFC at https://github.com/vuejs/rfcs/discussions/503.`
36
+ )
37
+
29
38
ctx . hasDefineModelCall = true
30
39
31
40
const type =
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import { genPropsAccessExp } from '@vue/shared'
21
21
import { isCallOf , resolveObjectKey , unwrapTSNode } from './utils'
22
22
import { ScriptCompileContext } from './context'
23
23
import { DEFINE_PROPS } from './defineProps'
24
+ import { warnOnce } from '../warn'
24
25
25
26
export function processPropsDestructure (
26
27
ctx : ScriptCompileContext ,
@@ -30,6 +31,13 @@ export function processPropsDestructure(
30
31
return
31
32
}
32
33
34
+ warnOnce (
35
+ `This project is using reactive props destructure, which is an experimental ` +
36
+ ` feature. It may receive breaking changes or be removed in the future, so ` +
37
+ `use at your own risk.\n` +
38
+ `To stay updated, follow the RFC at https://github.com/vuejs/rfcs/discussions/502.`
39
+ )
40
+
33
41
ctx . propsDestructureDecl = declId
34
42
35
43
const registerBinding = (
You can’t perform that action at this time.
0 commit comments