starbeamjs/starbeam

Full interop between multiple copies of Starbeam

Opened this issue · 0 comments

The purpose of @starbeam/shared is to make it possible to have multiple copies of Starbeam in a single process that don't trample each other. In other words, it's intended to allow duplicates copies of @starbeam/universal (etc.) to create their own cells and formulas, and correctly invalidate their formulas when a cell created by another duplicate of Starbeam is invalidated.

Currently, @starbeam/shared coordinates the global revision counter and the TAG symbol (previously called REACTIVE) using a shared global symbol. This means that multiple copies of Starbeam will be able to understand each others' revisions and validation rules.

It does not, however, help to coordinate the global frame stack. We need to fix that to make @starbeam/shared a complete solution. fixed in 9a6a6b9

It also does not coordinate lifetime management. This would make it possible to link an object from one copy of Starbeam to a parent from another copy.

  • Initialization Sentinel: UNINITIALIZED symbol
  • Tagged Protocol: TAG symbol
  • Unique ID: getID function
  • Timeline: now() and bump() functions
  • Autotracking: start() and consume() functions
  • Lifetime coordination (designing)