From 8b2b120a70452fd22757b6c11939152ca8c3484f Mon Sep 17 00:00:00 2001 From: Matt Obee Date: Fri, 17 Jan 2025 15:24:05 +0000 Subject: [PATCH 1/5] Debug components --- src/components/Debug.vue | 68 +++++++++++++++++++++++++++++++++ src/pages/curation-policy.astro | 11 ++++++ 2 files changed, 79 insertions(+) create mode 100644 src/components/Debug.vue diff --git a/src/components/Debug.vue b/src/components/Debug.vue new file mode 100644 index 00000000..1cb71f9a --- /dev/null +++ b/src/components/Debug.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/src/pages/curation-policy.astro b/src/pages/curation-policy.astro index 77ea4c75..b5a5ba8d 100644 --- a/src/pages/curation-policy.astro +++ b/src/pages/curation-policy.astro @@ -1,11 +1,22 @@ --- import DefaultLayout from '../layouts/default.astro'; +import Debug from '../components/Debug.vue'; + +// Disable prerendering to enable SSR +export const prerender = false; + +// Generate random number during SSR +const ssrNumber = Math.floor(Math.random() * 1000); ---

Event Curation Policy

+ + +

Server-side random number: {ssrNumber}

+

Eventua11y is independently curated by Matt Obee, guided by this curation policy. None of the events listed have paid to be there. The following criteria is used to evaluate the suitability of events before they appear in the calendar.

Subject matter

From 8c274c299fea6bab13743b53a6fe6bb1e890044c Mon Sep 17 00:00:00 2001 From: Matt Obee Date: Sun, 19 Jan 2025 11:47:26 +0000 Subject: [PATCH 2/5] Refactor --- src/components/Debug.vue | 47 ++++++++++++++------------------- src/pages/curation-policy.astro | 4 +-- src/pages/index.vue | 0 3 files changed, 22 insertions(+), 29 deletions(-) create mode 100644 src/pages/index.vue diff --git a/src/components/Debug.vue b/src/components/Debug.vue index 1cb71f9a..ee7968ed 100644 --- a/src/components/Debug.vue +++ b/src/components/Debug.vue @@ -1,14 +1,9 @@ @@ -23,32 +18,29 @@ export default defineComponent({ required: true } }, - setup() { - const count = ref(0) + setup(props) { + console.log('Received SSR number:', props.ssrNumber) + const currentNumber = ref(props.ssrNumber) - const increment = () => { - console.log('Button clicked!') - count.value++ - console.log('New count:', count.value) + const generateNew = () => { + currentNumber.value = Math.floor(Math.random() * 100) + 1 } return { - count, - increment + currentNumber, + generateNew } } }) diff --git a/src/pages/curation-policy.astro b/src/pages/curation-policy.astro index b5a5ba8d..9619cefd 100644 --- a/src/pages/curation-policy.astro +++ b/src/pages/curation-policy.astro @@ -3,7 +3,7 @@ import DefaultLayout from '../layouts/default.astro'; import Debug from '../components/Debug.vue'; // Disable prerendering to enable SSR -export const prerender = false; +// export const prerender = false; // Generate random number during SSR const ssrNumber = Math.floor(Math.random() * 1000); @@ -13,7 +13,7 @@ const ssrNumber = Math.floor(Math.random() * 1000);

Event Curation Policy

- +

Server-side random number: {ssrNumber}

diff --git a/src/pages/index.vue b/src/pages/index.vue new file mode 100644 index 00000000..e69de29b From 707cd5e7eca7f1cdac87b2bb61263de54e07f0e4 Mon Sep 17 00:00:00 2001 From: Matt Obee Date: Sun, 19 Jan 2025 11:47:40 +0000 Subject: [PATCH 3/5] Formatting --- src/components/Debug.vue | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/components/Debug.vue b/src/components/Debug.vue index ee7968ed..eed8ff62 100644 --- a/src/components/Debug.vue +++ b/src/components/Debug.vue @@ -1,37 +1,35 @@