Skip to content

Commit e34b3df

Browse files
fix: expose additional signals api (#5402)
* fix: expose additional signals api * fix: bundle size
1 parent 42c47a0 commit e34b3df

File tree

10 files changed

+31
-2
lines changed

10 files changed

+31
-2
lines changed

packages/@lwc/engine-core/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ This experimental API enables the addition of a signal as a trusted signal. If t
122122

123123
If `setTrustedSignalSet` is called more than once, it will throw an error. If it is never called, then no trusted signal validation will be performed. The same `setTrustedSignalSet` API must be called on both `@lwc/engine-dom` and `@lwc/signals`.
124124

125+
### isTrustedSignal()
126+
127+
Not intended for external use. This experimental API enables the caller to determine if an object is a trusted signal. The [ENABLE_EXPERIMENTAL_SIGNALS](https://github.com/salesforce/lwc/blob/master/packages/%40lwc/features/README.md#lwcfeatures) feature must be enabled.
128+
125129
### setContextKeys
126130

127131
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.
@@ -136,3 +140,7 @@ If `setTrustedContextSet` is called more than once, it will throw an error. If i
136140

137141
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`,
138142
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.
143+
144+
### SignalBaseClass
145+
146+
Not intended for external use. Signals that extend SignalBaseClass will be added to set of trusted signals. The [ENABLE_EXPERIMENTAL_SIGNALS](https://github.com/salesforce/lwc/blob/master/packages/%40lwc/features/README.md#lwcfeatures) feature must be enabled.

packages/@lwc/engine-core/src/framework/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,8 @@ export {
7878
setTrustedSignalSet,
7979
setTrustedContextSet,
8080
addTrustedContext,
81+
isTrustedSignal,
8182
} from '@lwc/shared';
8283
export type { Stylesheet, Stylesheets } from '@lwc/shared';
84+
85+
export { SignalBaseClass } from '@lwc/signals';

packages/@lwc/engine-dom/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
"devDependencies": {
4949
"@lwc/engine-core": "8.20.0",
5050
"@lwc/shared": "8.20.0",
51-
"@lwc/features": "8.20.0"
51+
"@lwc/features": "8.20.0",
52+
"@lwc/signals": "8.20.0"
5253
},
5354
"lwc": {
5455
"modules": [

packages/@lwc/engine-dom/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export {
2828
setHooks,
2929
getComponentDef,
3030
isComponentConstructor,
31+
isTrustedSignal,
3132
parseFragment,
3233
parseSVGFragment,
3334
setContextKeys,
@@ -40,6 +41,7 @@ export {
4041
getComponentConstructor,
4142
__unstable__ProfilerControl,
4243
__unstable__ReportingControl,
44+
SignalBaseClass,
4345
} from '@lwc/engine-core';
4446

4547
// Engine-core public types ------------------------------------------------------------------------

packages/@lwc/engine-server/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"@lwc/rollup-plugin": "8.20.0",
5151
"@lwc/shared": "8.20.0",
5252
"@lwc/features": "8.20.0",
53+
"@lwc/signals": "8.20.0",
5354
"@rollup/plugin-virtual": "^3.0.2",
5455
"parse5": "^7.3.0"
5556
}

packages/@lwc/engine-server/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ export {
2727
setHooks,
2828
getComponentDef,
2929
isComponentConstructor,
30+
isTrustedSignal,
3031
parseFragment,
3132
parseFragment as parseSVGFragment,
3233
setTrustedContextSet,
3334
addTrustedContext as __dangerous_do_not_use_addTrustedContext,
3435
setContextKeys,
36+
SignalBaseClass,
3537
} from '@lwc/engine-core';
3638

3739
// Engine-server public APIs -----------------------------------------------------------------------

packages/@lwc/ssr-runtime/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"@lwc/shared": "8.20.0",
5252
"@lwc/engine-core": "8.20.0",
5353
"@lwc/features": "8.20.0",
54+
"@lwc/signals": "8.20.0",
5455
"observable-membrane": "2.0.0"
5556
}
5657
}

packages/@lwc/ssr-runtime/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ export {
1818
setTrustedSignalSet,
1919
setTrustedContextSet,
2020
addTrustedContext as __dangerous_do_not_use_addTrustedContext,
21+
isTrustedSignal,
2122
} from '@lwc/shared';
2223

24+
export { SignalBaseClass } from '@lwc/signals';
25+
2326
export { setFeatureFlag, setFeatureFlagForTest } from '@lwc/features';
2427

2528
export { ClassList } from './class-list';

packages/lwc/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ This experimental API enables the addition of a signal as a trusted signal. If t
8888

8989
If `setTrustedSignalSet` is called more than once, it will throw an error. If it is never called, then no trusted signal validation will be performed. The same `setTrustedSignalSet` API must be called on both `@lwc/engine-dom` and `@lwc/signals`.
9090

91+
### isTrustedSignal()
92+
93+
Not intended for external use. This experimental API enables the caller to determine if an object is a trusted signal. The [ENABLE_EXPERIMENTAL_SIGNALS](https://github.com/salesforce/lwc/blob/master/packages/%40lwc/features/README.md#lwcfeatures) feature must be enabled.
94+
9195
### setContextKeys
9296

9397
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.
@@ -102,3 +106,7 @@ If `setTrustedContextSet` is called more than once, it will throw an error. If i
102106

103107
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`,
104108
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.
109+
110+
### SignalBaseClass
111+
112+
Not intended for external use. Signals that extend SignalBaseClass will be added to set of trusted signals. The [ENABLE_EXPERIMENTAL_SIGNALS](https://github.com/salesforce/lwc/blob/master/packages/%40lwc/features/README.md#lwcfeatures) feature must be enabled.

scripts/bundlesize/bundlesize.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"files": [
33
{
44
"path": "packages/@lwc/engine-dom/dist/index.js",
5-
"maxSize": "24.62KB"
5+
"maxSize": "24.68KB"
66
},
77
{
88
"path": "packages/@lwc/synthetic-shadow/dist/index.js",

0 commit comments

Comments
 (0)