Skip to content

Commit 691b4f5

Browse files
ravijayaramappanolanlawsonekashida
authored
chore: release v6.3.2 (#4049)
* refactor: organize API versioning tests (#4040) * fix: disable form association entirely on older API versions (#4041) Fixes #3929 * Revert "fix(synthetic-shadow): retargeting does not correctly account for nat…" (#4047) This reverts commit 13cd45f. * chore: routine dependencies update (#4046) * chore: routine dependencies update * fix: revert prettier updates * chore: update husky * chore: update husky * fix: disable ts rule * chore: v6.3.2 (#4048) --------- Co-authored-by: Nolan Lawson <nlawson@salesforce.com> Co-authored-by: Eugene Kashida <ekashida@gmail.com>
1 parent 21b57fe commit 691b4f5

File tree

75 files changed

+1186
-961
lines changed

Some content is hidden

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

75 files changed

+1186
-961
lines changed

.eslintrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@
162162
"@typescript-eslint/no-unsafe-assignment": "off",
163163
"@typescript-eslint/no-unsafe-return": "off",
164164
"@typescript-eslint/no-unsafe-argument": "off",
165+
// This rule returns false positives with ! assertions, even with strictNullChecks(https://github.com/typescript-eslint/typescript-eslint/issues/1618) on it was complaining
166+
"@typescript-eslint/no-unnecessary-type-assertion": "off",
165167

166168
"jsdoc/require-jsdoc": ["warn", { "publicOnly": true }],
167169
"jsdoc/check-indentation": "error",

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "lwc-monorepo",
3-
"version": "6.3.1",
3+
"version": "6.3.2",
44
"private": true,
55
"description": "Lightning Web Components",
66
"repository": {
77
"type": "git",
88
"url": "https://github.com/salesforce/lwc.git"
99
},
1010
"scripts": {
11-
"prepare": "husky install && yarn build",
11+
"prepare": "husky && yarn build",
1212
"lint": "eslint packages/ scripts/ --ext=js,mjs,ts",
1313
"format": "prettier --write '{packages,scripts}/**/*.{js,mjs,ts,json,md}'",
1414
"bundlesize": "node scripts/bundlesize/bundlesize.mjs",
@@ -32,7 +32,7 @@
3232
},
3333
"devDependencies": {
3434
"@babel/plugin-transform-modules-commonjs": "^7.23.3",
35-
"@commitlint/cli": "^18.6.1",
35+
"@commitlint/cli": "^19.0.3",
3636
"@lwc/eslint-plugin-lwc-internal": "link:./scripts/eslint-plugin",
3737
"@lwc/jest-utils-lwc-internals": "link:./scripts/jest/utils",
3838
"@rollup/plugin-commonjs": "^25.0.2",
@@ -42,31 +42,31 @@
4242
"@rollup/plugin-typescript": "^11.1.6",
4343
"@types/babel__core": "^7.20.5",
4444
"@types/jest": "^29.5.12",
45-
"@types/node": "^20.11.20",
45+
"@types/node": "^20.11.26",
4646
"@types/prettier": "^2.7.3",
47-
"@typescript-eslint/eslint-plugin": "^6.20.0",
48-
"@typescript-eslint/parser": "^6.20.0",
47+
"@typescript-eslint/eslint-plugin": "^7.2.0",
48+
"@typescript-eslint/parser": "^7.2.0",
4949
"bytes": "^3.1.2",
5050
"es-module-lexer": "^1.4.1",
5151
"eslint": "^8.57.0",
5252
"eslint-plugin-header": "^3.1.1",
5353
"eslint-plugin-import": "^2.29.1",
5454
"eslint-plugin-jest": "^27.9.0",
55-
"eslint-plugin-jsdoc": "^48.2.0",
55+
"eslint-plugin-jsdoc": "^48.2.1",
5656
"glob": "^10.3.10",
57-
"husky": "^8.0.2",
57+
"husky": "^9.0.11",
5858
"isbinaryfile": "^5.0.2",
5959
"jest": "^29.7.0",
6060
"jest-environment-jsdom": "^29.7.0",
6161
"lint-staged": "^15.2.2",
62-
"magic-string": "^0.30.7",
62+
"magic-string": "^0.30.8",
6363
"nx": "17.2.6",
6464
"prettier": "^2.8.8",
65-
"rollup": "^4.9.6",
66-
"terser": "^5.27.0",
65+
"rollup": "^4.12.1",
66+
"terser": "^5.29.1",
6767
"ts-jest": "^29.1.2",
6868
"tslib": "^2.6.1",
69-
"typescript": "5.3.3"
69+
"typescript": "5.4.2"
7070
},
7171
"lint-staged": {
7272
"**/*.{js,mjs,ts}": "eslint",

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": "6.3.1",
7+
"version": "6.3.2",
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": "6.3.1",
7+
"version": "6.3.2",
88
"description": "Babel plugin to transform a LWC module",
99
"keywords": [
1010
"lwc"
@@ -43,8 +43,8 @@
4343
},
4444
"dependencies": {
4545
"@babel/helper-module-imports": "7.22.15",
46-
"@lwc/errors": "6.3.1",
47-
"@lwc/shared": "6.3.1",
46+
"@lwc/errors": "6.3.2",
47+
"@lwc/shared": "6.3.2",
4848
"line-column": "~1.0.2"
4949
},
5050
"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": "6.3.1",
7+
"version": "6.3.2",
88
"description": "LWC compiler",
99
"keywords": [
1010
"lwc"
@@ -42,16 +42,16 @@
4242
}
4343
},
4444
"dependencies": {
45-
"@babel/core": "7.23.9",
45+
"@babel/core": "7.24.0",
4646
"@babel/plugin-proposal-async-generator-functions": "7.20.7",
4747
"@babel/plugin-proposal-class-properties": "7.18.6",
4848
"@babel/plugin-proposal-object-rest-spread": "7.20.7",
4949
"@babel/plugin-transform-async-to-generator": "7.23.3",
5050
"@locker/babel-plugin-transform-unforgeables": "0.20.0",
51-
"@lwc/babel-plugin-component": "6.3.1",
52-
"@lwc/errors": "6.3.1",
53-
"@lwc/shared": "6.3.1",
54-
"@lwc/style-compiler": "6.3.1",
55-
"@lwc/template-compiler": "6.3.1"
51+
"@lwc/babel-plugin-component": "6.3.2",
52+
"@lwc/errors": "6.3.2",
53+
"@lwc/shared": "6.3.2",
54+
"@lwc/style-compiler": "6.3.2",
55+
"@lwc/template-compiler": "6.3.2"
5656
}
5757
}

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": "6.3.1",
7+
"version": "6.3.2",
88
"description": "Core LWC engine APIs.",
99
"keywords": [
1010
"lwc"
@@ -42,11 +42,11 @@
4242
}
4343
},
4444
"dependencies": {
45-
"@lwc/features": "6.3.1",
46-
"@lwc/shared": "6.3.1"
45+
"@lwc/features": "6.3.2",
46+
"@lwc/shared": "6.3.2"
4747
},
4848
"devDependencies": {
4949
"observable-membrane": "2.0.0",
50-
"@lwc/signals": "6.3.1"
50+
"@lwc/signals": "6.3.2"
5151
}
5252
}

