Skip to content

feat(components/atom/videoPlayer): use static imports for vite compatibility#2964

Merged
kikoruiz merged 1 commit intomasterfrom
use-static-imports
Feb 26, 2026
Merged

feat(components/atom/videoPlayer): use static imports for vite compatibility#2964
kikoruiz merged 1 commit intomasterfrom
use-static-imports

Conversation

@kikoruiz
Copy link
Member

@kikoruiz kikoruiz commented Feb 26, 2026

Category/Component

🔍 Show

Description, Motivation and Context

Fix SSR suspension and Vite compatibility issues

Changes
  • SSR-safe rendering: Added client-only rendering guard to prevent Suspense errors during server-side rendering
  • Vite compatibility: Replaced dynamic template string imports with static imports to fix Vite bundling issues
Technical Details

Before:

  • lazy(() => import('../components/${videoType.PLAYER_COMPONENT}.js')) - Dynamic imports with template strings (Vite can't analyze)
  • <Suspense> caused suspension errors during SSR

After:

  • Static imports mapped to a PLAYER_COMPONENTS object
  • Component only renders on client-side after hydration
  • Fallback component shown during SSR
Backwards Compatibility

✅ Fully backwards compatible - no breaking changes to public API


  • 🪲 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🧾 Documentation
  • 📷 Demo
  • 🧪 Test
  • 🧠 Refactor
  • 💄 Styles
  • 🛠️ Tool

@github-actions
Copy link

STATEMENTS BRANCHES FUNCTIONS LINES
≍ 0.04↑ ≍ 0.01↑ ≍ 0.12↑ ≍ 0.12↑
% 76.58 63.44 68.31 78.13
ABS 3507 / 4579 2128 / 3354 690 / 1010 3324 / 4254

@kikoruiz kikoruiz merged commit ca85e06 into master Feb 26, 2026
7 checks passed
@kikoruiz kikoruiz deleted the use-static-imports branch February 26, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants