track cloud-specific onboarding events and add performance optimizations for hosted cloud app (#6158)

## Summary
- Complete telemetry implementation with circular dependency fix
- Add build performance optimizations from main branch

### Telemetry Features
-  Final telemetry events: signup opened, survey flow, email
verification
-  Onboarding mode to prevent circular dependencies during app
initialization
-  Lazy composable loading with dynamic imports for workflow tracking
-  Survey responses as both event properties and persistent user
properties
-  User identification method for onboarding flow
-  Deferred user property setting until user is authenticated

### Performance Optimizations  
-  Tree-shaking enabled to remove unused code
-  Manual chunk splitting for vendor libraries (primevue, vue, tiptap,
chart.js, etc.)
-  Enhanced esbuild minification with console removal in production
builds
-  GENERATE_SOURCEMAP environment variable control
-  Maintained ImportMap disabled for cloud performance

## Test plan
- [x] Telemetry events track correctly in Mixpanel
- [x] No circular dependency errors on app startup
- [x] Survey responses appear as both event properties and user
properties
- [x] Build optimizations reduce bundle size and improve loading
performance
- [x] All lint/format/typecheck passes

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6158-track-cloud-specific-onboarding-events-and-add-performance-optimizations-for-hosted-cloud-2926d73d365081a7b533dde249d5f734)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Christian Byrne
2025-10-19 23:16:56 -07:00
committed by GitHub
parent b708ebf540
commit 0d4d68fec9
8 changed files with 387 additions and 44 deletions

View File

@@ -40,6 +40,8 @@ import { useI18n } from 'vue-i18n'
import { useRoute, useRouter } from 'vue-router'
import { useFirebaseAuth } from 'vuefire'
import { isCloud } from '@/platform/distribution/types'
import { useTelemetry } from '@/platform/telemetry'
import { useToastStore } from '@/platform/updates/common/toastStore'
import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore'
@@ -106,6 +108,12 @@ const goBack = async () => {
async function onSend() {
try {
await authStore.verifyEmail()
// Track email verification requested
if (isCloud) {
useTelemetry()?.trackEmailVerification('requested')
}
useToastStore().add({
severity: 'success',
summary: t('cloudVerifyEmail_toast_success', {
@@ -121,6 +129,11 @@ async function onSend() {
}
onMounted(async () => {
// Track email verification screen opened
if (isCloud) {
useTelemetry()?.trackEmailVerification('opened')
}
// If the user is already verified (email link already clicked),
// continue to the next step automatically.
if (authStore.isEmailVerified) {
@@ -135,6 +148,10 @@ onMounted(async () => {
if (auth.currentUser && !redirectInProgress.value) {
await auth.currentUser.reload()
if (auth.currentUser?.emailVerified) {
// Track email verification completed
if (isCloud) {
useTelemetry()?.trackEmailVerification('completed')
}
void redirectToNextStep()
}
}