Skip to content

Commit 4ab7230

Browse files
committed
Merge branch 'master' into wjh/export-cmp-as-default
2 parents c5432bf + d4872a2 commit 4ab7230

File tree

68 files changed

+1320
-809
lines changed

Some content is hidden

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

68 files changed

+1320
-809
lines changed

.github/workflows/unit.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ jobs:
6666
run: yarn test:types
6767
- name: Run unit tests
6868
run: yarn test:ci
69-
# TODO [#4815]: enable all SSR v2 tests
70-
- name: Run experimental SSR fixture tests
71-
run: TEST_SSR_COMPILER=1 yarn test packages/@lwc/ssr-compiler/src/__tests__/fixtures.spec.ts
7269
- name: Upload unit test coverage report
7370
uses: actions/upload-artifact@v4
7471
with:

eslint.config.mjs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,7 @@ export default tseslint.config(
4848
},
4949

5050
parserOptions: {
51-
projectService: {
52-
allowDefaultProject: [
53-
// I'm not sure why these files aren't picked up... :\
54-
'packages/@lwc/module-resolver/scripts/test/matchers/to-throw-error-with-code.ts',
55-
'packages/@lwc/module-resolver/scripts/test/matchers/to-throw-error-with-type.ts',
56-
'packages/@lwc/module-resolver/scripts/test/setup-test.ts',
57-
],
58-
},
51+
projectService: {},
5952
},
6053
},
6154

