Skip to content

Commit fef191f

Browse files
committed
chore: remove stale references of ref-transform
1 parent a273e88 commit fef191f

File tree

8 files changed

+16
-17
lines changed

8 files changed

+16
-17
lines changed

packages/compiler-sfc/__tests__/compileScript.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ defineExpose({ foo: 123 })
310310
let foo = $ref(1)
311311
</script>
312312
`,
313-
{ refTransform: true }
313+
{ reactivityTransform: true }
314314
)
315315
assertCode(content)
316316
expect(content).toMatch(`import { ref } from 'vue'`)
@@ -1108,7 +1108,7 @@ const emit = defineEmits(['a', 'b'])
11081108
describe('async/await detection', () => {
11091109
function assertAwaitDetection(code: string, shouldAsync = true) {
11101110
const { content } = compile(`<script setup>${code}</script>`, {
1111-
refTransform: true
1111+
reactivityTransform: true
11121112
})
11131113
if (shouldAsync) {
11141114
expect(content).toMatch(`let __temp, __restore`)

packages/compiler-sfc/__tests__/compileScriptPropsTransform.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describe('sfc props transform', () => {
66
function compile(src: string, options?: Partial<SFCScriptCompileOptions>) {
77
return compileSFCScript(src, {
88
inlineTemplate: true,
9-
propsDestructureTransform: true,
9+
reactivityTransform: true,
1010
...options
1111
})
1212
}

packages/compiler-sfc/__tests__/compileScriptRefTransform.spec.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import { compileSFCScript as compile, assertCode } from './utils'
44
// this file only tests integration with SFC - main test case for the ref
55
// transform can be found in <root>/packages/reactivity-transform/__tests__
66
describe('sfc ref transform', () => {
7-
function compileWithRefTransform(src: string) {
8-
return compile(src, { refTransform: true })
7+
function compileWithReactivityTransform(src: string) {
8+
return compile(src, { reactivityTransform: true })
99
}
1010

1111
test('$ unwrapping', () => {
12-
const { content, bindings } = compileWithRefTransform(`<script setup>
12+
const { content, bindings } = compileWithReactivityTransform(`<script setup>
1313
import { ref, shallowRef } from 'vue'
1414
let foo = $(ref())
1515
let a = $(ref(1))
@@ -46,7 +46,7 @@ describe('sfc ref transform', () => {
4646
})
4747

4848
test('$ref & $shallowRef declarations', () => {
49-
const { content, bindings } = compileWithRefTransform(`<script setup>
49+
const { content, bindings } = compileWithReactivityTransform(`<script setup>
5050
let foo = $ref()
5151
let a = $ref(1)
5252
let b = $shallowRef({
@@ -82,7 +82,7 @@ describe('sfc ref transform', () => {
8282
})
8383

8484
test('usage in normal <script>', () => {
85-
const { content } = compileWithRefTransform(`<script>
85+
const { content } = compileWithReactivityTransform(`<script>
8686
export default {
8787
setup() {
8888
let count = $ref(0)
@@ -100,7 +100,7 @@ describe('sfc ref transform', () => {
100100
})
101101

102102
test('usage /w typescript', () => {
103-
const { content } = compileWithRefTransform(`
103+
const { content } = compileWithReactivityTransform(`
104104
<script setup lang="ts">
105105
let msg = $ref<string | number>('foo');
106106
let bar = $ref <string | number>('bar');
@@ -113,7 +113,7 @@ describe('sfc ref transform', () => {
113113
})
114114

115115
test('usage with normal <script> + <script setup>', () => {
116-
const { content, bindings } = compileWithRefTransform(`<script>
116+
const { content, bindings } = compileWithReactivityTransform(`<script>
117117
let a = $ref(0)
118118
let c = $ref(0)
119119
</script>
@@ -156,7 +156,7 @@ describe('sfc ref transform', () => {
156156
bar
157157
})
158158
</script>`,
159-
{ refTransform: true }
159+
{ reactivityTransform: true }
160160
)
161161
).toThrow(`cannot reference locally declared variables`)
162162

@@ -168,7 +168,7 @@ describe('sfc ref transform', () => {
168168
bar
169169
})
170170
</script>`,
171-
{ refTransform: true }
171+
{ reactivityTransform: true }
172172
)
173173
).toThrow(`cannot reference locally declared variables`)
174174
})

packages/compiler-sfc/src/compileScript.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export interface SFCScriptCompileOptions {
104104
*/
105105
propsDestructureTransform?: boolean
106106
/**
107-
* @deprecated use `refTransform` instead.
107+
* @deprecated use `reactivityTransform` instead.
108108
*/
109109
refSugar?: boolean
110110
/**
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './refTransform'
1+
export * from './reactivityTransform'

packages/reactivity-transform/src/refTransform.ts renamed to packages/reactivity-transform/src/reactivityTransform.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,6 @@ function warnOnce(msg: string) {
660660

661661
function warn(msg: string) {
662662
console.warn(
663-
`\x1b[1m\x1b[33m[@vue/ref-transform]\x1b[0m\x1b[33m ${msg}\x1b[0m\n`
663+
`\x1b[1m\x1b[33m[@vue/reactivity-transform]\x1b[0m\x1b[33m ${msg}\x1b[0m\n`
664664
)
665665
}

packages/sfc-playground/src/App.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ const store = new ReplStore({
1919
// enable experimental features
2020
const sfcOptions = {
2121
script: {
22-
refTransform: true,
23-
propsDestructureTransform: true
22+
reactivityTransform: true
2423
}
2524
}
2625

0 commit comments

Comments
 (0)