Socket
Socket
Sign inDemoInstall

@starbeam/interfaces

Package Overview
Dependencies
Maintainers
3
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@starbeam/interfaces - npm Package Compare versions

Comparing version 0.8.10-unstable.c41f68b to 0.8.10-unstable.d342d90

LICENSE.md

16

.eslintrc.json
{
"root": true,
"ignorePatterns": ["node_modules", "dist", "html", "tests"],
"plugins": ["@starbeam"],
"overrides": [
{
"extends": ["plugin:@starbeam/tight"],
"files": ["index.ts", "src/**/*.ts"],
"parserOptions": {
"project": "tsconfig.json"
}
},
{
"extends": ["plugin:@starbeam/json:recommended"],
"files": ["*.json"]
}
]
"extends": ["plugin:@starbeam-dev/library:recommended"]
}
{
"name": "@starbeam/interfaces",
"version": "0.8.10-unstable.c41f68b",
"type": "module",
"main": "index.ts",
"types": "index.ts",
"version": "0.8.10-unstable.d342d90",
"main": "dist/index.cjs",
"types": "dist/index.d.ts",
"exports": {
"default": "./index.ts"
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.cjs"
},
"publishConfig": {
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.cjs"
}
},
"main": "dist/index.cjs",
"types": "dist/index.d.ts"
},
"starbeam": {

@@ -26,14 +17,14 @@ "source": "ts",

},
"dependencies": {
"@starbeam/shared": "1.3.8-unstable.d342d90",
"@domtree/any": "^0.9.3"
},
"devDependencies": {
"@starbeam-dev/compile": "^1.1.0",
"@starbeam-dev/eslint-plugin": "^1.0.4"
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:types": "tsc -b"
},
"dependencies": {
"@domtree/any": "0.9.4-unstable.c41f68b",
"@starbeam/shared": "1.3.8-unstable.c41f68b"
},
"devDependencies": {
"@starbeam/eslint-plugin": "workspace:^",
"@starbeam-dev/build-support": "workspace:^"
}
}
}

@@ -18,4 +18,5 @@ import type { TAG } from "@starbeam/shared";

/**
* Cell is the fundamental mutable reactive value. All subscriptions in Starbeam are ultimately
* subscriptions to cells, and all mutations in Starbeam are ultimately mutations to cells.
* Cell is the fundamental mutable reactive value. All subscriptions in
* Starbeam are ultimately subscriptions to cells, and all mutations in
* Starbeam are ultimately mutations to cells.
*/

