-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
Add Qwik support to SSGOI following the existing framework patterns. Qwik's unique resumability and lazy-loading architecture requires special consideration for optimal performance.
Implementation Details
Package Structure
Create a new package at packages/qwik/ following the existing pattern:
packages/qwik/
├── src/
│ └── lib/
│ ├── context.tsx # Qwik context provider using useContextProvider
│ ├── ssgoi.tsx # Main wrapper component
│ ├── ssgoi-transition.tsx # Transition wrapper component
│ ├── transition.ts # Qwik-specific transition hook
│ ├── transitions/ # Re-exports from @ssgoi/core
│ └── view-transitions/ # Re-exports from @ssgoi/core
├── package.json
├── tsconfig.json
└── vite.config.ts
Key Components to Implement
-
Ssgoi Provider Component (
ssgoi.tsx)- Wraps the entire Qwik application
- Manages global transition configuration
- Handles route change detection (QwikCity router)
- Uses
useContextProvider()for context sharing - Leverages Qwik's
$()for lazy execution
-
SsgoiTransition Component (
ssgoi-transition.tsx)- Wraps individual pages/components
- Requires unique
idprop (typically the route path) - Manages enter/exit animations
- Uses
useTask$()for lifecycle management - Implements
useVisibleTask$()for client-side animations
-
transition() Hook (
transition.ts)- For animating individual elements
- Supports mount/unmount animations
- Qwik-specific implementation using signals and tasks
- Proper handling of serialization boundaries
Qwik-Specific Considerations
-
Resumability
- Ensure animations can resume properly after hydration
- Store animation state in serializable format
- Handle server/client boundary correctly
-
Lazy Loading
- Use
$()for transition callbacks - Implement proper code splitting
- Minimize initial bundle impact
- Use
-
Signals
- Use Qwik signals for reactive animation state
- Proper integration with Qwik's reactivity system
Demo Application
Create apps/qwik-demo/ with:
- QwikCity routing example
- SSR/SSG support demonstration
- Showcase all transition types
- Performance metrics display
Acceptance Criteria
- Qwik package created with same API surface as React/Svelte
- All core transitions work correctly
- Full SSR/resumability support
- Demo application showcasing features
- TypeScript support with proper types
- Documentation updated to include Qwik examples
- Unit tests for Qwik-specific logic
- Performance optimized for Qwik's architecture
- Proper serialization of animation state
Related to Linear issue: SSG-52
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request