Skip to content

Commit 121d4dd

Browse files
committed
Merge branch 'master' into rave/signal-with-secret-symbol
2 parents f77d946 + 114ba6e commit 121d4dd

File tree

208 files changed

+1953
-1269
lines changed

Some content is hidden

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

208 files changed

+1953
-1269
lines changed

.github/workflows/karma.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ jobs:
182182
- run: ENABLE_SYNTHETIC_SHADOW_IN_HYDRATION=1 yarn hydration:sauce:ci
183183
- run: NODE_ENV_FOR_TEST=production yarn hydration:sauce:ci
184184
- run: DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 yarn hydration:sauce:ci
185+
- run: DISABLE_STATIC_CONTENT_OPTIMIZATION=1 yarn hydration:sauce:ci
185186

186187
- name: Upload coverage results
187188
uses: actions/upload-artifact@v4

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ export default tseslint.config(
256256
files: ['packages/@lwc/integration-karma/**'],
257257
rules: {
258258
'vitest/no-conditional-tests': 'error',
259+
'vitest/no-done-callback': 'error',
259260
},
260261
},
261262
{

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,29 @@
3434
},
3535
"devDependencies": {
3636
"@commitlint/cli": "^19.5.0",
37-
"@eslint/compat": "^1.2.0",
38-
"@eslint/js": "^9.12.0",
37+
"@eslint/compat": "^1.2.1",
38+
"@eslint/js": "^9.13.0",
3939
"@lwc/eslint-plugin-lwc-internal": "link:./scripts/eslint-plugin",
4040
"@lwc/test-utils-lwc-internals": "link:./scripts/test-utils",
41-
"@nx/js": "20.0.0",
42-
"@rollup/plugin-commonjs": "^28.0.0",
41+
"@nx/js": "20.0.3",
42+
"@rollup/plugin-commonjs": "^28.0.1",
4343
"@rollup/plugin-inject": "^5.0.5",
4444
"@rollup/plugin-node-resolve": "^15.3.0",
4545
"@rollup/plugin-replace": "^6.0.1",
46-
"@rollup/plugin-typescript": "^12.1.0",
46+
"@rollup/plugin-typescript": "^12.1.1",
4747
"@swc-node/register": "~1.10.9",
4848
"@swc/core": "~1.7.36",
4949
"@swc/helpers": "~0.5.13",
5050
"@types/babel__core": "^7.20.5",
51-
"@types/node": "^22.7.5",
51+
"@types/node": "^22.7.7",
5252
"@vitest/coverage-v8": "^2.1.3",
5353
"@vitest/eslint-plugin": "^1.1.7",
5454
"@vitest/expect": "^2.1.3",
5555
"@vitest/ui": "^2.1.3",
5656
"@vitest/utils": "^2.1.2",
5757
"bytes": "^3.1.2",
5858
"es-module-lexer": "^1.5.4",
59-
"eslint": "^9.12.0",
59+
"eslint": "^9.13.0",
6060
"eslint-config-flat-gitignore": "^0.3.0",
6161
"eslint-plugin-header": "^3.1.1",
6262
"eslint-plugin-import": "^2.31.0",
@@ -68,13 +68,13 @@
6868
"jsdom": "^25.0.1",
6969
"lint-staged": "^15.2.10",
7070
"magic-string": "^0.30.12",
71-
"nx": "20.0.0",
71+
"nx": "20.0.3",
7272
"prettier": "^3.3.3",
7373
"rollup": "^4.24.0",
74-
"terser": "^5.34.1",
75-
"tslib": "^2.7.0",
74+
"terser": "^5.36.0",
75+
"tslib": "^2.8.0",
7676
"typescript": "5.4.5",
77-
"typescript-eslint": "^8.9.0",
77+
"typescript-eslint": "^8.10.0",
7878
"vitest": "^2.1.3"
7979
},
8080
"lint-staged": {

packages/@lwc/compiler/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
export { transform, transformSync } from './transformers/transformer';
88

9-
export { TransformResult } from './transformers/transformer';
9+
export { TransformResult } from './transformers/shared';
1010
export {
1111
NormalizedTransformOptions,
1212
TransformOptions,

packages/@lwc/compiler/src/options.ts

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
import { InstrumentationObject, CompilerValidationErrors, invariant } from '@lwc/errors';
88
import { isUndefined, isBoolean, getAPIVersionFromNumber } from '@lwc/shared';
9-
import { CustomRendererConfig } from '@lwc/template-compiler';
9+
import type { CustomRendererConfig } from '@lwc/template-compiler';
1010

1111
/**
1212
* Flag indicating that a warning about still using the deprecated `enableLwcSpread`
@@ -131,8 +131,7 @@ export interface TransformOptions {
131131
targetSSR?: boolean;
132132
}
133133

134-
type RequiredTransformOptions = Omit<
135-
TransformOptions,
134+
type OptionalTransformKeys =
136135
| 'name'
137136
| 'namespace'
138137
| 'scopedStyles'
@@ -142,20 +141,14 @@ type RequiredTransformOptions = Omit<
142141
| 'enableDynamicComponents'
143142
| 'experimentalDynamicDirective'
144143
| 'experimentalDynamicComponent'
145-
| 'instrumentation'
146-
>;
147-
export interface NormalizedTransformOptions extends RecursiveRequired<RequiredTransformOptions> {
148-
name?: string;
149-
namespace?: string;
150-
scopedStyles?: boolean;
151-
customRendererConfig?: CustomRendererConfig;
152-
enableLwcSpread?: boolean;
153-
enableLightningWebSecurityTransforms?: boolean;
154-
enableDynamicComponents?: boolean;
155-
experimentalDynamicDirective?: boolean;
156-
experimentalDynamicComponent?: DynamicImportConfig;
157-
instrumentation?: InstrumentationObject;
158-
}
144+
| 'instrumentation';
145+
146+
type RequiredTransformOptions = RecursiveRequired<Omit<TransformOptions, OptionalTransformKeys>>;
147+
type OptionalTransformOptions = Pick<TransformOptions, OptionalTransformKeys>;
148+
149+
export interface NormalizedTransformOptions
150+
extends RequiredTransformOptions,
151+
OptionalTransformOptions {}
159152

160153
/**
161154
* Validates that the options conform to the expected shape and normalizes them to a standard format

packages/@lwc/compiler/src/transformers/javascript.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import lwcClassTransformPlugin, { type LwcBabelPluginOptions } from '@lwc/babel-
1414
import { normalizeToCompilerError, TransformerErrors } from '@lwc/errors';
1515
import { isAPIFeatureEnabled, APIFeature } from '@lwc/shared';
1616

17-
import { NormalizedTransformOptions } from '../options';
18-
import { TransformResult } from './transformer';
17+
import type { NormalizedTransformOptions } from '../options';
18+
import type { TransformResult } from './shared';
1919

2020
/**
2121
* Transforms a JavaScript file.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2024, Salesforce, Inc.
3+
* All rights reserved.
4+
* SPDX-License-Identifier: MIT
5+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6+
*/
7+
import { CompilerDiagnostic } from '@lwc/errors';
8+
9+
/** The object returned after transforming code. */
10+
export interface TransformResult {
11+
/** The compiled source code. */
12+
code: string;
13+
/** The generated source map. */
14+
map: unknown;
15+
/** Any diagnostic warnings that may have occurred. */
16+
warnings?: CompilerDiagnostic[];
17+
/**
18+
* String tokens used for style scoping in synthetic shadow DOM and `*.scoped.css`, as either
19+
* attributes or classes.
20+
*/
21+
cssScopeTokens?: string[];
22+
}

packages/@lwc/compiler/src/transformers/style.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import * as styleCompiler from '@lwc/style-compiler';
88
import { normalizeToCompilerError, TransformerErrors } from '@lwc/errors';
99

10-
import { NormalizedTransformOptions } from '../options';
11-
import { TransformResult } from './transformer';
10+
import type { NormalizedTransformOptions } from '../options';
11+
import type { TransformResult } from './shared';
1212

1313
/**
1414
* Transform the passed source code

packages/@lwc/compiler/src/transformers/template.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import {
1212
} from '@lwc/errors';
1313
import { compile } from '@lwc/template-compiler';
1414

15-
import { NormalizedTransformOptions } from '../options';
16-
import { TransformResult } from './transformer';
15+
import type { NormalizedTransformOptions } from '../options';
16+
import type { TransformResult } from './shared';
1717

1818
/**
1919
* Transforms a HTML template into module exporting a template function.

packages/@lwc/compiler/src/transformers/transformer.ts

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,14 @@
77
import * as path from 'path';
88

99
import { isString } from '@lwc/shared';
10-
import {
11-
TransformerErrors,
12-
generateCompilerError,
13-
invariant,
14-
CompilerDiagnostic,
15-
} from '@lwc/errors';
10+
import { TransformerErrors, generateCompilerError, invariant } from '@lwc/errors';
1611
import { compileComponentForSSR, compileTemplateForSSR } from '@lwc/ssr-compiler';
1712

1813
import { NormalizedTransformOptions, TransformOptions, validateTransformOptions } from '../options';
1914
import styleTransform from './style';
2015
import templateTransformer from './template';
2116
import scriptTransformer from './javascript';
22-
23-
/** The object returned after transforming code. */
24-
export interface TransformResult {
25-
/** The compiled source code. */
26-
code: string;
27-
/** The generated source map. */
28-
map: unknown;
29-
/** Any diagnostic warnings that may have occurred. */
30-
warnings?: CompilerDiagnostic[];
31-
/**
32-
* String tokens used for style scoping in synthetic shadow DOM and `*.scoped.css`, as either
33-
* attributes or classes.
34-
*/
35-
cssScopeTokens?: string[];
36-
}
17+
import type { TransformResult } from './shared';
3718

3819
/**
3920
* Transform the passed source code.

0 commit comments

Comments
 (0)