package.json

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lwc-monorepo",
3-
"version": "8.12.5",
3+
"version": "8.12.6",
44
"private": true,
55
"description": "Lightning Web Components",
66
"repository": {
@@ -24,6 +24,7 @@
2424
"test:ci": "vitest run --workspace vitest.workspace.mjs --coverage",
2525
"test:karma": "nx test @lwc/integration-karma",
2626
"test:karma:start": "nx start @lwc/integration-karma",
27+
"test:hydration:start": "nx hydration:start @lwc/integration-karma",
2728
"test:integration": "nx sauce @lwc/integration-tests",
2829
"test:performance": "nx test @lwc/perf-benchmarks",
2930
"test:performance:best": "nx test:best @lwc/perf-benchmarks",
@@ -34,26 +35,26 @@
3435
},
3536
"devDependencies": {
3637
"@commitlint/cli": "^19.6.1",
37-
"@eslint/js": "9.18.0",
38+
"@eslint/js": "9.19.0",
3839
"@lwc/eslint-plugin-lwc-internal": "link:./scripts/eslint-plugin",
3940
"@lwc/test-utils-lwc-internals": "link:./scripts/test-utils",
40-
"@nx/js": "20.3.2",
41+
"@nx/js": "20.3.3",
4142
"@rollup/plugin-commonjs": "^28.0.2",
4243
"@rollup/plugin-inject": "^5.0.5",
4344
"@rollup/plugin-node-resolve": "^16.0.0",
4445
"@rollup/plugin-replace": "^6.0.2",
4546
"@rollup/plugin-typescript": "^12.1.2",
4647
"@swc-node/register": "~1.10.9",
47-
"@swc/core": "~1.10.8",
48+
"@swc/core": "~1.10.11",
4849
"@swc/helpers": "~0.5.15",
4950
"@types/babel__core": "^7.20.5",
50-
"@types/node": "^22.10.7",
51-
"@vitest/coverage-v8": "^3.0.3",
51+
"@types/node": "^22.10.10",
52+
"@vitest/coverage-v8": "^3.0.4",
5253
"@vitest/eslint-plugin": "^1.1.25",
53-
"@vitest/ui": "^3.0.3",
54+
"@vitest/ui": "^3.0.4",
5455
"bytes": "^3.1.2",
5556
"es-module-lexer": "^1.6.0",
56-
"eslint": "9.18.0",
57+
"eslint": "9.19.0",
5758
"eslint-config-flat-gitignore": "^1.0.0",
5859
"eslint-plugin-header": "^3.1.1",
5960
"eslint-plugin-import": "^2.31.0",
@@ -62,16 +63,16 @@
6263
"husky": "^9.1.7",
6364
"isbinaryfile": "^5.0.4",
6465
"jsdom": "^26.0.0",
65-
"lint-staged": "^15.4.1",
66+
"lint-staged": "^15.4.3",
6667
"magic-string": "^0.30.17",
67-
"nx": "20.3.2",
68+
"nx": "20.3.3",
6869
"prettier": "^3.4.2",
69-
"rollup": "^4.31.0",
70+
"rollup": "^4.32.0",
7071
"terser": "^5.37.0",
7172
"tslib": "^2.8.1",
72-
"typescript": "5.4.5",
73-
"typescript-eslint": "8.20.0",
74-
"vitest": "^3.0.3"
73+
"typescript": "5.7.3",
74+
"typescript-eslint": "8.21.0",
75+
"vitest": "^3.0.4"
7576
},
7677
"lint-staged": {
7778
"*.{js,mjs,ts}": "eslint --cache",

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.12.5",
7+
"version": "8.12.6",
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.12.5",
7+
"version": "8.12.6",
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.25.9",
50-
"@lwc/errors": "8.12.5",
51-
"@lwc/shared": "8.12.5",
50+
"@lwc/errors": "8.12.6",
51+
"@lwc/shared": "8.12.6",
5252
"line-column": "~1.0.2"
5353
},
5454
"devDependencies": {

packages/@lwc/compiler/package.json

Lines changed: 8 additions & 8 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.12.5",
7+
"version": "8.12.6",
88
"description": "LWC compiler",
99
"keywords": [
1010
"lwc"
@@ -46,17 +46,17 @@
4646
}
4747
},
4848
"dependencies": {
49-
"@babel/core": "7.26.0",
49+
"@babel/core": "7.26.7",
5050
"@babel/plugin-transform-async-generator-functions": "7.25.9",
5151
"@babel/plugin-transform-async-to-generator": "7.25.9",
5252
"@babel/plugin-transform-class-properties": "7.25.9",
5353
"@babel/plugin-transform-object-rest-spread": "7.25.9",
5454
"@locker/babel-plugin-transform-unforgeables": "0.22.0",
55-
"@lwc/babel-plugin-component": "8.12.5",
56-
"@lwc/errors": "8.12.5",
57-
"@lwc/shared": "8.12.5",
58-
"@lwc/ssr-compiler": "8.12.5",
59-
"@lwc/style-compiler": "8.12.5",
60-
"@lwc/template-compiler": "8.12.5"
55+
"@lwc/babel-plugin-component": "8.12.6",
56+
"@lwc/errors": "8.12.6",
57+
"@lwc/shared": "8.12.6",
58+
"@lwc/ssr-compiler": "8.12.6",
59+
"@lwc/style-compiler": "8.12.6",
60+
"@lwc/template-compiler": "8.12.6"
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.12.5",
7+
"version": "8.12.6",
88
"description": "Core LWC engine APIs.",
99
"keywords": [
1010
"lwc"
@@ -46,9 +46,9 @@
4646
}
4747
},
4848
"dependencies": {
49-
"@lwc/features": "8.12.5",
50-
"@lwc/shared": "8.12.5",
51-
"@lwc/signals": "8.12.5"
49+
"@lwc/features": "8.12.6",
50+
"@lwc/shared": "8.12.6",
51+
"@lwc/signals": "8.12.6"
5252
},
5353
"devDependencies": {
5454
"observable-membrane": "2.0.0"

packages/@lwc/engine-core/src/framework/decorators/wire.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,15 @@ export default function wire<
6565
Class = LightningElement,
6666
>(
6767
// eslint-disable-next-line @typescript-eslint/no-unused-vars
68-
adapter: WireAdapterConstructor<ReplaceReactiveValues<ReactiveConfig, Class>, Value, Context>,
68+
adapter:
69+
| WireAdapterConstructor<ReplaceReactiveValues<ReactiveConfig, Class>, Value, Context>
70+
| {
71+
adapter: WireAdapterConstructor<
72+
ReplaceReactiveValues<ReactiveConfig, Class>,
73+
Value,
74+
Context
75+
>;
76+
},
6977
// eslint-disable-next-line @typescript-eslint/no-unused-vars
7078
config?: ReactiveConfig
7179
): WireDecorator<Value, Class> {

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ import { getScopeTokenClass } from './stylesheet';
5555
import { renderComponent } from './component';
5656
import { applyRefs } from './modules/refs';
5757
import { unwrapIfNecessary } from './sanitized-html-content';
58+
import {
59+
logGlobalOperationEndWithVM,
60+
logGlobalOperationStartWithVM,
61+
logOperationEnd,
62+
logOperationStart,
63+
OperationId,
64+
} from './profiler';
5865
import type { Classes } from './hydration-utils';
5966
import type {
6067
VNodes,
@@ -85,6 +92,8 @@ let hasMismatch = false;
8592
export function hydrateRoot(vm: VM) {
8693
hasMismatch = false;
8794

95+
logGlobalOperationStartWithVM(OperationId.GlobalSsrHydrate, vm);
96+
8897
runConnectedCallback(vm);
8998
hydrateVM(vm);
9099

@@ -98,6 +107,7 @@ export function hydrateRoot(vm: VM) {
98107
logHydrationWarning('Hydration completed with errors.');
99108
}
100109
}
110+
logGlobalOperationEndWithVM(OperationId.GlobalSsrHydrate, vm);
101111
}
102112

103113
function hydrateVM(vm: VM) {
@@ -111,7 +121,9 @@ function hydrateVM(vm: VM) {
111121
renderRoot: parentNode,
112122
renderer: { getFirstChild },
113123
} = vm;
124+
logOperationStart(OperationId.Patch, vm);
114125
hydrateChildren(getFirstChild(parentNode), children, parentNode, vm, false);
126+
logOperationEnd(OperationId.Patch, vm);
115127
runRenderedCallback(vm);
116128
}
117129

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

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ export const enum OperationId {
2020
RenderedCallback = 4,
2121
DisconnectedCallback = 5,
2222
ErrorCallback = 6,
23-
GlobalHydrate = 7,
24-
GlobalRehydrate = 8,
23+
GlobalRender = 7,
24+
GlobalRerender = 8,
25+
GlobalSsrHydrate = 9,
2526
}
2627

27-
type GlobalOperationId = OperationId.GlobalHydrate | OperationId.GlobalRehydrate;
28+
type GlobalOperationId =
29+
| OperationId.GlobalRender
30+
| OperationId.GlobalRerender
31+
| OperationId.GlobalSsrHydrate;
2832

2933
const enum Phase {
3034
Start = 0,
@@ -60,8 +64,9 @@ const operationIdNameMapping = [
6064
'renderedCallback',
6165
'disconnectedCallback',
6266
'errorCallback',
63-
'lwc-hydrate',
64-
'lwc-rehydrate',
67+
'lwc-render',
68+
'lwc-rerender',
69+
'lwc-ssr-hydrate',
6570
] as const satisfies Record<OperationId, string>;
6671

6772
const operationTooltipMapping = [
@@ -79,10 +84,12 @@ const operationTooltipMapping = [
7984
'component disconnectedCallback()',
8085
// errorCallback
8186
'component errorCallback()',
82-
// lwc-hydrate
87+
// lwc-render
8388
'component first rendered',
84-
// lwc-rehydrate
89+
// lwc-rerender
8590
'component re-rendered',
91+
// lwc-ssr-hydrate
92+
'component hydrated from server-rendered HTML',
8693
] as const satisfies Record<OperationId, string>;
8794

8895
// Even if all the browser the engine supports implements the UserTiming API, we need to guard the measure APIs.
@@ -154,13 +161,14 @@ function getProperties(vm: VM<any, any>): [string, string][] {
154161
function getColor(opId: OperationId): TrackColor {
155162
// As of Sept 2024: primary (dark blue), secondary (light blue), tertiary (green)
156163
switch (opId) {
157-
// GlobalHydrate and Constructor tend to occur at the top level
158-
case OperationId.GlobalHydrate:
164+
// GlobalSsrHydrate, GlobalRender, and Constructor tend to occur at the top level
165+
case OperationId.GlobalRender:
166+
case OperationId.GlobalSsrHydrate:
159167
case OperationId.Constructor:
160168
return 'primary';
161-
// GlobalRehydrate also occurs at the top level, but we want to use tertiary (green) because it's easier to
169+
// GlobalRerender also occurs at the top level, but we want to use tertiary (green) because it's easier to
162170
// distinguish from primary, and at a glance you should be able to easily tell re-renders from first renders.
163-
case OperationId.GlobalRehydrate:
171+
case OperationId.GlobalRerender:
164172
return 'tertiary';
165173
// Everything else (patch/render/callbacks)
166174
default:

0 commit comments

Comments
 (0)