@lwc/signals 9.0.2 → 9.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Copyright (c) 2026 Salesforce, Inc.
3
+ */
4
+ 'use strict';
5
+
6
+ Object.defineProperty(exports, '__esModule', { value: true });
7
+
8
+ /**
9
+ * Copyright (c) 2026 Salesforce, Inc.
10
+ */
11
+ /*
12
+ * Copyright (c) 2018, salesforce.com, inc.
13
+ * All rights reserved.
14
+ * SPDX-License-Identifier: MIT
15
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
16
+ */
17
+ /**
18
+ *
19
+ * @param value
20
+ * @param msg
21
+ */
22
+ /**
23
+ *
24
+ * @param value
25
+ * @param msg
26
+ */
27
+ function isFalse$1(value, msg) {
28
+ if (value) {
29
+ throw new Error(`Assert Violation: ${msg}`);
30
+ }
31
+ }
32
+
33
+ /*
34
+ * Copyright (c) 2024, salesforce.com, inc.
35
+ * All rights reserved.
36
+ * SPDX-License-Identifier: MIT
37
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
38
+ */
39
+ let trustedSignals;
40
+ function setTrustedSignalSet(signals) {
41
+ isFalse$1(trustedSignals, 'Trusted Signal Set is already set!');
42
+ trustedSignals = signals;
43
+ // Only used in LWC's integration tests. Contained within the set function as there are multiple imports of
44
+ // this module. Placing it here ensures we reference the import where the trustedSignals set is maintained
45
+ if (process.env.NODE_ENV === 'test-lwc-integration') {
46
+ // Used to reset the global state between test runs
47
+ globalThis.__lwcResetTrustedSignals = () => (trustedSignals = undefined);
48
+ }
49
+ }
50
+ function addTrustedSignal(signal) {
51
+ // This should be a no-op when the trustedSignals set isn't set by runtime
52
+ trustedSignals?.add(signal);
53
+ }
54
+ /** version: 9.0.3 */
55
+
56
+ /*
57
+ * Copyright (c) 2023, salesforce.com, inc.
58
+ * All rights reserved.
59
+ * SPDX-License-Identifier: MIT
60
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
61
+ */
62
+ class SignalBaseClass {
63
+ constructor() {
64
+ this.subscribers = new Set();
65
+ // Add the signal to the set of trusted signals
66
+ // that rendering engine can track
67
+ addTrustedSignal(this);
68
+ }
69
+ subscribe(onUpdate) {
70
+ this.subscribers.add(onUpdate);
71
+ return () => {
72
+ this.subscribers.delete(onUpdate);
73
+ };
74
+ }
75
+ notify() {
76
+ for (const subscriber of this.subscribers) {
77
+ subscriber();
78
+ }
79
+ }
80
+ }
81
+
82
+ exports.SignalBaseClass = SignalBaseClass;
83
+ exports.setTrustedSignalSet = setTrustedSignalSet;
84
+ /** version: 9.0.3 */
85
+ //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -47,7 +47,7 @@ function addTrustedSignal(signal) {
47
47
  // This should be a no-op when the trustedSignals set isn't set by runtime
48
48
  trustedSignals?.add(signal);
49
49
  }
50
- /** version: 9.0.2 */
50
+ /** version: 9.0.3 */
51
51
 
52
52
  /*
53
53
  * Copyright (c) 2023, salesforce.com, inc.
@@ -76,5 +76,5 @@ class SignalBaseClass {
76
76
  }
77
77
 
78
78
  export { SignalBaseClass, setTrustedSignalSet };
79
- /** version: 9.0.2 */
79
+ /** version: 9.0.3 */
80
80
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
5
5
  ],
6
6
  "name": "@lwc/signals",
7
- "version": "9.0.2",
7
+ "version": "9.0.3",
8
8
  "description": "Provides the interface to interact with reactivity from outside the framework",
9
9
  "keywords": [
10
10
  "lwc"
@@ -34,6 +34,7 @@
34
34
  "types": "dist/index.d.ts",
35
35
  "files": [
36
36
  "dist/**/*.js",
37
+ "dist/**/*.cjs",
37
38
  "dist/**/*.d.ts"
38
39
  ],
39
40
  "scripts": {
@@ -50,6 +51,6 @@
50
51
  }
51
52
  },
52
53
  "devDependencies": {
53
- "@lwc/shared": "9.0.2"
54
+ "@lwc/shared": "9.0.3"
54
55
  }
55
56
  }