Skip to content

Commit

Permalink
fix: opt in to import.meta.* properties
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Mar 25, 2024
1 parent 687ce09 commit b352168
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/nuxt/playground/pages/firestore-useDocument.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ const { data: config, promise } = useDocument(configRef, { wait: true })
onMounted(() => {
promise.value.then((data) => {
if (process.client) {
if (import.meta.client) {
console.log('promise resolved', toRaw(data))
}
isDoneFetching.value = true
})
usePendingPromises().then((data) => {
if (process.client) {
if (import.meta.client) {
console.log('pending promise resolved', toRaw(data))
}
isAllDoneFetching.value = true
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/runtime/analytics/composables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ import { useFirebaseApp } from '../app/composables'
* @returns the Analytics instance
*/
export function useAnalytics() {
return process.client ? getAnalytics(useFirebaseApp()) : null
return import.meta.client ? getAnalytics(useFirebaseApp()) : null
}
2 changes: 1 addition & 1 deletion packages/nuxt/templates/plugin.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(VueFire, { firebaseApp })

<% if(options.ssr) { %>
if (process.server) {
if (import.meta.server) {
// collect the initial state
nuxtApp.payload.vuefire = useSSRInitialState(undefined, firebaseApp)
} else if (nuxtApp.payload?.vuefire) {
Expand Down

0 comments on commit b352168

Please sign in to comment.