Skip to content

[Feature] Add Qwik Support #49

@Moon-DaeSeung

Description

@Moon-DaeSeung

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

  1. 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
  2. SsgoiTransition Component (ssgoi-transition.tsx)

    • Wraps individual pages/components
    • Requires unique id prop (typically the route path)
    • Manages enter/exit animations
    • Uses useTask$() for lifecycle management
    • Implements useVisibleTask$() for client-side animations
  3. 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

  1. Resumability

    • Ensure animations can resume properly after hydration
    • Store animation state in serializable format
    • Handle server/client boundary correctly
  2. Lazy Loading

    • Use $() for transition callbacks
    • Implement proper code splitting
    • Minimize initial bundle impact
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions