Skip to content

Strict CSP & Production Guide ​

1. Strict Content Security Policy (CSP) ​

When style-src 'self' blocks runtime inline <style> injection, use either strategy below:

Import reddokia/style.css through your bundler (Vite, Webpack, Next.js, etc.) and disable runtime <style> tag injection:

tsx
import 'reddokia/style.css';
import { RedDokia } from 'reddokia/react';

<RedDokia
  views={views}
  layout={layout}
  injectStyles={false}
/>

Option B · CSP Nonce Propagation (styleNonce) ​

If your server issues a per-request CSP nonce, pass it via styleNonce:

tsx
<RedDokia
  views={views}
  layout={layout}
  styleNonce={window.__CSP_NONCE__}
/>

styleNonce propagates automatically to both the host document <head> and OS pop-out child windows (window.open).

2. Production Deployment Checklist ​

  • Keep-Alive Resource Lifecycle: Views are reparented without unmounting during split, float, and pop-out transitions. Allocate heavy resources (WebGPU devices, WebGL contexts, WebSocket streams) once on mount and dispose them on unmount.
  • Batched Resize Synchronization: onViewResize(events) fires at most once per frame and only when a visible view's pixel dimensions change.
  • Schema Versioning (storageKey): When shipping breaking changes to your default workspace layout, bump the key suffix (e.g. storageKey="my-workspace-v2") so users cleanly pick up the new layout.
  • Common Issues: For 0px host height, SSR hydration, or popup blocker recovery, see Troubleshooting & FAQ.