TheOpenPresenter
  • Introduction
    • Welcome
    • Motivation & Challenges
    • System Architecture
    • Terminologies
    • Server Communication
    • Project Topology
  • Development
    • Quickstart
    • Static files
    • Media Storage
  • Plugins
    • Introduction
    • Official Plugins
      • Google Slides
      • Lyrics Presenter
        • Lyrics compatibility
      • Video Player
      • Audio Recorder
    • Developing a Plugin
      • Plugin API
        • Yjs
          • Awareness
          • Scene
          • Renderer
        • Backend
          • Yjs Handler
          • Loading Frontend
          • Security
        • Frontend
          • Remote
          • Renderer
        • Media
          • Server Plugin API
          • Frontend
            • Tus
            • Form Data
        • TRPC
        • Database
      • Audio
      • Viewer State
      • Notifying Errors
      • Caveats
        • Sharing dependencies
        • Cross-over between plugins
      • Performance
  • API Reference
    • Plugin Context
  • Guide
    • Playing Audio
    • Listen to scene changes
  • Scratch Pad
    • Ambition
    • Background music
  • Environment Variables
  • External
    • Page 1
Powered by GitBook
On this page
  1. Plugins
  2. Developing a Plugin
  3. Caveats

Sharing dependencies

PreviousCaveatsNextCross-over between plugins

Last updated 8 months ago

Some dependencies are shared among all frontend components. We do this for 2 main reasons:

  1. So that the client doesn't have to load the dependencies multiple times

  2. Some library requires that only one copy of itself is used. Eg: Yjs

We achieve this using importmap, provided by our Remote and Renderer wrapper.

This means that for frontend plugin bundles, you should exclude these dependencies from the bundle. Instead, it should import the dependency directly using a bare specifier.

You can look at the build config of any of the plugins in the main repository. They serve as an example of how the build pipeline should be setup.

Shared dependencies

At the moment of writing, here are the list of shared dependencies:

  • yjs

  • react (react, react-dom, react-dom/client)

To see an up-to-date list, refer to the importmap definition in the main repo:

TheOpenPresenter/apps/remote/index.html at main · Vija02/TheOpenPresenterGitHub
Logo