Add experiments folder. Add usage.md and SKILL.md. Fix Sheet interactions and add dynamic sheet mode.

This commit is contained in:
2026-07-22 07:04:39 +00:00
parent bfe364c57d
commit 6aed7606ad
48 changed files with 5454 additions and 84 deletions

View File

@@ -0,0 +1,39 @@
<script setup lang="ts">
import { inject } from "vue";
import { useRoute } from "vue-router";
import {
compatibilityLabContextKey,
demoAppValueKey,
recordCompatibilityEvent,
} from "../compatibility-lab";
const props = defineProps<{ requestId: number }>();
const route = useRoute();
const appValue = inject(demoAppValueKey, "missing app injection");
const labContext = inject(compatibilityLabContextKey);
recordCompatibilityEvent(
"Suspense",
"async setup started",
`request ${props.requestId}`,
);
await new Promise((resolve) => window.setTimeout(resolve, 750));
recordCompatibilityEvent(
"Suspense",
"async setup resolved",
`request ${props.requestId}`,
);
</script>
<template>
<article
class="compat-probe compat-probe--resolved"
data-testid="compat-suspense-ready"
>
<span class="compat-probe__badge">Suspense resolved</span>
<strong>Async request {{ requestId }} complete</strong>
<p>{{ appValue }}</p>
<p>{{ labContext?.routeLabel.value }}</p>
<p>{{ route.fullPath }}</p>
</article>
</template>

View File

@@ -0,0 +1,41 @@
<script setup lang="ts">
import {
onBeforeMount,
onBeforeUnmount,
onBeforeUpdate,
onMounted,
onUnmounted,
onUpdated,
ref,
} from "vue";
import { useRoute } from "vue-router";
import { recordCompatibilityEvent } from "../compatibility-lab";
const props = defineProps<{
instanceName: string;
revision: number;
}>();
const route = useRoute();
const localCount = ref(0);
const record = (hook: string) =>
recordCompatibilityEvent(props.instanceName, hook, route.fullPath);
onBeforeMount(() => record("onBeforeMount"));
onMounted(() => record("onMounted"));
onBeforeUpdate(() => record("onBeforeUpdate"));
onUpdated(() => record("onUpdated"));
onBeforeUnmount(() => record("onBeforeUnmount"));
onUnmounted(() => record("onUnmounted"));
</script>
<template>
<article class="compat-probe" data-testid="composition-lifecycle-probe">
<span class="compat-probe__badge">Composition API</span>
<strong>{{ instanceName }}</strong>
<p><code>useRoute()</code>: {{ route.fullPath }}</p>
<p>Revision {{ revision }} · local count {{ localCount }}</p>
<button type="button" @click="localCount += 1">
Increment local state
</button>
</article>
</template>

View File

@@ -0,0 +1,29 @@
<script setup lang="ts">
import { computed, inject } from "vue";
import { useRoute } from "vue-router";
import {
compatibilityLabContextKey,
demoAppValueKey,
} from "../compatibility-lab";
defineProps<{ location: "route tree" | "teleport" }>();
const route = useRoute();
const appValue = inject(demoAppValueKey, "missing app injection");
const labContext = inject(compatibilityLabContextKey);
const labValue = computed(
() => labContext?.routeLabel.value ?? "missing page injection",
);
</script>
<template>
<article
class="compat-probe"
:data-testid="`inject-probe-${location.replace(' ', '-')}`"
>
<span class="compat-probe__badge">provide / inject · {{ location }}</span>
<strong>{{ appValue }}</strong>
<p>Page injection: {{ labValue }}</p>
<p>Scoped route: {{ route.fullPath }}</p>
</article>
</template>

View File

@@ -0,0 +1,36 @@
<script setup lang="ts">
import {
onActivated,
onBeforeMount,
onBeforeUnmount,
onDeactivated,
onMounted,
onUnmounted,
ref,
} from "vue";
import { recordCompatibilityEvent } from "../compatibility-lab";
const props = defineProps<{ name: string }>();
const count = ref(0);
const record = (hook: string) =>
recordCompatibilityEvent(`KeepAlive ${props.name}`, hook);
onBeforeMount(() => record("onBeforeMount"));
onMounted(() => record("onMounted"));
onActivated(() => record("onActivated"));
onDeactivated(() => record("onDeactivated"));
onBeforeUnmount(() => record("onBeforeUnmount"));
onUnmounted(() => record("onUnmounted"));
</script>
<template>
<article
class="compat-probe compat-probe--keepalive"
:data-testid="`keep-alive-${name}`"
>
<span class="compat-probe__badge">Kept instance {{ name }}</span>
<strong>Counter: {{ count }}</strong>
<p>Increment, switch instances, then return to verify preserved state.</p>
<button type="button" @click="count += 1">Increment {{ name }}</button>
</article>
</template>

View File

@@ -0,0 +1,56 @@
<script lang="ts">
import { defineComponent } from "vue";
import type { RouteLocationNormalizedLoaded } from "vue-router";
import { recordCompatibilityEvent } from "../compatibility-lab";
export default defineComponent({
name: "CompatibilityOptionsProbe",
props: {
instanceName: { type: String, required: true },
revision: { type: Number, required: true },
},
data: () => ({ localCount: 0 }),
beforeCreate() {
recordCompatibilityEvent(this.instanceName, "beforeCreate");
},
created() {
recordCompatibilityEvent(this.instanceName, "created", this.routePath());
},
beforeMount() {
recordCompatibilityEvent(this.instanceName, "beforeMount");
},
mounted() {
recordCompatibilityEvent(this.instanceName, "mounted");
},
beforeUpdate() {
recordCompatibilityEvent(this.instanceName, "beforeUpdate");
},
updated() {
recordCompatibilityEvent(this.instanceName, "updated");
},
beforeUnmount() {
recordCompatibilityEvent(this.instanceName, "beforeUnmount");
},
unmounted() {
recordCompatibilityEvent(this.instanceName, "unmounted");
},
methods: {
routePath() {
return (this as unknown as { $route: RouteLocationNormalizedLoaded })
.$route.fullPath;
},
},
});
</script>
<template>
<article class="compat-probe" data-testid="options-lifecycle-probe">
<span class="compat-probe__badge">Options API</span>
<strong>{{ instanceName }}</strong>
<p><code>$route</code>: {{ routePath() }}</p>
<p>Revision {{ revision }} · local count {{ localCount }}</p>
<button type="button" @click="localCount += 1">
Increment local state
</button>
</article>
</template>