Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/@lwc/engine-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ If `setTrustedSignalSet` is called more than once, it will throw an error. If it

### setContextKeys

Not intended for external use. Enables another library to establish contextful relationships via the LWC component tree. The `connectContext` and `disconnectContext` symbols that are provided are later used to identify methods that facilitate the establishment and dissolution of these contextful relationships.
Not intended for external use. Enables another library to establish contextful relationships via the LWC component tree. The `connectContext` and `disconnectContext` symbols that are provided are later used to identify methods that facilitate the establishment and dissolution of these contextful relationships. The [ENABLE_EXPERIMENTAL_SIGNALS](https://github.com/salesforce/lwc/blob/master/packages/%40lwc/features/README.md#lwcfeatures) feature must be enabled.

### setTrustedContextSet()

Not intended for external use. This experimental API enables the addition of context as trusted context. If the [ENABLE_EXPERIMENTAL_SIGNALS](https://github.com/salesforce/lwc/blob/master/packages/%40lwc/features/README.md#lwcfeatures) feature is enabled.
Not intended for external use. This experimental API enables the addition of context as trusted context. The [ENABLE_EXPERIMENTAL_SIGNALS](https://github.com/salesforce/lwc/blob/master/packages/%40lwc/features/README.md#lwcfeatures) feature must be enabled.

If `setTrustedContextSet` is called more than once, it will throw an error. If it is never called, then context will not be connected.

### ContextBinding

The context object's `connectContext` and `disconnectContext` methods are called with this object when contextful components are connected and disconnected. The ContextBinding exposes `provideContext` and `consumeContext`,
enabling the provision/consumption of a contextful Signal of a specified variety for the associated component.
enabling the provision/consumption of a contextful Signal of a specified variety for the associated component. The [ENABLE_EXPERIMENTAL_SIGNALS](https://github.com/salesforce/lwc/blob/master/packages/%40lwc/features/README.md#lwcfeatures) feature must be enabled.
7 changes: 6 additions & 1 deletion packages/@lwc/engine-core/src/framework/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,10 @@ export { default as wire } from './decorators/wire';
export { readonly } from './readonly';

export { setFeatureFlag, setFeatureFlagForTest } from '@lwc/features';
export { setContextKeys, setTrustedSignalSet, setTrustedContextSet } from '@lwc/shared';
export {
setContextKeys,
setTrustedSignalSet,
setTrustedContextSet,
addTrustedContext,
} from '@lwc/shared';
export type { Stylesheet, Stylesheets } from '@lwc/shared';
1 change: 1 addition & 0 deletions packages/@lwc/engine-dom/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export {
setContextKeys,
setTrustedSignalSet,
setTrustedContextSet,
addTrustedContext as __dangerous_do_not_use_addTrustedContext,
swapComponent,
swapStyle,
swapTemplate,
Expand Down
1 change: 1 addition & 0 deletions packages/@lwc/engine-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export {
parseFragment,
parseFragment as parseSVGFragment,
setTrustedContextSet,
addTrustedContext as __dangerous_do_not_use_addTrustedContext,
setContextKeys,
} from '@lwc/engine-core';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { setContextKeys, setTrustedContextSet } from 'lwc';
import {
setContextKeys,
setTrustedContextSet,
__dangerous_do_not_use_addTrustedContext,
} from 'lwc';

const connectContext = Symbol('connectContext');
const disconnectContext = Symbol('disconnectContext');
Expand All @@ -16,7 +20,7 @@ class MockContextSignal {
this.value = initialValue;
this.contextDefinition = contextDefinition;
this.fromContext = fromContext;
trustedContext.add(this);
__dangerous_do_not_use_addTrustedContext(this);
}
[connectContext](runtimeAdapter) {
this.connectProvidedComponent = runtimeAdapter.component;
Expand Down
1 change: 1 addition & 0 deletions packages/@lwc/ssr-runtime/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export {
setContextKeys,
setTrustedSignalSet,
setTrustedContextSet,
addTrustedContext as __dangerous_do_not_use_addTrustedContext,
} from '@lwc/shared';

export { setFeatureFlag, setFeatureFlagForTest } from '@lwc/features';
Expand Down
6 changes: 3 additions & 3 deletions packages/lwc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ If `setTrustedSignalSet` is called more than once, it will throw an error. If it

### setContextKeys

Not intended for external use. Enables another library to establish contextful relationships via the LWC component tree. The `connectContext` and `disconnectContext` symbols that are provided are later used to identify methods that facilitate the establishment and dissolution of these contextful relationships.
Not intended for external use. Enables another library to establish contextful relationships via the LWC component tree. The `connectContext` and `disconnectContext` symbols that are provided are later used to identify methods that facilitate the establishment and dissolution of these contextful relationships. The [ENABLE_EXPERIMENTAL_SIGNALS](https://github.com/salesforce/lwc/blob/master/packages/%40lwc/features/README.md#lwcfeatures) feature must be enabled.

### setTrustedContextSet()

Not intended for external use. This experimental API enables the addition of context as trusted context. If the [ENABLE_EXPERIMENTAL_SIGNALS](https://github.com/salesforce/lwc/blob/master/packages/%40lwc/features/README.md#lwcfeatures) feature is enabled.
Not intended for external use. This experimental API enables the addition of context as trusted context. The [ENABLE_EXPERIMENTAL_SIGNALS](https://github.com/salesforce/lwc/blob/master/packages/%40lwc/features/README.md#lwcfeatures) feature must be enabled.

If `setTrustedContextSet` is called more than once, it will throw an error. If it is never called, then context will not be connected.

### ContextBinding

The context object's `connectContext` and `disconnectContext` methods are called with this object when contextful components are connected and disconnected. The ContextBinding exposes `provideContext` and `consumeContext`,
enabling the provision/consumption of a contextful Signal of a specified variety for the associated component.
enabling the provision/consumption of a contextful Signal of a specified variety for the associated component. The [ENABLE_EXPERIMENTAL_SIGNALS](https://github.com/salesforce/lwc/blob/master/packages/%40lwc/features/README.md#lwcfeatures) feature must be enabled.
Loading