Skip to content

Commit 76172e1

Browse files
authored
Merge branch 'master' into jhefferman/fix-cte-integration-tests
2 parents 9805b58 + 40c8857 commit 76172e1

File tree

166 files changed

+1756
-1048
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+1756
-1048
lines changed

.github/workflows/karma.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ jobs:
5858
- run: LEGACY_BROWSERS=1 yarn sauce:ci
5959
- run: FORCE_NATIVE_SHADOW_MODE_FOR_TEST=1 yarn sauce:ci
6060
- run: DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 yarn sauce:ci
61+
- run: DISABLE_DETACHED_REHYDRATION=1 yarn sauce:ci
6162
- run: DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 DISABLE_SYNTHETIC=1 yarn sauce:ci
63+
- run: DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 DISABLE_DETACHED_REHYDRATION=1 yarn sauce:ci
6264

6365
- name: Upload coverage results
6466
uses: actions/upload-artifact@v4
@@ -187,6 +189,8 @@ jobs:
187189
- run: NODE_ENV_FOR_TEST=production yarn hydration:sauce:ci:engine-server
188190
- run: DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 yarn hydration:sauce:ci:engine-server
189191
- run: DISABLE_STATIC_CONTENT_OPTIMIZATION=1 yarn hydration:sauce:ci:engine-server
192+
- run: DISABLE_DETACHED_REHYDRATION=1 yarn hydration:sauce:ci:engine-server
193+
- run: DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 DISABLE_DETACHED_REHYDRATION=1 yarn hydration:sauce:ci:engine-server
190194
- run: yarn hydration:sauce:ci
191195
- run: ENABLE_SYNTHETIC_SHADOW_IN_HYDRATION=1 yarn hydration:sauce:ci
192196
- run: NODE_ENV_FOR_TEST=production yarn hydration:sauce:ci

.nucleus.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
core-deploy:
2+
enabled: true
3+
project-modules:
4+
lwc: lwc.version
5+
branches:
6+
~DEFAULT~:
7+
pull-request: &branch-definition
8+
workflow: build-and-test
9+
auto-start: true
10+
auto-start-from-forks: false
11+
merge-method: disabled # do not auto-merge; we'll do it ourselves
12+
required-downstream-deps:
13+
- BuilderFramework/builder-framework-salesforce
14+
- MobilePlatform/lsdk-modules
15+
- MobilePlatform/lwr-lightning-platform
16+
- MobilePlatform/ui-fsm-components
17+
- automation-platform/ui-externalservices-builder-components
18+
- communities/microsite-template-marketing
19+
- communities/shared-experience-components
20+
- communities/ui-commerce-components
21+
- communities/webruntime
22+
- lds/lds-plugins
23+
- salesforce-experience-platform-emu/komaci
24+
- salesforce-experience-platform-emu/locker-pentest-app
25+
- salesforce-experience-platform-emu/lwr
26+
- salesforce-experience-platform-emu/lwr-everywhere
27+
- salesforce-experience-platform-emu/lwr-recipes
28+
- salesforce/lwc-test
29+
# Using old major versions; tests in PRs will always fail
30+
# - salesforce/o11y-sample-app
31+
# - Skilling-and-Enablement/ui-external-enablement
32+
release:
33+
pull-request:
34+
<<: *branch-definition
35+
# Only active branches need to be included in this config
36+
winter26:
37+
pull-request:
38+
<<: *branch-definition
39+
spring25:
40+
pull-request:
41+
<<: *branch-definition
42+
summer25:
43+
pull-request:
44+
<<: *branch-definition
45+
jobs:
46+
build-and-test:
47+
memory-limit: 16
48+
create-canary-release:
49+
memory-limit: 16
50+
build-dependency:
51+
memory-limit: 16
52+
release:
53+
memory-limit: 16
54+
steps:
55+
node-conformance:
56+
run:
57+
command: yarn run lint
58+
after: node-build
59+
node-unit-tests:
60+
run:
61+
command: yarn test
62+
# this project runs yarn build after yarn install so skip explicit build step
63+
node-build: &node-build
64+
skip: true

