Skip to content

[v2] Extract WebGL into @satus/webgl #24

Description

@arzafran

Moved from darkroomengineering#97

Problem

27 files + 5 production dependencies (~17% of the codebase) for a feature most projects won't use. Even though it's lazy-loaded, it's still:

  • In node_modules (inflating install time with Three.js + R3F + postprocessing)
  • In the mental model (developers see webgl/, GlobalCanvas, FlowMap, Fluid, PostProcessing)
  • Leaking dev tools into production (Theatre.js imported unconditionally in fluid/flowmap components)

Proposal

Extract lib/webgl/ into @satus/webgl package. The OptionalFeatures / Wrapper component already handles lazy loading — just needs a package boundary.

Also Fix: Theatre.js Production Leak

Theatre.js imports in fluid/index.tsx and flowmaps/index.tsx need to be gated behind process.env.NODE_ENV === 'development' or extracted into a dev-only hook.

Tasks

  • Fix Theatre.js unconditional imports (can be done independently)
  • Extract lib/webgl/ into @satus/webgl package
  • Extract components/effects/animated-gradient/ (depends on WebGL)
  • Update Wrapper component to optionally support webgl prop
  • Remove 5 production dependencies from base package.json
  • Document @satus/webgl setup and usage

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions