Skip to content

Commit

Permalink
chore: release v6.3.2 (#4049)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Eugene Kashida <[email protected]>
  • Loading branch information
3 people authored Mar 12, 2024
1 parent 21b57fe commit 691b4f5
Show file tree
Hide file tree
Showing 75 changed files with 1,186 additions and 961 deletions.
2 changes: 2 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-argument": "off",
// This rule returns false positives with ! assertions, even with strictNullChecks(https://github.com/typescript-eslint/typescript-eslint/issues/1618) on it was complaining
"@typescript-eslint/no-unnecessary-type-assertion": "off",

"jsdoc/require-jsdoc": ["warn", { "publicOnly": true }],
"jsdoc/check-indentation": "error",
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "lwc-monorepo",
"version": "6.3.1",
"version": "6.3.2",
"private": true,
"description": "Lightning Web Components",
"repository": {
"type": "git",
"url": "https://github.com/salesforce/lwc.git"
},
"scripts": {
"prepare": "husky install && yarn build",
"prepare": "husky && yarn build",
"lint": "eslint packages/ scripts/ --ext=js,mjs,ts",
"format": "prettier --write '{packages,scripts}/**/*.{js,mjs,ts,json,md}'",
"bundlesize": "node scripts/bundlesize/bundlesize.mjs",
Expand All @@ -32,7 +32,7 @@
},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.23.3",
"@commitlint/cli": "^18.6.1",
"@commitlint/cli": "^19.0.3",
"@lwc/eslint-plugin-lwc-internal": "link:./scripts/eslint-plugin",
"@lwc/jest-utils-lwc-internals": "link:./scripts/jest/utils",
"@rollup/plugin-commonjs": "^25.0.2",
Expand All @@ -42,31 +42,31 @@
"@rollup/plugin-typescript": "^11.1.6",
"@types/babel__core": "^7.20.5",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.20",
"@types/node": "^20.11.26",
"@types/prettier": "^2.7.3",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"bytes": "^3.1.2",
"es-module-lexer": "^1.4.1",
"eslint": "^8.57.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-jsdoc": "^48.2.0",
"eslint-plugin-jsdoc": "^48.2.1",
"glob": "^10.3.10",
"husky": "^8.0.2",
"husky": "^9.0.11",
"isbinaryfile": "^5.0.2",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lint-staged": "^15.2.2",
"magic-string": "^0.30.7",
"magic-string": "^0.30.8",
"nx": "17.2.6",
"prettier": "^2.8.8",
"rollup": "^4.9.6",
"terser": "^5.27.0",
"rollup": "^4.12.1",
"terser": "^5.29.1",
"ts-jest": "^29.1.2",
"tslib": "^2.6.1",
"typescript": "5.3.3"
"typescript": "5.4.2"
},
"lint-staged": {
"**/*.{js,mjs,ts}": "eslint",
Expand Down
2 changes: 1 addition & 1 deletion packages/@lwc/aria-reflection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
],
"name": "@lwc/aria-reflection",
"version": "6.3.1",
"version": "6.3.2",
"description": "ARIA element reflection polyfill for strings",
"keywords": [
"aom",
Expand Down
6 changes: 3 additions & 3 deletions packages/@lwc/babel-plugin-component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
],
"name": "@lwc/babel-plugin-component",
"version": "6.3.1",
"version": "6.3.2",
"description": "Babel plugin to transform a LWC module",
"keywords": [
"lwc"
Expand Down Expand Up @@ -43,8 +43,8 @@
},
"dependencies": {
"@babel/helper-module-imports": "7.22.15",
"@lwc/errors": "6.3.1",
"@lwc/shared": "6.3.1",
"@lwc/errors": "6.3.2",
"@lwc/shared": "6.3.2",
"line-column": "~1.0.2"
},
"devDependencies": {
Expand Down
14 changes: 7 additions & 7 deletions packages/@lwc/compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
],
"name": "@lwc/compiler",
"version": "6.3.1",
"version": "6.3.2",
"description": "LWC compiler",
"keywords": [
"lwc"
Expand Down Expand Up @@ -42,16 +42,16 @@
}
},
"dependencies": {
"@babel/core": "7.23.9",
"@babel/core": "7.24.0",
"@babel/plugin-proposal-async-generator-functions": "7.20.7",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-proposal-object-rest-spread": "7.20.7",
"@babel/plugin-transform-async-to-generator": "7.23.3",
"@locker/babel-plugin-transform-unforgeables": "0.20.0",
"@lwc/babel-plugin-component": "6.3.1",
"@lwc/errors": "6.3.1",
"@lwc/shared": "6.3.1",
"@lwc/style-compiler": "6.3.1",
"@lwc/template-compiler": "6.3.1"
"@lwc/babel-plugin-component": "6.3.2",
"@lwc/errors": "6.3.2",
"@lwc/shared": "6.3.2",
"@lwc/style-compiler": "6.3.2",
"@lwc/template-compiler": "6.3.2"
}
}
8 changes: 4 additions & 4 deletions packages/@lwc/engine-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
],
"name": "@lwc/engine-core",
"version": "6.3.1",
"version": "6.3.2",
"description": "Core LWC engine APIs.",
"keywords": [
"lwc"
Expand Down Expand Up @@ -42,11 +42,11 @@
}
},
"dependencies": {
"@lwc/features": "6.3.1",
"@lwc/shared": "6.3.1"
"@lwc/features": "6.3.2",
"@lwc/shared": "6.3.2"
},
"devDependencies": {
"observable-membrane": "2.0.0",
"@lwc/signals": "6.3.1"
"@lwc/signals": "6.3.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,11 @@ function warnIfInvokedDuringConstruction(vm: VM, methodOrPropName: string) {
renderer: { attachInternals },
} = vm;

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