packages/@lwc/engine-core/src/framework/base-lightning-element.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,11 @@ function warnIfInvokedDuringConstruction(vm: VM, methodOrPropName: string) {
486486
renderer: { attachInternals },
487487
} = vm;
488488

489-
if (!isAPIFeatureEnabled(APIFeature.ENABLE_ELEMENT_INTERNALS, apiVersion)) {
489+
if (!isAPIFeatureEnabled(APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE, apiVersion)) {
490490
throw new Error(
491-
`The attachInternals API is only supported in API version 61 and above. To use this API please update the LWC component API version.`
491+
`The attachInternals API is only supported in API version 61 and above. ` +
492+
`The current version is ${apiVersion}. ` +
493+
`To use this API, update the LWC component API version. https://lwc.dev/guide/versioning`
492494
);
493495
}
494496

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
import { logError, logWarn } from '../shared/logger';
2525

2626
import { RendererAPI } from './renderer';
27-
import { cloneAndOmitKey, parseStyleText } from './utils';
27+
import { cloneAndOmitKey, parseStyleText, shouldBeFormAssociated } from './utils';
2828
import { allocateChildren, mount, removeNode } from './rendering';
2929
import {
3030
createVM,
@@ -321,7 +321,8 @@ function hydrateCustomElement(
321321

322322
const { sel, mode, ctor, owner } = vnode;
323323
const { defineCustomElement, getTagName } = renderer;
324-
defineCustomElement(StringToLowerCase.call(getTagName(elm)), Boolean(ctor.formAssociated));
324+
const isFormAssociated = shouldBeFormAssociated(ctor);
325+
defineCustomElement(StringToLowerCase.call(getTagName(elm)), isFormAssociated);
325326

326327
const vm = createVM(elm, ctor, renderer, {
327328
mode,

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export { parseFragment, parseSVGFragment } from './template';
2626
export { hydrateRoot } from './hydration';
2727

2828
// Internal APIs used by compiled code -------------------------------------------------------------
29-
export { registerComponent, getComponentAPIVersion } from './component';
29+
export { registerComponent } from './component';
3030
export { registerTemplate } from './secure-template';
3131
export { registerDecorators } from './decorators/register';
3232

@@ -39,6 +39,8 @@ export { reportingControl as __unstable__ReportingControl } from './reporting';
3939
export { swapTemplate, swapComponent, swapStyle } from './hot-swaps';
4040
export { setHooks } from './overridable-hooks';
4141
export { freezeTemplate } from './freeze-template';
42+
export { getComponentAPIVersion } from './component';
43+
export { shouldBeFormAssociated } from './utils';
4244

4345
// Experimental or Internal APIs
4446
export { getComponentConstructor } from './get-component-constructor';

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
import { logError } from '../shared/logger';
2525
import { getComponentTag } from '../shared/format';
2626
import { RendererAPI } from './renderer';
27-
import { EmptyArray, shouldUseNativeCustomElementLifecycle } from './utils';
27+
import { EmptyArray, shouldBeFormAssociated, shouldUseNativeCustomElementLifecycle } from './utils';
2828
import { markComponentAsDirty } from './component';
2929
import { getScopeTokenClass } from './stylesheet';
3030
import { lockDomMutation, patchElementWithRestrictions, unlockDomMutation } from './restrictions';
@@ -337,7 +337,7 @@ function mountCustomElement(
337337
const useNativeLifecycle = shouldUseNativeCustomElementLifecycle(
338338
ctor as LightningElementConstructor
339339
);
340-
const isFormAssociated = Boolean(ctor.formAssociated);
340+
const isFormAssociated = shouldBeFormAssociated(ctor);
341341
const elm = createCustomElement(
342342
normalizedTagname,
343343
upgradeCallback,

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ import {
1616
isUndefined,
1717
isNull,
1818
} from '@lwc/shared';
19+
import { logWarnOnce } from '../shared/logger';
1920
import { StylesheetFactory, TemplateStylesheetFactories } from './stylesheet';
20-
import { getComponentAPIVersion } from './component';
21+
import { getComponentAPIVersion, getComponentRegisteredName } from './component';
2122
import { LightningElementConstructor } from './base-lightning-element';
2223
import { VElementData } from './vnodes';
2324

@@ -157,3 +158,23 @@ export function applyTemporaryCompilerV5SlotFix(data: VElementData) {
157158
}
158159
return data;
159160
}
161+
162+
export function shouldBeFormAssociated(Ctor: LightningElementConstructor) {
163+
const ctorFormAssociated = Boolean(Ctor.formAssociated);
164+
const apiVersion = getComponentAPIVersion(Ctor);
165+
const apiFeatureEnabled = isAPIFeatureEnabled(
166+
APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE,
167+
apiVersion
168+
);
169+
170+
if (process.env.NODE_ENV !== 'production' && ctorFormAssociated && !apiFeatureEnabled) {
171+
const tagName = getComponentRegisteredName(Ctor);
172+
logWarnOnce(
173+
`Component <${tagName}> set static formAssociated to true, but form ` +
174+
`association is not enabled because the API version is ${apiVersion}. To enable form association, ` +
175+
`update the LWC component API version to 61 or above. https://lwc.dev/guide/versioning`
176+
);
177+
}
178+
179+
return ctorFormAssociated && apiFeatureEnabled;
180+
}

packages/@lwc/engine-core/src/framework/wiring/context.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ export function createContextProviderWithRegister(
2424
adapter: WireAdapterConstructor,
2525
registerContextProvider: RegisterContextProviderFn
2626
): ContextProvider {
27-
let adapterContextToken = AdapterToTokenMap.get(adapter);
28-
if (!isUndefined(adapterContextToken)) {
27+
if (AdapterToTokenMap.has(adapter)) {
2928
throw new Error(`Adapter already has a context provider.`);
3029
}
31-
adapterContextToken = guid();
30+
const adapterContextToken = guid();
3231
AdapterToTokenMap.set(adapter, adapterContextToken);
3332
const providers = new WeakSet<EventTarget>();
3433

@@ -42,7 +41,7 @@ export function createContextProviderWithRegister(
4241

4342
registerContextProvider(
4443
elmOrComponent,
45-
adapterContextToken!,
44+
adapterContextToken,
4645
(subscriptionPayload: WireContextSubscriptionPayload) => {
4746
const { setNewContext, setDisconnectedCallback } = subscriptionPayload;
4847
const consumer: ContextConsumer = {

packages/@lwc/engine-dom/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/engine-dom",
7-
"version": "6.3.1",
7+
"version": "6.3.2",
88
"description": "Renders LWC components in a DOM environment.",
99
"keywords": [
1010
"lwc"
@@ -42,8 +42,8 @@
4242
}
4343
},
4444
"devDependencies": {
45-
"@lwc/engine-core": "6.3.1",
46-
"@lwc/shared": "6.3.1"
45+
"@lwc/engine-core": "6.3.2",
46+
"@lwc/shared": "6.3.2"
4747
},
4848
"lwc": {
4949
"modules": [

packages/@lwc/engine-dom/src/apis/create-element.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
disconnectRootElement,
2323
LightningElement,
2424
getComponentAPIVersion,
25+
shouldBeFormAssociated,
2526
} from '@lwc/engine-core';
2627
import { renderer } from '../renderer';
2728

@@ -135,7 +136,7 @@ export function createElement(
135136
!lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE &&
136137
isAPIFeatureEnabled(APIFeature.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE, apiVersion);
137138

138-
const isFormAssociated = Boolean(Ctor.formAssociated);
139+
const isFormAssociated = shouldBeFormAssociated(Ctor);
139140

140141
// the custom element from the registry is expecting an upgrade callback
141142
/*

packages/@lwc/engine-dom/src/apis/hydrate-component.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
hydrateRoot,
1212
connectRootElement,
1313
getAssociatedVMIfPresent,
14+
shouldBeFormAssociated,
1415
} from '@lwc/engine-core';
1516
import { StringToLowerCase, isFunction, isNull, isObject } from '@lwc/shared';
1617
import { renderer } from '../renderer';
@@ -89,10 +90,8 @@ export function hydrateComponent(
8990

9091
try {
9192
const { defineCustomElement, getTagName } = renderer;
92-
defineCustomElement(
93-
StringToLowerCase.call(getTagName(element)),
94-
Boolean(Ctor.formAssociated)
95-
);
93+
const isFormAssociated = shouldBeFormAssociated(Ctor);
94+
defineCustomElement(StringToLowerCase.call(getTagName(element)), isFormAssociated);
9695
const vm = createVMWithProps(element, Ctor, props);
9796

9897
hydrateRoot(vm);

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

Lines changed: 6 additions & 6 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-server",
7-
"version": "6.3.1",
7+
"version": "6.3.2",
88
"description": "Renders LWC components in a server environment.",
99
"keywords": [
1010
"lwc"
@@ -42,11 +42,11 @@
4242
}
4343
},
4444
"devDependencies": {
45-
"@lwc/engine-core": "6.3.1",
46-
"@lwc/rollup-plugin": "6.3.1",
47-
"@lwc/shared": "6.3.1",
45+
"@lwc/engine-core": "6.3.2",
46+
"@lwc/rollup-plugin": "6.3.2",
47+
"@lwc/shared": "6.3.2",
48+
"@parse5/tools": "^0.4.0",
4849
"@rollup/plugin-virtual": "^3.0.1",
49-
"parse5": "^7.1.2",
50-
"@parse5/tools": "^0.3.0"
50+
"parse5": "^7.1.2"
5151
}
5252
}

packages/@lwc/errors/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/errors",
7-
"version": "6.3.1",
7+
"version": "6.3.2",
88
"description": "LWC Error Utilities",
99
"keywords": [
1010
"lwc"

packages/@lwc/features/package.json

Lines changed: 2 additions & 2 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/features",
7-
"version": "6.3.1",
7+
"version": "6.3.2",
88
"description": "LWC Features Flags",
99
"keywords": [
1010
"lwc"
@@ -42,6 +42,6 @@
4242
}
4343
},
4444
"dependencies": {
45-
"@lwc/shared": "6.3.1"
45+
"@lwc/shared": "6.3.2"
4646
}
4747
}

0 commit comments

Comments
 (0)