eslint.config.mjs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -361,16 +361,9 @@ export default tseslint.config(
361361
globals: {
362362
lwcRuntimeFlags: true,
363363
process: true,
364-
TestUtils: true,
365364
...globals.browser,
366-
...globals.jasmine,
367365
},
368366
},
369-
370-
rules: {
371-
'no-var': 'off',
372-
'prefer-rest-params': 'off',
373-
},
374367
},
375368
{
376369
files: ['packages/@lwc/integration-karma/**'],
@@ -385,11 +378,6 @@ export default tseslint.config(
385378
...globals.jasmine,
386379
},
387380
},
388-
389-
rules: {
390-
'no-var': 'off',
391-
'prefer-rest-params': 'off',
392-
},
393381
},
394382
{
395383
files: ['packages/@lwc/synthetic-shadow/**'],

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lwc-monorepo",
3-
"version": "8.22.1",
3+
"version": "8.22.3",
44
"private": true,
55
"description": "Lightning Web Components",
66
"repository": {
@@ -38,10 +38,10 @@
3838
},
3939
"devDependencies": {
4040
"@commitlint/cli": "^19.8.1",
41-
"@eslint/js": "9.35.0",
41+
"@eslint/js": "9.36.0",
4242
"@lwc/eslint-plugin-lwc-internal": "link:./scripts/eslint-plugin",
4343
"@lwc/test-utils-lwc-internals": "link:./scripts/test-utils",
44-
"@nx/js": "21.4.1",
44+
"@nx/js": "21.5.3",
4545
"@rollup/plugin-commonjs": "^28.0.6",
4646
"@rollup/plugin-inject": "^5.0.5",
4747
"@rollup/plugin-node-resolve": "^16.0.1",
@@ -51,30 +51,30 @@
5151
"@swc/core": "~1.13.5",
5252
"@swc/helpers": "~0.5.17",
5353
"@types/babel__core": "^7.20.5",
54-
"@types/node": "^22.18.1",
54+
"@types/node": "^22.18.4",
5555
"@vitest/coverage-v8": "^3.2.4",
56-
"@vitest/eslint-plugin": "^1.3.9",
56+
"@vitest/eslint-plugin": "^1.3.12",
5757
"@vitest/ui": "^3.2.4",
5858
"bytes": "^3.1.2",
5959
"es-module-lexer": "^1.7.0",
60-
"eslint": "9.35.0",
60+
"eslint": "9.36.0",
6161
"eslint-config-flat-gitignore": "^2.1.0",
6262
"eslint-plugin-header": "^3.1.1",
6363
"eslint-plugin-import": "^2.32.0",
6464
"glob": "^11.0.3",
65-
"globals": "^16.3.0",
65+
"globals": "^16.4.0",
6666
"husky": "^9.1.7",
6767
"isbinaryfile": "^5.0.6",
6868
"jsdom": "^26.1.0",
69-
"lint-staged": "^16.1.6",
69+
"lint-staged": "^16.2.0",
7070
"magic-string": "^0.30.19",
71-
"nx": "21.4.1",
71+
"nx": "21.5.3",
7272
"prettier": "^3.6.2",
73-
"rollup": "^4.50.1",
73+
"rollup": "^4.52.0",
7474
"terser": "^5.44.0",
7575
"tslib": "^2.8.1",
7676
"typescript": "5.8.2",
77-
"typescript-eslint": "8.42.0",
77+
"typescript-eslint": "8.44.0",
7878
"vitest": "^3.2.4"
7979
},
8080
"lint-staged": {

packages/@lwc/aria-reflection/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
55
],
66
"name": "@lwc/aria-reflection",
7-
"version": "8.22.1",
7+
"version": "8.22.3",
88
"description": "ARIA element reflection polyfill for strings",
99
"keywords": [
1010
"aom",

packages/@lwc/babel-plugin-component/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
55
],
66
"name": "@lwc/babel-plugin-component",
7-
"version": "8.22.1",
7+
"version": "8.22.3",
88
"description": "Babel plugin to transform a LWC module",
99
"keywords": [
1010
"lwc"
@@ -47,8 +47,8 @@
4747
},
4848
"dependencies": {
4949
"@babel/helper-module-imports": "7.27.1",
50-
"@lwc/errors": "8.22.1",
51-
"@lwc/shared": "8.22.1",
50+
"@lwc/errors": "8.22.3",
51+
"@lwc/shared": "8.22.3",
5252
"line-column": "~1.0.2"
5353
},
5454
"devDependencies": {

packages/@lwc/compiler/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
55
],
66
"name": "@lwc/compiler",
7-
"version": "8.22.1",
7+
"version": "8.22.3",
88
"description": "LWC compiler",
99
"keywords": [
1010
"lwc"
@@ -52,11 +52,11 @@
5252
"@babel/plugin-transform-class-properties": "7.27.1",
5353
"@babel/plugin-transform-object-rest-spread": "7.28.4",
5454
"@locker/babel-plugin-transform-unforgeables": "0.22.0",
55-
"@lwc/babel-plugin-component": "8.22.1",
56-
"@lwc/errors": "8.22.1",
57-
"@lwc/shared": "8.22.1",
58-
"@lwc/ssr-compiler": "8.22.1",
59-
"@lwc/style-compiler": "8.22.1",
60-
"@lwc/template-compiler": "8.22.1"
55+
"@lwc/babel-plugin-component": "8.22.3",
56+
"@lwc/errors": "8.22.3",
57+
"@lwc/shared": "8.22.3",
58+
"@lwc/ssr-compiler": "8.22.3",
59+
"@lwc/style-compiler": "8.22.3",
60+
"@lwc/template-compiler": "8.22.3"
6161
}
6262
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
55
],
66
"name": "@lwc/engine-core",
7-
"version": "8.22.1",
7+
"version": "8.22.3",
88
"description": "Core LWC engine APIs.",
99
"keywords": [
1010
"lwc"
@@ -46,9 +46,9 @@
4646
}
4747
},
4848
"dependencies": {
49-
"@lwc/features": "8.22.1",
50-
"@lwc/shared": "8.22.1",
51-
"@lwc/signals": "8.22.1"
49+
"@lwc/features": "8.22.3",
50+
"@lwc/shared": "8.22.3",
51+
"@lwc/signals": "8.22.3"
5252
},
5353
"devDependencies": {
5454
"observable-membrane": "2.0.0"

packages/@lwc/engine-core/src/framework/mutation-tracker.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: MIT
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
66
*/
7-
import { isNull, isObject, isTrustedSignal } from '@lwc/shared';
7+
import { isNull, isObject, isTrustedSignal, legacyIsTrustedSignal } from '@lwc/shared';
88
import { ReactiveObserver, valueMutated, valueObserved } from '../libs/mutation-tracker';
99
import { subscribeToSignal } from '../libs/signal-tracker';
1010
import type { Signal } from '@lwc/signals';
@@ -41,13 +41,26 @@ export function componentValueObserved(vm: VM, key: PropertyKey, target: any = {
4141
lwcRuntimeFlags.ENABLE_EXPERIMENTAL_SIGNALS &&
4242
isObject(target) &&
4343
!isNull(target) &&
44-
isTrustedSignal(target) &&
4544
process.env.IS_BROWSER &&
4645
// Only subscribe if a template is being rendered by the engine
4746
tro.isObserving()
4847
) {
49-
// Subscribe the template reactive observer's notify method, which will mark the vm as dirty and schedule hydration.
50-
subscribeToSignal(component, target as Signal<unknown>, tro.notify.bind(tro));
48+
/**
49+
* The legacy validation behavior was that this check should only
50+
* be performed for runtimes that have provided a trustedSignals set.
51+
* However, this resulted in a bug as all object values were
52+
* being considered signals in environments where the trustedSignals
53+
* set had not been defined. The runtime flag has been added as a killswitch
54+
* in case the fix needs to be reverted.
55+
*/
56+
if (
57+
lwcRuntimeFlags.ENABLE_LEGACY_SIGNAL_CONTEXT_VALIDATION
58+
? legacyIsTrustedSignal(target)
59+
: isTrustedSignal(target)
60+
) {
61+
// Subscribe the template reactive observer's notify method, which will mark the vm as dirty and schedule hydration.
62+
subscribeToSignal(component, target as Signal<unknown>, tro.notify.bind(tro));
63+
}
5164
}
5265
}
5366

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,14 @@ function flushRehydrationQueue() {
673673
for (let i = 0, len = vms.length; i < len; i += 1) {
674674
const vm = vms[i];
675675
try {
676-
rehydrate(vm);
676+
// We want to prevent rehydration from occurring when nodes are detached from the DOM as this can trigger
677+
// unintended side effects, like lifecycle methods being called multiple times.
678+
// For backwards compatibility, we use a flag to control the check.
679+
// 1. When flag is off, always rehydrate (legacy behavior)
680+
// 2. When flag is on, only rehydrate when the VM state is connected (fixed behavior)
681+
if (!lwcRuntimeFlags.DISABLE_DETACHED_REHYDRATION || vm.state === VMState.connected) {
682+
rehydrate(vm);
683+
}
677684
} catch (error) {
678685
if (i + 1 < len) {
679686
// pieces of the queue are still pending to be rehydrated, those should have priority

0 commit comments

Comments
 (0)