chore: switch away from reactivity transform

also use a released version of nuxt
This commit is contained in:
eggy 2023-01-28 15:32:48 -05:00
parent a7f38e77ae
commit 577e00a870
8 changed files with 1069 additions and 1784 deletions

View File

@ -1,30 +1,21 @@
<script setup lang="ts"> <script setup lang="ts">
import type { Color, ViewportLength } from "csstype"; import type { Color, ViewportLength } from "csstype";
// fix ReferenceError: _unref is not defined const props = withDefaults(
// https://github.com/nuxt/framework/issues/5546 defineProps<{
import { unref as _unref } from "vue"; href?: string;
id?: string;
color?: Color;
darkcolor?: Color;
title?: string;
clearstyles?: boolean;
forceheight?: ViewportLength<"rem">;
}>(),
{ color: "pink", darkcolor: "#c88994", clearstyles: false }
);
const { const padding = props.clearstyles ? "0" : "1rem";
href, const height = props.forceheight ?? "100%";
id,
color = "pink",
darkcolor = "#c88994",
title,
clearstyles = false,
forceheight,
} = defineProps<{
href?: string;
id?: string;
color?: Color;
darkcolor?: Color;
title?: string;
clearstyles?: boolean;
forceheight?: ViewportLength<"rem">;
}>();
const padding = clearstyles ? "0" : "1rem";
const height = forceheight ?? "100%";
// v-bind DOES NOT WORK on initial render // v-bind DOES NOT WORK on initial render
// so unfortunately we have to use the old way // so unfortunately we have to use the old way
@ -32,8 +23,8 @@ const height = forceheight ?? "100%";
const cssVars = { const cssVars = {
"--padding": padding, "--padding": padding,
"--height": height, "--height": height,
"--color": color, "--color": props.color,
"--darkcolor": darkcolor, "--darkcolor": props.darkcolor,
}; };
</script> </script>

View File

@ -2,15 +2,15 @@
import type { StoryParsedContent, BlogParsedContent } from "@/shared/types"; import type { StoryParsedContent, BlogParsedContent } from "@/shared/types";
import { calcReadingTime } from "@/shared/metadata"; import { calcReadingTime } from "@/shared/metadata";
const { post, type, highlighttags } = defineProps<{ const props = defineProps<{
post: StoryParsedContent | BlogParsedContent; post: StoryParsedContent | BlogParsedContent;
type: "stories" | "blog"; type: "stories" | "blog";
highlighttags?: string[]; highlighttags?: string[];
}>(); }>();
const readingTime = calcReadingTime(post); const readingTime = calcReadingTime(props.post);
const descText = const descText =
type === "stories" props.type === "stories"
? `${readingTime.words.total} words` ? `${readingTime.words.total} words`
: `${readingTime.minutes} min read`; : `${readingTime.minutes} min read`;
</script> </script>

View File

@ -1,12 +1,14 @@
<script setup lang="ts"> <script setup lang="ts">
import type { Project } from "@/data/projects"; import type { Project } from "@/data/projects";
import { unref as _unref } from "vue"; import { unref as _unref } from "vue";
const { project, reverse = false } = defineProps<{ const props = defineProps<{
project: Project; project: Project;
reverse?: boolean; reverse?: boolean;
}>(); }>();
const imgUrl = project.img ? `url(/images/projects/${project.img})` : "none"; const imgUrl = props.project.img
? `url(/images/projects/${props.project.img})`
: "none";
</script> </script>
<template> <template>

View File

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
const { dest, highlight = false } = defineProps<{ const props = defineProps<{
dest: string; dest: string;
highlight?: boolean; highlight?: boolean;
}>(); }>();

View File

@ -1,6 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
const { src } = defineProps<{ src: string }>(); const props = defineProps<{ src: string }>();
const src = props.src;
const imgSrc = const imgSrc =
src.startsWith("http://") || src.startsWith("https://") src.startsWith("http://") || src.startsWith("https://")
? src ? src

View File

@ -7,7 +7,6 @@ export default defineNuxtConfig({
"@nuxtjs/tailwindcss", "@nuxtjs/tailwindcss",
"@nuxtjs/color-mode", "@nuxtjs/color-mode",
"@funken-studio/sitemap-nuxt-3", "@funken-studio/sitemap-nuxt-3",
"nuxt-full-static",
], ],
nitro: { nitro: {
prerender: { prerender: {
@ -89,7 +88,6 @@ export default defineNuxtConfig({
}, },
}, },
experimental: { experimental: {
reactivityTransform: true,
noScripts: true, noScripts: true,
}, },
}); });

View File

@ -12,8 +12,7 @@
"@funken-studio/sitemap-nuxt-3": "^4.0.4", "@funken-studio/sitemap-nuxt-3": "^4.0.4",
"@nuxtjs/tailwindcss": "^6.2.0", "@nuxtjs/tailwindcss": "^6.2.0",
"@tailwindcss/typography": "^0.5.2", "@tailwindcss/typography": "^0.5.2",
"nuxt": "^3.0.0", "nuxt": "^3.1.1",
"nuxt-full-static": "^0.2.1",
"reading-time": "^2.0.0-1", "reading-time": "^2.0.0-1",
"rehype-katex": "^6.0.2", "rehype-katex": "^6.0.2",
"remark-math": "^5.1.1", "remark-math": "^5.1.1",

2790
yarn.lock

File diff suppressed because it is too large Load Diff