Expand Down
5 changes: 3 additions & 2 deletions packages/@lwc/engine-core/src/framework/hydration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
import { logError, logWarn } from '../shared/logger';

import { RendererAPI } from './renderer';
import { cloneAndOmitKey, parseStyleText } from './utils';
import { cloneAndOmitKey, parseStyleText, shouldBeFormAssociated } from './utils';
import { allocateChildren, mount, removeNode } from './rendering';
import {
createVM,
Expand Down Expand Up @@ -321,7 +321,8 @@ function hydrateCustomElement(

const { sel, mode, ctor, owner } = vnode;
const { defineCustomElement, getTagName } = renderer;
defineCustomElement(StringToLowerCase.call(getTagName(elm)), Boolean(ctor.formAssociated));
const isFormAssociated = shouldBeFormAssociated(ctor);
defineCustomElement(StringToLowerCase.call(getTagName(elm)), isFormAssociated);

const vm = createVM(elm, ctor, renderer, {
mode,
Expand Down
4 changes: 3 additions & 1 deletion packages/@lwc/engine-core/src/framework/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export { parseFragment, parseSVGFragment } from './template';
export { hydrateRoot } from './hydration';

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

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

// Experimental or Internal APIs
export { getComponentConstructor } from './get-component-constructor';
Expand Down
4 changes: 2 additions & 2 deletions packages/@lwc/engine-core/src/framework/rendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
import { logError } from '../shared/logger';
import { getComponentTag } from '../shared/format';
import { RendererAPI } from './renderer';
import { EmptyArray, shouldUseNativeCustomElementLifecycle } from './utils';
import { EmptyArray, shouldBeFormAssociated, shouldUseNativeCustomElementLifecycle } from './utils';
import { markComponentAsDirty } from './component';
import { getScopeTokenClass } from './stylesheet';
import { lockDomMutation, patchElementWithRestrictions, unlockDomMutation } from './restrictions';
Expand Down Expand Up @@ -337,7 +337,7 @@ function mountCustomElement(
const useNativeLifecycle = shouldUseNativeCustomElementLifecycle(
ctor as LightningElementConstructor
);
const isFormAssociated = Boolean(ctor.formAssociated);
const isFormAssociated = shouldBeFormAssociated(ctor);
const elm = createCustomElement(
normalizedTagname,
upgradeCallback,
Expand Down
23 changes: 22 additions & 1 deletion packages/@lwc/engine-core/src/framework/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import {
isUndefined,
isNull,
} from '@lwc/shared';
import { logWarnOnce } from '../shared/logger';
import { StylesheetFactory, TemplateStylesheetFactories } from './stylesheet';
import { getComponentAPIVersion } from './component';
import { getComponentAPIVersion, getComponentRegisteredName } from './component';
import { LightningElementConstructor } from './base-lightning-element';
import { VElementData } from './vnodes';

Expand Down Expand Up @@ -157,3 +158,23 @@ export function applyTemporaryCompilerV5SlotFix(data: VElementData) {
}
return data;
}

export function shouldBeFormAssociated(Ctor: LightningElementConstructor) {
const ctorFormAssociated = Boolean(Ctor.formAssociated);
const apiVersion = getComponentAPIVersion(Ctor);
const apiFeatureEnabled = isAPIFeatureEnabled(
APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE,
apiVersion
);

if (process.env.NODE_ENV !== 'production' && ctorFormAssociated && !apiFeatureEnabled) {
const tagName = getComponentRegisteredName(Ctor);
logWarnOnce(
`Component <${tagName}> set static formAssociated to true, but form ` +
`association is not enabled because the API version is ${apiVersion}. To enable form association, ` +
`update the LWC component API version to 61 or above. https://lwc.dev/guide/versioning`
);
}

return ctorFormAssociated && apiFeatureEnabled;
}
7 changes: 3 additions & 4 deletions packages/@lwc/engine-core/src/framework/wiring/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ export function createContextProviderWithRegister(
adapter: WireAdapterConstructor,
registerContextProvider: RegisterContextProviderFn
): ContextProvider {
let adapterContextToken = AdapterToTokenMap.get(adapter);
if (!isUndefined(adapterContextToken)) {
if (AdapterToTokenMap.has(adapter)) {
throw new Error(`Adapter already has a context provider.`);
}
adapterContextToken = guid();
const adapterContextToken = guid();
AdapterToTokenMap.set(adapter, adapterContextToken);
const providers = new WeakSet<EventTarget>();

Expand All @@ -42,7 +41,7 @@ export function createContextProviderWithRegister(

registerContextProvider(
elmOrComponent,
adapterContextToken!,
adapterContextToken,
(subscriptionPayload: WireContextSubscriptionPayload) => {
const { setNewContext, setDisconnectedCallback } = subscriptionPayload;
const consumer: ContextConsumer = {
Expand Down
6 changes: 3 additions & 3 deletions packages/@lwc/engine-dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
],
"name": "@lwc/engine-dom",
"version": "6.3.1",
"version": "6.3.2",
"description": "Renders LWC components in a DOM environment.",
"keywords": [
"lwc"
Expand Down Expand Up @@ -42,8 +42,8 @@
}
},
"devDependencies": {
"@lwc/engine-core": "6.3.1",
"@lwc/shared": "6.3.1"
"@lwc/engine-core": "6.3.2",
"@lwc/shared": "6.3.2"
},
"lwc": {
"modules": [
Expand Down
3 changes: 2 additions & 1 deletion packages/@lwc/engine-dom/src/apis/create-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
disconnectRootElement,
LightningElement,
getComponentAPIVersion,
shouldBeFormAssociated,
} from '@lwc/engine-core';
import { renderer } from '../renderer';

Expand Down Expand Up @@ -135,7 +136,7 @@ export function createElement(
!lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE &&
isAPIFeatureEnabled(APIFeature.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE, apiVersion);

const isFormAssociated = Boolean(Ctor.formAssociated);
const isFormAssociated = shouldBeFormAssociated(Ctor);

// the custom element from the registry is expecting an upgrade callback
/*
Expand Down
7 changes: 3 additions & 4 deletions packages/@lwc/engine-dom/src/apis/hydrate-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
hydrateRoot,
connectRootElement,
getAssociatedVMIfPresent,
shouldBeFormAssociated,
} from '@lwc/engine-core';
import { StringToLowerCase, isFunction, isNull, isObject } from '@lwc/shared';
import { renderer } from '../renderer';
Expand Down Expand Up @@ -89,10 +90,8 @@ export function hydrateComponent(

try {
const { defineCustomElement, getTagName } = renderer;
defineCustomElement(
StringToLowerCase.call(getTagName(element)),
Boolean(Ctor.formAssociated)
);
const isFormAssociated = shouldBeFormAssociated(Ctor);
defineCustomElement(StringToLowerCase.call(getTagName(element)), isFormAssociated);
const vm = createVMWithProps(element, Ctor, props);

hydrateRoot(vm);
Expand Down
12 changes: 6 additions & 6 deletions packages/@lwc/engine-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
],
"name": "@lwc/engine-server",
"version": "6.3.1",
"version": "6.3.2",
"description": "Renders LWC components in a server environment.",
"keywords": [
"lwc"
Expand Down Expand Up @@ -42,11 +42,11 @@
}
},
"devDependencies": {
"@lwc/engine-core": "6.3.1",
"@lwc/rollup-plugin": "6.3.1",
"@lwc/shared": "6.3.1",
"@lwc/engine-core": "6.3.2",
"@lwc/rollup-plugin": "6.3.2",
"@lwc/shared": "6.3.2",
"@parse5/tools": "^0.4.0",
"@rollup/plugin-virtual": "^3.0.1",
"parse5": "^7.1.2",
"@parse5/tools": "^0.3.0"
"parse5": "^7.1.2"
}
}
2 changes: 1 addition & 1 deletion packages/@lwc/errors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
],
"name": "@lwc/errors",
"version": "6.3.1",
"version": "6.3.2",
"description": "LWC Error Utilities",
"keywords": [
"lwc"
Expand Down
4 changes: 2 additions & 2 deletions packages/@lwc/features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
],
"name": "@lwc/features",
"version": "6.3.1",
"version": "6.3.2",
"description": "LWC Features Flags",
"keywords": [
"lwc"
Expand Down Expand Up @@ -42,6 +42,6 @@
}
},
"dependencies": {
"@lwc/shared": "6.3.1"
"@lwc/shared": "6.3.2"
}
}
Loading

0 comments on commit 691b4f5

Please sign in to comment.