Skip to content

Commit 1bc0434

Browse files
committed
remove use of reactivity transform
1 parent 5cfc2a4 commit 1bc0434

32 files changed

+126
-135
lines changed

.vitepress/config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -687,9 +687,5 @@ export default defineConfigWithTheme<ThemeConfig>({
687687
json: {
688688
stringify: true
689689
}
690-
},
691-
692-
vue: {
693-
reactivityTransform: true
694690
}
695691
})

.vitepress/theme/components/Banner.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
* 2. uncomment and update BANNER_ID in ../../inlined-scripts/restorePreferences.ts
66
* 3. update --vt-banner-height if necessary
77
*/
8+
import { ref } from 'vue'
9+
10+
const open = ref(true)
811
9-
let open = $ref(true)
1012
/**
1113
* Call this if the banner is dismissible
1214
*/
1315
function dismiss() {
14-
open = false
16+
open.value = false
1517
document.documentElement.classList.add('banner-dismissed')
1618
localStorage.setItem(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'true')
1719
}

.vitepress/theme/components/PreferenceSwitch.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
import { VTSwitch, VTIconChevronDown } from '@vue/theme'
33
import { useRoute } from 'vitepress'
4-
import { inject, Ref } from 'vue'
4+
import { ref, computed, inject, Ref } from 'vue'
55
import {
66
preferCompositionKey,
77
preferComposition,
@@ -10,15 +10,15 @@ import {
1010
} from './preferences'
1111
1212
const route = useRoute()
13-
const show = $computed(() =>
13+
const show = computed(() =>
1414
/^\/(guide|tutorial|examples|style-guide)\//.test(route.path)
1515
)
16-
const showSFC = $computed(() => !/^\/guide|style-guide/.test(route.path))
16+
const showSFC = computed(() => !/^\/guide|style-guide/.test(route.path))
1717
18-
let isOpen = $ref(true)
18+
let isOpen = ref(true)
1919
2020
const toggleOpen = () => {
21-
isOpen = !isOpen
21+
isOpen.value = !isOpen.value
2222
}
2323
2424
const removeOutline = (e: Event) => {

.vitepress/theme/components/SponsorsGroup.vue

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
11
<script setup lang="ts">
2-
import { onMounted, onUnmounted } from 'vue'
2+
import { ref, onMounted, onUnmounted } from 'vue'
33
import { SponsorData, data, base, load } from './sponsors'
44
55
type Placement = 'aside' | 'page' | 'landing'
66
7-
const { tier, placement = 'aside' } = defineProps<{
8-
tier: keyof SponsorData
9-
placement?: Placement
10-
}>()
7+
const props = withDefaults(
8+
defineProps<{
9+
tier: keyof SponsorData
10+
placement?: Placement
11+
}>(),
12+
{
13+
placement: 'aside'
14+
}
15+
)
1116
12-
let container = $ref<HTMLElement>()
13-
let visible = $ref(false)
17+
const container = ref<HTMLElement>()
18+
const visible = ref(false)
1419
1520
onMounted(async () => {
1621
// only render when entering view
1722
const observer = new IntersectionObserver(
1823
(entries) => {
1924
if (entries[0].isIntersecting) {
20-
visible = true
25+
visible.value = true
2126
observer.disconnect()
2227
}
2328
},
2429
{ rootMargin: '0px 0px 300px 0px' }
2530
)
26-
observer.observe(container!)
31+
observer.observe(container.value!)
2732
onUnmounted(() => observer.disconnect())
2833
2934
// load data
@@ -38,7 +43,7 @@ const eventMap: Record<Placement, string> = {
3843
}
3944
4045
function track(interest?: boolean) {
41-
fathom.trackGoal(interest ? `Y2BVYNT2` : eventMap[placement], 0)
46+
fathom.trackGoal(interest ? `Y2BVYNT2` : eventMap[props.placement], 0)
4247
}
4348
</script>
4449

.vitepress/theme/components/VueJobs.vue

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<script lang="ts">
2+
import { ref } from 'vue'
3+
24
// shared data across instances so we load only once
35
const base = 'https://app.vuejobs.com/feed/vuejs/docs?format=json'
46
5-
let items = $ref<Jobs[]>([])
7+
const items = ref<Jobs[]>([])
68
79
type Jobs = {
810
organization: Organization
@@ -21,19 +23,19 @@ type Organization = {
2123
<script setup lang="ts">
2224
import { onMounted, computed } from 'vue'
2325
24-
let vuejobs = $ref<HTMLElement>()
25-
2626
const openings = computed(() =>
27-
items.sort(() => 0.5 - Math.random()).slice(0, 2)
27+
items.value.sort(() => 0.5 - Math.random()).slice(0, 2)
2828
)
2929
3030
onMounted(async () => {
31-
if (!items.length) items = (await (await fetch(`${base}`)).json()).data
31+
if (!items.value.length) {
32+
items.value = (await (await fetch(`${base}`)).json()).data
33+
}
3234
})
3335
</script>
3436

3537
<template>
36-
<div class="vuejobs-wrapper" ref="vuejobs">
38+
<div class="vuejobs-wrapper">
3739
<div class="vj-container">
3840
<a
3941
class="vj-item"
@@ -45,15 +47,17 @@ onMounted(async () => {
4547
<div class="vj-company-logo">
4648
<img
4749
:src="job.organization.avatar"
48-
:alt="`Logo for ${job.organization.name}`" />
50+
:alt="`Logo for ${job.organization.name}`"
51+
/>
4952
</div>
5053
<div
5154
style="
5255
overflow: hidden;
5356
display: flex;
5457
flex-direction: column;
5558
justify-content: center;
56-
">
59+
"
60+
>
5761
<div class="vj-job-title">{{ job.title }}</div>
5862
<div class="vj-job-info">
5963
{{ job.organization.name }} <span>· </span>

.vitepress/theme/components/VueMasteryModal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script setup lang="ts">
2-
import { watch } from 'vue'
2+
import { ref, watch } from 'vue'
33
44
const VIDEO_SOURCE = 'https://player.vimeo.com/video/647441538?autoplay=1'
5-
let showWhyVue: boolean = $ref(false)
5+
const showWhyVue = ref(false)
66
77
watch(
88
() => showWhyVue,

env.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/// <reference types="vitepress/client" />
2-
/// <reference types="vue/macros-global" />
32

43
declare module '@vue/theme/config' {
54
import { UserConfig } from 'vitepress'

src/about/releases.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ outline: deep
33
---
44

55
<script setup>
6-
import { onMounted } from 'vue'
6+
import { ref, onMounted } from 'vue'
77

8-
let version = $ref()
8+
const version = ref()
99

1010
onMounted(async () => {
1111
const res = await fetch('https://api.github.com/repos/vuejs/core/releases?per_page=1')
12-
version = (await res.json())[0].name
12+
version.value = (await res.json())[0].name
1313
})
1414
</script>
1515

src/guide/built-ins/keep-alive-demos/CompA.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup>
2-
let count = $ref(0)
2+
import { ref } from 'vue'
3+
const count = ref(0)
34
</script>
45

56
<template>

src/guide/built-ins/keep-alive-demos/CompB.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup>
2-
let msg = $ref('')
2+
import { ref } from 'vue'
3+
const msg = ref('')
34
</script>
45

56
<template>

0 commit comments

Comments
 (0)