forked from trent_larson/crowd-funder-for-time-pwa
docs: comprehensive documentation updates and modernization
- Update BUILDING.md with current build system information - Modernize various README files across the project - Update CHANGELOG.md with recent changes - Improve documentation consistency and formatting - Update platform-specific documentation (iOS, Electron, Docker) - Enhance test documentation and build guides
This commit is contained in:
@@ -7,10 +7,12 @@ CORS headers have been **disabled** to support Time Safari's core mission: enabl
|
||||
## What Changed
|
||||
|
||||
### ❌ Removed CORS Headers
|
||||
|
||||
- `Cross-Origin-Opener-Policy: same-origin`
|
||||
- `Cross-Origin-Embedder-Policy: require-corp`
|
||||
|
||||
### ✅ Results
|
||||
|
||||
- Images from **any domain** now work in development and production
|
||||
- No proxy configuration needed
|
||||
- No whitelist of supported image hosts
|
||||
@@ -19,11 +21,13 @@ CORS headers have been **disabled** to support Time Safari's core mission: enabl
|
||||
## Technical Tradeoffs
|
||||
|
||||
### 🔻 Lost: SharedArrayBuffer Performance
|
||||
|
||||
- **Before**: Fast SQLite operations via SharedArrayBuffer
|
||||
- **After**: Slightly slower IndexedDB fallback mode
|
||||
- **Impact**: Minimal for typical usage - absurd-sql automatically falls back
|
||||
|
||||
### 🔺 Gained: Universal Image Support
|
||||
|
||||
- **Before**: Only specific domains worked (TimeSafari, Flickr, Imgur, etc.)
|
||||
- **After**: Any image URL works immediately
|
||||
- **Impact**: Massive improvement for user experience
|
||||
@@ -31,6 +35,7 @@ CORS headers have been **disabled** to support Time Safari's core mission: enabl
|
||||
## Architecture Impact
|
||||
|
||||
### Database Operations
|
||||
|
||||
```typescript
|
||||
// absurd-sql automatically detects SharedArrayBuffer availability
|
||||
if (typeof SharedArrayBuffer === "undefined") {
|
||||
@@ -43,6 +48,7 @@ if (typeof SharedArrayBuffer === "undefined") {
|
||||
```
|
||||
|
||||
### Image Loading
|
||||
|
||||
```typescript
|
||||
// All images load directly now
|
||||
export function transformImageUrlForCors(imageUrl: string): string {
|
||||
@@ -53,11 +59,13 @@ export function transformImageUrlForCors(imageUrl: string): string {
|
||||
## Why This Was The Right Choice
|
||||
|
||||
### Time Safari's Use Case
|
||||
|
||||
- **Community platform** where users share content from anywhere
|
||||
- **User-generated content** includes images from arbitrary websites
|
||||
- **Flexibility** is more important than marginal performance gains
|
||||
|
||||
### Alternative Would Require
|
||||
|
||||
- Pre-configuring proxies for every possible image hosting service
|
||||
- Constantly updating proxy list as users find new sources
|
||||
- Poor user experience when images fail to load
|
||||
@@ -66,11 +74,13 @@ export function transformImageUrlForCors(imageUrl: string): string {
|
||||
## Performance Comparison
|
||||
|
||||
### Database Operations
|
||||
|
||||
- **SharedArrayBuffer**: ~2x faster for large operations
|
||||
- **IndexedDB**: Still very fast for typical Time Safari usage
|
||||
- **Real Impact**: Negligible for typical user operations
|
||||
|
||||
### Image Loading
|
||||
|
||||
- **With CORS**: Many images failed to load in development
|
||||
- **Without CORS**: All images load immediately
|
||||
- **Real Impact**: Massive improvement in user experience
|
||||
@@ -87,11 +97,13 @@ export function transformImageUrlForCors(imageUrl: string): string {
|
||||
## Migration Notes
|
||||
|
||||
### For Developers
|
||||
|
||||
- No code changes needed
|
||||
- `transformImageUrlForCors()` still exists but returns original URL
|
||||
- All existing image references work without modification
|
||||
|
||||
### For Users
|
||||
|
||||
- Images from any website now work immediately
|
||||
- No more "image failed to load" issues in development
|
||||
- Consistent behavior between development and production
|
||||
@@ -99,12 +111,14 @@ export function transformImageUrlForCors(imageUrl: string): string {
|
||||
## Future Considerations
|
||||
|
||||
### If Performance Becomes Critical
|
||||
|
||||
1. **Selective CORS**: Enable only for specific operations
|
||||
2. **Service Worker**: Handle image proxying at service worker level
|
||||
3. **Build-time Processing**: Pre-process images during build
|
||||
4. **User Education**: Guide users toward optimized image hosting
|
||||
|
||||
### Monitoring
|
||||
|
||||
- Track database operation performance
|
||||
- Monitor for any user-reported slowness
|
||||
- Consider re-enabling SharedArrayBuffer if usage patterns change
|
||||
@@ -113,4 +127,4 @@ export function transformImageUrlForCors(imageUrl: string): string {
|
||||
|
||||
This change prioritizes **user experience** and **community functionality** over marginal performance gains. The database still works efficiently via IndexedDB, while images now work universally without configuration.
|
||||
|
||||
For a community platform like Time Safari, the ability to share images from any domain is fundamental to the user experience and mission.
|
||||
For a community platform like Time Safari, the ability to share images from any domain is fundamental to the user experience and mission.
|
||||
|
||||
Reference in New Issue
Block a user