@@ -32,12 +33,15 @@ export interface CellTag extends TagMethods {

/**
* Formula is a reactive that has *dynamic* children. This means that you can't cache the children
* (or subscribe directly to them), because they may change. This is different from delegates, which
* are guaranteed to have the same set of children forever.
* Formula is a reactive that has *dynamic* children. This means that you can't
* cache the children (or subscribe directly to them), because they may change.
* This is different from delegates, which are guaranteed to have the same set
* of children forever.
*
* Composite reactives must notify the timeline when their children have changed.
* Composite reactives must notify the timeline when their children have
* changed.
*
* A subscription to a composite reactive is a subscription to its current children, as of the last
* time the timeline was notified of changes to the composite's children. Whenever the timeline is
* notified of a change to the composite's children, it removes subscriptions from any stale
* dependencies and adds subscriptions to any new dependencies.
* A subscription to a composite reactive is a subscription to its current
* children, as of the last time the timeline was notified of changes to the
* composite's children. Whenever the timeline is notified of a change to the
* composite's children, it removes subscriptions from any stale dependencies
* and adds subscriptions to any new dependencies.
*/

@@ -74,9 +78,11 @@ export interface FormulaTag extends TagMethods {

/**
* Delegate is a reactive that represents one or more reactives, but that set of reactives cannot
* change. This allows you to cache the value of the `delegate` property, and it also allows you to
* subscribe directly to the delegate's targets.
* Delegate is a reactive that represents one or more reactives, but that set
* of reactives cannot change. This allows you to cache the value of the
* `delegate` property, and it also allows you to subscribe directly to the
* delegate's targets.
*
* In practice, when you subscribe to a delegate, the timeline subscribes directly to the delegate's
* targets. This means that delegates don't need to know when their value changes, and don't need to
* notify the timeline when their targets change.
* In practice, when you subscribe to a delegate, the timeline subscribes
* directly to the delegate's targets. This means that delegates don't need to
* know when their value changes, and don't need to notify the timeline when
* their targets change.
*/

@@ -90,12 +96,14 @@ export interface DelegateTag extends TagMethods {

/**
* Static is a reactive that is guaranteed not to change. This means that you can cache the value of
* the static reactive and don't need to include it in composite children. All validation semantics
* act as if static reactives were not present.
* Static is a reactive that is guaranteed not to change. This means that you
* can cache the value of the static reactive and don't need to include it in
* composite children. All validation semantics act as if static reactives were
* not present.
*
* If a formula or delegate has only static children, it is also static. Even though a formula's
* children can change, if the formula's *only* children are static, then the formula can never
* invalidate, and therefore it, itself, is treated as static.
* If a formula or delegate has only static children, it is also static. Even
* though a formula's children can change, if the formula's *only* children are
* static, then the formula can never invalidate, and therefore it, itself, is
* treated as static.
*
* TODO: Do we need a separate fundamental type for pollable formulas, which can get new
* dependencies even if they never invalidate?
* TODO: Do we need a separate fundamental type for pollable formulas, which
* can get new dependencies even if they never invalidate?
*/

@@ -108,9 +116,11 @@ export interface StaticTag extends TagMethods {

/**
* A tag validates a reactive value. The behavior of a tags is defined in relation to reads and
* writes of the reactive value they represent. Tags model **value composition** (and functional
* composition), not a more general algebra.
* A tag validates a reactive value. The behavior of a tags is defined in
* relation to reads and writes of the reactive value they represent. Tags
* model **value composition** (and functional composition), not a more general
* algebra.
*
* In other words, it doesn't make sense to think about the composition of tags abstracted from the
* values they represent. Attempting to think about tags this way makes them seem more general than
* they are, and that generality breaks system invariants derived from value composition.
* In other words, it doesn't make sense to think about the composition of tags
* abstracted from the values they represent. Attempting to think about tags
* this way makes them seem more general than they are, and that generality
* breaks system invariants derived from value composition.
*/

@@ -122,5 +132,6 @@ export type Tag = CellTag | FormulaTag | DelegateTag | StaticTag;

*
* A subscription to a formula is a dynamic subscription to its current dependencies.
* A subscription to a delegate is equivalent to subscribing to its (stable) targets.
* A subscription to a static is equivalent to subscribing to nothing.
* A subscription to a formula is a dynamic subscription to its current
* dependencies. A subscription to a delegate is equivalent to subscribing to
* its (stable) targets. A subscription to a static is equivalent to
* subscribing to nothing.
*/

@@ -127,0 +138,0 @@ export type SubscriptionTarget = CellTag | FormulaTag;

@@ -1,3 +0,1 @@

import type { UNINITIALIZED } from "@starbeam/shared";
import type { Description } from "./debug/description.js";

@@ -29,15 +27,18 @@ import type { Timestamp } from "./timestamp.js";

/**
* Formula is a reactive that has *dynamic* children. This means that you can't cache the children
* (or subscribe directly to them), because they may change. This is different from delegates, which
* are guaranteed to have the same set of children forever.
* Formula is a reactive that has *dynamic* children. This means that you can't
* cache the children (or subscribe directly to them), because they may change.
* This is different from delegates, which are guaranteed to have the same set
* of children forever.
*
* Composite reactives must notify the timeline when their children have changed.
* Composite reactives must notify the timeline when their children have
* changed.
*
* A subscription to a composite reactive is a subscription to its current children, as of the last
* time the timeline was notified of changes to the composite's children. Whenever the timeline is
* notified of a change to the composite's children, it removes subscriptions from any stale
* dependencies and adds subscriptions to any new dependencies.
* A subscription to a composite reactive is a subscription to its current
* children, as of the last time the timeline was notified of changes to the
* composite's children. Whenever the timeline is notified of a change to the
* composite's children, it removes subscriptions from any stale dependencies
* and adds subscriptions to any new dependencies.
*
* TODO: Do we need a separate fundamental type for non-cached formulas, which can get new
* dependencies even if they never invalidate?
* TODO: Do we need a separate fundamental type for non-cached formulas, which
* can get new dependencies even if they never invalidate?
*/

@@ -47,14 +48,16 @@ export interface FormulaTag {

readonly description?: Description | undefined;
readonly dependencies: UNINITIALIZED | (() => readonly CellTag[]);
readonly dependencies: undefined | (() => readonly CellTag[]);
}
/**
* A tag validates a reactive value. The behavior of a tags is defined in relation to reads and
* writes of the reactive value they represent. Tags model **value composition** (and functional
* composition), not a more general algebra.
* A tag validates a reactive value. The behavior of a tags is defined in
* relation to reads and writes of the reactive value they represent. Tags
* model **value composition** (and functional composition), not a more general
* algebra.
*
* In other words, it doesn't make sense to think about the composition of tags abstracted from the
* values they represent. Attempting to think about tags this way makes them seem more general than
* they are, and that generality breaks system invariants derived from value composition.
* In other words, it doesn't make sense to think about the composition of tags
* abstracted from the values they represent. Attempting to think about tags
* this way makes them seem more general than they are, and that generality
* breaks system invariants derived from value composition.
*/
export type Tag = CellTag | FormulaTag;

@@ -26,5 +26,5 @@ import type { TAG } from "@starbeam/shared";

/**
* A `TaggedReactive` object is a reactive object that has a `Tag` (which is used
* to validate it) and a `read` function that can be used to read the current
* value of the object.
* A `TaggedReactive` object is a reactive object that has a `Tag` (which is
* used to validate it) and a `read` function that can be used to read the
* current value of the object.
*/

@@ -31,0 +31,0 @@ export interface TaggedReactive<out T = unknown, I extends Tag = Tag>

@@ -5,10 +5,10 @@ {

"composite": true,
"types": ["../../env.d.ts"],
"declaration": true,
"declarationDir": "../../../dist/types",
"declarationMap": true,
"outDir": "../../../dist/packages",
"types": ["../../env"]
"emitDeclarationOnly": true
},
"exclude": ["dist/**/*"],
"include": ["index.ts", "./src/**/*.ts", "./src/**/*.d.ts"]
"include": ["index.ts", "./src/**/*.ts", "./src/**/*.d.ts"],
"exclude": ["dist/**/*"]
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc