dreamland
dreamland
NNuxt
Created by dreamland on 4/28/2024 in #❓・help
@vite-pwa/nuxt clients.matchAll not working in ServiceWorker with subdomain scope
It seems to be a problem with a subdomain as scope for the ServiceWorker. example.com works, but subdomain.example.com does not work, returns empty list.
4 replies
NNuxt
Created by dreamland on 4/28/2024 in #❓・help
@vite-pwa/nuxt clients.matchAll not working in ServiceWorker with subdomain scope
@Joaquín tagging you, because I've seen that you are experienced with PWA
4 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
the solution of a lot of things it to try to make it work in a sample project, then your can compare it to your main project
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
only reason i can think of why prerender would not work if there are some useState refs that are not initialized at build time, and then when it tries to render some component it gets undefined and breaks
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
No description
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
yes
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
this allows custom SEO meta tags per route
yes per route aka page
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
well as only 1 of the options has no ❌ blockers, i chose: prerender SSR all pages with <ClientOnly> in "SPA" pages + custom loading screen
routeRules: {
"/**": { prerender: true },
}
routeRules: {
"/**": { prerender: true },
}
<!-- some SPA page -->
<template>
<!-- ready is a ref from the custom loading screen logic -->
<ClientOnly v-if="ready">
<!-- page -->
</ClientOnly>
</template>
<!-- some SPA page -->
<template>
<!-- ready is a ref from the custom loading screen logic -->
<ClientOnly v-if="ready">
<!-- page -->
</ClientOnly>
</template>
this allows custom SEO meta tags per route and control over static initial html size static small size initial html for "SPA" pages static large size initial html for static pages
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
i'll try to break it down by what my goal is and by what i gathered about the features that are offered by the different approaches my goal SPA part of the site 🎯 static small size initial html (to show something as soon as possible) 🎯 loading indicator (this is not really a goal, more like a necessary evil to show something as soon as possible) 🎯 api (nitro) 🎯 meta tags for "/" route static part of the site 🎯 static initial html 🎯 custom meta tags per route approaches SPA ✔️ static small size initial html ✔️ loading indicator (~/app/spa-loading-template.html) ✔️ api (nitro) ✔️ meta tags for "/" route ❌ custom meta tags per route SSG ✔️ static initial html ✔️ custom meta tags per route ❌ api (nitro) (?) dynamic SSR ❌ static initial html (to show something as soon as possible) ✔️ custom meta tags per route ✔️ api (nitro) ➖ SSR performance paranoia (currently 60k users, aiming for millions very soon) ➖ SSR feels like losing ownership over network traffic prerender SSR ✔️ static initial html with control over size through ClientOnly ➖ needs custom loading indicator ✔️ custom meta tags per route ✔️ api (nitro) as you can see the downsides of dynamic SSR are more subjective than objective for a side project dynamic SSR would be just fine, but for this project i prefer to eliminate uncertainties
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
i also have a custom loading indicator.. i'd like to use the default ~/app/spa-loading-template.html but unforunately that is only available when using ssr: false, which is not what i want, because.. well you know what happens, it's not SSR-ed, hence no custom meta tags on the routes
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
yes i do that
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
the benefit of prerendering is that pages can have their one meta tags for search engine results essentials i have a SPA part and a static part / (SPA) /somePage (frontend routed) /help/someTopic (static with custom meta tags)
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
yea
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
i'll try to keep my sanity, thanks for your help!
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
i think there is a misunderstanding. you were talking about nuxt generate (aka SSG), and i was asking about serving the SSG static output along with running the nitro server do you mean setting prerender routes on a per route basis? i want all routes to be prerendered. nuxi build --prerender seem more appropriate in that case, but that is experimental https://nuxt.com/docs/api/commands/build i feel like i'm trying to achieve a very basic usecase, but it feels like i'm fighting nuxt to do something it's not supposed to
40 replies
NNuxt
Created by dreamland on 3/6/2024 in #❓・help
SPA w/ SEO or SSG + nitro?
how to run the nitro backend and serve the static output in parallel?
40 replies
NNuxt
Created by dreamland on 3/7/2024 in #❓・help
`?raw` import works in vite (`nuxt dev`) but not in rollup (`nuxt generate`)
workaround for the meantime
// app.css.ts

export default `
.raw {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background-color: black;
}
`
// app.css.ts

export default `
.raw {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background-color: black;
}
`
<!-- app.vue -->

<script setup lang="ts">

import appcss from "~/app.css"

useHead({
style: [appcss]
})

</script>

<template>
<div class="raw">
</div>
</template>
<!-- app.vue -->

<script setup lang="ts">

import appcss from "~/app.css"

useHead({
style: [appcss]
})

</script>

<template>
<div class="raw">
</div>
</template>
pretty spartanic but gets the job done in the most straightforward and stable way
8 replies