VueAirport provides full integration with Vue DevTools to help you visualize and debug your component registries in real-time.
Install the DevTools package as a development dependency:
npm install -D vue-airport-devtools
yarn add -D vue-airport-devtools
pnpm add -D vue-airport-devtools
bun add -D vue-airport-devtools
The plugin automatically injects DevTools setup in your application:
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { VueAirportDevTools } from 'vue-airport-devtools/vite'
export default defineConfig({
plugins: [
vue(),
VueAirportDevTools(), // Auto-injects DevTools
],
})
DEV).For Nuxt, simply add the DevTools module to your configuration:
export default defineNuxtConfig({
modules: [
// ... other modules
'vue-airport-devtools/nuxt',
],
})
If you prefer manual setup or don't use Vite:
import { createApp } from 'vue'
import { setupAirportDevTools } from 'vue-airport-devtools'
import App from './App.vue'
const app = createApp(App)
// Enable DevTools only in development
if (import.meta.env.DEV) {
setupAirportDevTools(app)
}
app.mount('#app')
DevTools integration is opt-in and must be explicitly enabled when creating a desk:
import { useCheckIn } from 'vue-airport'
const { createDesk } = useCheckIn()
createDesk(MY_DESK_KEY, {
devTools: true,
deskId: 'my-feature-desk',
})
devTools: true in the desk options to enable tracking and visualization. This prevents performance overhead for desks that don't need debugging.Provide a descriptive deskId for better visibility in the DevTools inspector. If not provided, the desk will use the Symbol's description:
// Without deskId - uses Symbol description
createDesk(MY_DESK_KEY, {
devTools: true,
});
// Shows as: "MY_DESK_KEY" (from Symbol description)
// With deskId - explicit name
createDesk(MY_DESK_KEY, {
devTools: true,
deskId: 'user-profile-form',
});
// Shows as: "user-profile-form"
deskId is optional but highly recommended for complex applications with multiple desks. It makes debugging significantly easier.Item metadata appears in the inspector, making it easier to understand what each item represents:
const { checkIn } = useCheckIn()
checkIn(MY_DESK_KEY, {
id: 'user-123',
autoCheckIn: true,
data: { name: 'John Doe', email: 'john@example.com' },
meta: {
label: 'Admin User Profile',
role: 'admin',
active: true,
priority: 'high',
description: 'Primary administrator account',
createdBy: 'AuthModule',
},
})
Metadata best practices:
label: Human-readable name (shown prominently in inspector)active: Boolean state indicatorspriority: Importance levelrole, type, category: Classificationdescription: Detailed explanationThe Airport Registry Inspector provides a complete visualization of your desk registries with real-time updates.
The inspector displays your registries in a hierarchical tree:
Desks (Parent Nodes):
deskId or auto-generated identifierItems (Child Nodes):
active: trueUser Profile Form (3)
- user-123 [active]
- user-456
- user-789 [active]
Shopping Cart (2)
- product-001
- product-002
Select any node to view comprehensive information:
For Desks:
{
deskId: "user-profile-form",
size: 3,
items: [...],
context: {
activeUser: "user-123",
selectUser: [Function],
// ... other context properties
}
}
For Items:
{
id: "user-123",
metadata: {
label: "Admin User Profile",
active: true,
role: "admin",
priority: "high",
createdBy: "AuthModule"
},
data: {
name: "John Doe",
email: "john@example.com",
role: "administrator"
},
timestamps: {
createdAt: "2025-01-15T10:30:00.000Z",
updatedAt: "2025-01-15T11:45:00.000Z"
}
}
Data Displayed:
The inspector updates automatically as your application state changes:
Check if a component successfully registered:
deskIdWhen data doesn't appear as expected:
data propertytimestamps.updatedAt for recent changesTrack which items are currently active:
[active] badges in the treemetadata.active in the details panelThe Airport Events Timeline traces all desk events in real-time, providing a complete audit trail of your application's registration lifecycle.
The timeline uses color-coded events for easy identification:
Fired when a component registers with a desk
Details shown:
- Desk ID
- Item ID
- Initial data
- Metadata
- Timestamp
Fired when a component unregisters from a desk
Details shown:
- Desk ID
- Item ID
- Timestamp
- Reason (unmount, manual, condition change)
Fired when an item's data is updated
Details shown:
- Desk ID
- Item ID
- Data before
- Data after
- Timestamp
Fired when a plugin executes
Details shown:
- Plugin name
- Desk ID
- Item ID
- Execution duration (ms)
- Data transformation
- Timestamp
Fired when a desk registry is cleared
Details shown:
- Desk ID
- Number of items cleared
- Timestamp
Click on any event to see comprehensive information:
Check-In Event:
{
type: 'check-in',
deskId: 'user-profile-form',
itemId: 'user-123',
timestamp: 1705315800000,
data: {
name: 'John Doe',
email: 'john@example.com'
},
metadata: {
label: 'Admin User',
role: 'admin'
}
}
Update Event:
{
type: 'update',
deskId: 'user-profile-form',
itemId: 'user-123',
timestamp: 1705316100000,
before: {
email: 'john@example.com'
},
after: {
email: 'john.doe@company.com'
}
}
Plugin Event:
{
type: 'plugin',
pluginName: 'validation',
deskId: 'user-profile-form',
itemId: 'user-123',
duration: 2.5, // milliseconds
timestamp: 1705316200000,
result: 'success'
}
Use filters to focus on specific event types:
Track plugin execution times:
Problem: A child component doesn't appear to communicate with its parent desk.
Debugging steps:
deskIdautoCheckIn: true or manual check-inonBeforeCheckIn hook cancelled registrationCommon causes:
autoCheckIn: false without manual check-infalseProblem: Component data changes but the desk registry doesn't update.
Debugging steps:
checkIn(DESK_KEY, {
watchData: true,
data: () => myData.value,
});
↻ Update eventsCommon causes:
watchData: false or not set.value)shallow: true when nested changes occurProblem: Need to verify plugin execution and performance.
Debugging steps:
createDesk(DESK_KEY, {
devTools: true,
plugins: [myPlugin],
});
duration field in plugin eventsExample plugin debugging:
const debugPlugin = {
name: 'debug-validation',
onBeforeCheckIn: (id, data, desk) => {
console.log('[Plugin Debug] Before check-in:', { id, data });
if (!data.email) {
console.warn('[Plugin Debug] Validation failed: Missing email');
return false; // Cancels check-in
}
return true;
},
onCheckIn: (id, data, desk) => {
console.log('[Plugin Debug] Checked in successfully:', { id, data });
},
};
createDesk(FORM_DESK_KEY, {
devTools: true,
deskId: 'form-validation-desk',
plugins: [debugPlugin],
});
Timeline will show:
Plugin: debug-validation
Duration: 0.8ms
Result: cancelled (returned false)
Common issues:
undefined (treated as true)Problem: Component not checking in/out based on condition.
Debugging steps:
const isVisible = ref(true);
checkIn(DESK_KEY, {
watchCondition: isVisible, // or () => someCondition.value
data: myData,
});
truefalseautoCheckIn: false: No check-in until condition is trueautoCheckIn: true: Immediate check-in if condition starts trueRef or reactive functionExample debugging:
// Wrong: Non-reactive condition
checkIn(DESK_KEY, {
watchCondition: () => true,
});
// Correct: Reactive condition
const isActive = ref(false);
checkIn(DESK_KEY, {
watchCondition: isActive,
});
// Complex condition
checkIn(DESK_KEY, {
watchCondition: () =>
isLoggedIn.value &&
hasPermission.value &&
!isDisabled.value,
autoCheckIn: true,
});
Timeline patterns:
false → true: See Check In eventtrue → false: See Check Out eventProblem: Items not checking out when components unmount.
Debugging steps:
✗ Check Out events in timelineonUnmounted cleanup (VueAirport handles this automatically)onBeforeCheckOut hook returning false// Manual cleanup if needed
const { checkOut } = checkIn(DESK_KEY, { ... });
// Later
checkOut(); // Manual check-out
Make debugging easier with clear, human-readable labels:
// Not helpful
checkIn('1', data, {
active: true,
});
// Descriptive and informative
checkIn('user-123', userData, {
label: 'John Doe (Admin)',
role: 'admin',
active: true,
department: 'Engineering',
});
Benefits:
Include detailed metadata that provides debugging context:
// ❌ Minimal metadata
checkIn('item-1', data, {
active: true,
});
// ✅ Rich, contextual metadata
checkIn('order-12345', orderData, {
label: '🛒 Order #12345',
active: true,
status: 'pending',
priority: 'high',
customer: 'John Doe',
createdBy: 'CheckoutModule',
source: 'web-app',
timestamp: Date.now(),
tags: ['urgent', 'vip-customer'],
});
Recommended metadata fields:
label: Human-readable description (shown prominently)active: Boolean state indicatorstatus: Current state ('pending', 'complete', etc.)priority: Importance level ('low', 'medium', 'high')type, category, role: ClassificationcreatedBy, source: Origin trackingtags: Array of keywords for filteringChoose descriptive IDs that reflect the desk's purpose and domain:
// Generic or unclear
createDesk(KEY1, {
devTools: true,
deskId: 'desk1',
});
// Clear and descriptive
createDesk(NAVIGATION_KEY, {
devTools: true,
deskId: 'main-navigation-tabs',
});
createDesk(FORM_KEY, {
devTools: true,
deskId: 'user-profile-form-fields',
});
createDesk(CART_KEY, {
devTools: true,
deskId: 'shopping-cart-items',
});
createDesk(ADMIN_USERS_KEY, {
devTools: true,
deskId: 'admin-panel-users',
});
Naming conventions:
Only enable DevTools for desks you need to debug:
// Enable for desks under development or debugging
createDesk(NEW_FEATURE_KEY, {
devTools: true,
deskId: 'new-feature-beta',
});
// Don't enable for all desks unnecessarily
createDesk(STABLE_FEATURE_KEY, {
devTools: false,
});
Benefits:
Use debug logging alongside DevTools for comprehensive insights:
createDesk(MY_DESK_KEY, {
devTools: true,
debug: true,
deskId: 'debug-desk',
});
checkIn(MY_DESK_KEY, {
debug: true,
data: myData,
});
Debug output example:
[useCheckIn:desk-core] Checked in: user-123 { name: 'John', role: 'admin' }
[useCheckIn:desk-child] Checked in: user-123 { name: 'John', role: 'admin' }
[useCheckIn:desk-core] Updated: user-123 { role: 'superadmin' }
DevTools are automatically disabled in production and have zero impact on your final bundle.
Development impact:
Possible causes and solutions:
npm run dev or equivalentimport.meta.env.DEV === truevite.config.ts:
import { VueAirportDevTools } from 'vue-airport-devtools/vite'
export default defineConfig({
plugins: [vue(), VueAirportDevTools()],
})
nuxt.config.ts:
export default defineNuxtConfig({
modules: ['vue-airport-devtools/nuxt'],
})
Debugging steps:
createDesk(MY_DESK_KEY, {
devTools: true,
});
Common causes:
createDesk()checkIn()autoCheckIn: true or manual check-inonBeforeCheckIn hooks are cancelling registrationSolutions:
// Only enable for desks you're debugging
createDesk(DEBUG_DESK_KEY, {
devTools: true,
});
createDesk(OTHER_DESK_KEY, {
devTools: false, // Disabled
});
createDesk(MY_DESK_KEY, {
devTools: true,
debug: false, // Disable console logging
});