🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@posthog/browser-common

Package Overview
Dependencies
Maintainers
22
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@posthog/browser-common - npm Package Compare versions

Comparing version
0.2.0
to
0.2.1
+1
-1
dist/config.js

@@ -29,3 +29,3 @@ "use strict";

});
const packageVersion = "0.2.0";
const packageVersion = "0.2.1";
const Config = {

@@ -32,0 +32,0 @@ DEBUG: false,

@@ -1,2 +0,2 @@

const packageVersion = "0.2.0";
const packageVersion = "0.2.1";
const Config = {

@@ -3,0 +3,0 @@ DEBUG: false,

@@ -0,4 +1,6 @@

/** Phantom brand carrying the capability type without emitting runtime code. */
declare const extensionTokenType: unique symbol;
/**
* A typed, implementation-free key for resolving an extension that provides a
* capability. Declared as a shared `const` next to the providing extension's
* A typed, implementation-free string for resolving an extension that provides
* a capability. Declared as a shared `const` next to the providing extension's
* interface:

@@ -8,15 +10,14 @@ *

* export interface FeatureFlagsExtension extends Extension { … }
* export const FeatureFlags: ExtensionToken<FeatureFlagsExtension> = { name: 'featureFlags' }
* export const FeatureFlags = 'posthog.featureFlags' as ExtensionToken<FeatureFlagsExtension>
* ```
*
* A token holds no implementation, so importing one never pulls the provider's
* code into the consumer's bundle. The registry is keyed by token identity
* (the shared object reference), so provider and consumer must import the same
* exported token; `name` is for diagnostics only.
* code into the consumer's bundle. Its generic brand lets `getExtension` infer
* the provided type, while its runtime string value remains stable across
* independently compiled scripts. Token strings must be globally unique and
* stable for the lifetime of the capability contract.
*/
export interface ExtensionToken<T> {
/** Human-readable capability name used only for diagnostics. */
readonly name: string;
/** Phantom: carries the provided type for inference; never present at runtime. */
readonly __provides?: T;
}
export type ExtensionToken<T> = string & {
readonly [extensionTokenType]: T;
};
export {};
{
"name": "@posthog/browser-common",
"version": "0.2.0",
"version": "0.2.1",
"description": "Internal shared browser utilities and extension primitives for PostHog Browser SDKs",

@@ -60,4 +60,4 @@ "license": "MIT",

"dependencies": {
"@posthog/core": "^1.44.0",
"@posthog/types": "^1.397.1"
"@posthog/types": "^1.398.0",
"@posthog/core": "^1.45.1"
},

@@ -64,0 +64,0 @@ "devDependencies": {

@@ -99,6 +99,8 @@ # @posthog/browser-common

A token is implementation-free, so importing it never pulls the provider's code
into your bundle — each extension stays independently tree-shakable and lazily
loadable. An extension that provides a capability declares its token(s) in
`provides`.
A token is an implementation-free branded string, so importing it never pulls
the provider's code into your bundle — each extension stays independently
tree-shakable and lazily loadable. Use a package-qualified runtime string, such
as `posthog.featureFlags`, that is globally unique and stable so separately
compiled scripts resolve the same capability. An extension that provides a
capability declares its token(s) in `provides`.

@@ -105,0 +107,0 @@ ## Utilities