Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: opt in to import.meta.* properties #1514

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading