1.8 KiB
Supabase Client Import Standardization
Summary
All Edge Functions now use consistent Supabase client imports from the same ESM source.
Changes Made
1. get-directions/index.ts
Before:
import { createClient } from 'jsr:@supabase/supabase-js@2'
After:
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'
2. get-place-photo/index.ts
Before:
import { createClient } from 'jsr:@supabase/supabase-js@2'
After:
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'
3. generate-itinerary/index.ts
Already using:
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'
Benefits
-
Consistent Module Resolution: All Edge Functions now use the same import source, preventing potential version mismatches or module resolution conflicts.
-
Reliable Deployment: Using ESM.sh ensures consistent package resolution across all Deno deployments.
-
Maintainability: Single source of truth for Supabase client imports makes future updates easier.
-
Compatibility: ESM.sh is the recommended approach for Supabase Edge Functions and provides better compatibility with Deno's module system.
Deployment Status
✅ get-directions - Deployed successfully ✅ get-place-photo - Deployed successfully ✅ generate-itinerary - Already using correct import
Testing Recommendations
Test all three Edge Functions to ensure they work correctly with the standardized imports:
- generate-itinerary: Create a new itinerary and verify place caching works
- get-directions: Request route calculations and verify directions caching works
- get-place-photo: Load place photos and verify storage caching works
All functions should continue to work as expected with improved consistency.