Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .nucleus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ branches:
- MobilePlatform/lsdk-modules
- MobilePlatform/lwr-lightning-platform
- MobilePlatform/ui-fsm-components
- Skilling-and-Enablement/ui-external-enablement
- automation-platform/ui-externalservices-builder-components
- communities/microsite-template-marketing
- communities/shared-experience-components
Expand All @@ -26,7 +25,9 @@ branches:
- salesforce-experience-platform-emu/lwr-everywhere
- salesforce-experience-platform-emu/lwr-recipes
- salesforce/lwc-test
- salesforce/o11y-sample-app
# Using old major versions; tests in PRs will always fail
# - salesforce/o11y-sample-app
# - Skilling-and-Enablement/ui-external-enablement
release:
pull-request:
<<: *branch-definition
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lwc-monorepo",
"version": "8.14.0",
"version": "8.15.0",
"private": true,
"description": "Lightning Web Components",
"repository": {
Expand Down Expand Up @@ -59,7 +59,7 @@
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.31.0",
"glob": "^11.0.1",
"globals": "^15.15.0",
"globals": "^16.0.0",
"husky": "^9.1.7",
"isbinaryfile": "^5.0.4",
"jsdom": "^26.0.0",
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": "8.14.0",
"version": "8.15.0",
"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": "8.14.0",
"version": "8.15.0",
"description": "Babel plugin to transform a LWC module",
"keywords": [
"lwc"
Expand Down Expand Up @@ -47,8 +47,8 @@
},
"dependencies": {
"@babel/helper-module-imports": "7.25.9",
"@lwc/errors": "8.14.0",
"@lwc/shared": "8.14.0",
"@lwc/errors": "8.15.0",
"@lwc/shared": "8.15.0",
"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": "8.14.0",
"version": "8.15.0",
"description": "LWC compiler",
"keywords": [
"lwc"
Expand Down Expand Up @@ -52,11 +52,11 @@
"@babel/plugin-transform-class-properties": "7.25.9",
"@babel/plugin-transform-object-rest-spread": "7.25.9",
"@locker/babel-plugin-transform-unforgeables": "0.22.0",
"@lwc/babel-plugin-component": "8.14.0",
"@lwc/errors": "8.14.0",
"@lwc/shared": "8.14.0",
"@lwc/ssr-compiler": "8.14.0",
"@lwc/style-compiler": "8.14.0",
"@lwc/template-compiler": "8.14.0"
"@lwc/babel-plugin-component": "8.15.0",
"@lwc/errors": "8.15.0",
"@lwc/shared": "8.15.0",
"@lwc/ssr-compiler": "8.15.0",
"@lwc/style-compiler": "8.15.0",
"@lwc/template-compiler": "8.15.0"
}
}
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": "8.14.0",
"version": "8.15.0",
"description": "Core LWC engine APIs.",
"keywords": [
"lwc"
Expand Down Expand Up @@ -46,9 +46,9 @@
}
},
"dependencies": {
"@lwc/features": "8.14.0",
"@lwc/shared": "8.14.0",
"@lwc/signals": "8.14.0"
"@lwc/features": "8.15.0",
"@lwc/shared": "8.15.0",
"@lwc/signals": "8.15.0"
},
"devDependencies": {
"observable-membrane": "2.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ export function checkVersionMismatch(
) {
const versionMatcher = func.toString().match(LWC_VERSION_COMMENT_REGEX);
if (!isNull(versionMatcher) && !warned) {
if (process.env.SKIP_LWC_VERSION_MISMATCH_CHECK === 'true') {
warned = true; // skip printing out version mismatch errors when env var is set
return;
}

const version = versionMatcher[1];
if (version !== LWC_VERSION) {
warned = true; // only warn once to avoid flooding the console
Expand Down
10 changes: 9 additions & 1 deletion packages/@lwc/engine-core/src/framework/rendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { logError } from '../shared/logger';
import { getComponentTag } from '../shared/format';
import { EmptyArray, shouldBeFormAssociated } from './utils';
import { markComponentAsDirty } from './component';
import { getScopeTokenClass } from './stylesheet';
import { getScopeTokenClass, isValidScopeToken } from './stylesheet';
import { lockDomMutation, patchElementWithRestrictions, unlockDomMutation } from './restrictions';
import {
appendVM,
Expand Down Expand Up @@ -605,6 +605,10 @@ function applyStyleScoping(elm: Element, owner: VM, renderer: RendererAPI) {
// Set the class name for `*.scoped.css` style scoping.
const scopeToken = getScopeTokenClass(owner, /* legacy */ false);
if (!isNull(scopeToken)) {
if (!isValidScopeToken(scopeToken)) {
// See W-16614556
throw new Error('stylesheet token must be a valid string');
}
// TODO [#2762]: this dot notation with add is probably problematic
// probably we should have a renderer api for just the add operation
getClassList(elm).add(scopeToken);
Expand All @@ -614,6 +618,10 @@ function applyStyleScoping(elm: Element, owner: VM, renderer: RendererAPI) {
if (lwcRuntimeFlags.ENABLE_LEGACY_SCOPE_TOKENS) {
const legacyScopeToken = getScopeTokenClass(owner, /* legacy */ true);
if (!isNull(legacyScopeToken)) {
if (!isValidScopeToken(legacyScopeToken)) {
// See W-16614556
throw new Error('stylesheet token must be a valid string');
}
// TODO [#2762]: this dot notation with add is probably problematic
// probably we should have a renderer api for just the add operation
getClassList(elm).add(legacyScopeToken);
Expand Down
12 changes: 12 additions & 0 deletions packages/@lwc/engine-core/src/framework/stylesheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
ArrayPush,
isArray,
isNull,
isString,
isTrue,
isUndefined,
KEY__NATIVE_ONLY_CSS,
Expand All @@ -29,6 +30,8 @@ import type { Template } from './template';
import type { VM } from './vm';
import type { Stylesheet, Stylesheets } from '@lwc/shared';

const VALID_SCOPE_TOKEN_REGEX = /^[a-zA-Z0-9\-_]+$/;

// These are only used for HMR in dev mode
// The "pure" annotations are so that Rollup knows for sure it can remove these from prod mode
let stylesheetsToCssContent: WeakMap<Stylesheet, Set<string>> = /*@__PURE__@*/ new WeakMap();
Expand Down Expand Up @@ -394,3 +397,12 @@ export function unrenderStylesheet(stylesheet: Stylesheet) {
cssContentToAbortControllers.delete(cssContent);
}
}

export function isValidScopeToken(token: unknown) {
if (!isString(token)) {
return false;
}

// See W-16614556
return lwcRuntimeFlags.DISABLE_SCOPE_TOKEN_VALIDATION || VALID_SCOPE_TOKEN_REGEX.test(token);
}
16 changes: 7 additions & 9 deletions packages/@lwc/engine-core/src/framework/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ import api from './api';
import { RenderMode, resetComponentRoot, runWithBoundaryProtection, ShadowMode } from './vm';
import { assertNotProd, EmptyObject } from './utils';
import { defaultEmptyTemplate, isTemplateRegistered } from './secure-template';
import { createStylesheet, getStylesheetsContent, updateStylesheetToken } from './stylesheet';
import {
createStylesheet,
getStylesheetsContent,
isValidScopeToken,
updateStylesheetToken,
} from './stylesheet';
import { logOperationEnd, logOperationStart, OperationId } from './profiler';
import { getTemplateOrSwappedTemplate, setActiveVM } from './hot-swaps';
import { getMapFromClassName } from './modules/computed-class-attr';
Expand Down Expand Up @@ -66,14 +71,6 @@ export function setVMBeingRendered(vm: VM | null) {
vmBeingRendered = vm;
}

const VALID_SCOPE_TOKEN_REGEX = /^[a-zA-Z0-9\-_]+$/;

// See W-16614556
// TODO [#2826]: freeze the template object
function isValidScopeToken(token: any) {
return isString(token) && VALID_SCOPE_TOKEN_REGEX.test(token);
}

function validateSlots(vm: VM) {
assertNotProd(); // this method should never leak to prod

Expand Down Expand Up @@ -274,6 +271,7 @@ function buildParseFragmentFn(
}

// See W-16614556
// TODO [#2826]: freeze the template object
if (
(hasStyleToken && !isValidScopeToken(stylesheetToken)) ||
(hasLegacyToken && !isValidScopeToken(legacyStylesheetToken))
Expand Down
8 changes: 4 additions & 4 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": "8.14.0",
"version": "8.15.0",
"description": "Renders LWC components in a DOM environment.",
"keywords": [
"lwc"
Expand Down Expand Up @@ -46,9 +46,9 @@
}
},
"devDependencies": {
"@lwc/engine-core": "8.14.0",
"@lwc/shared": "8.14.0",
"@lwc/features": "8.14.0"
"@lwc/engine-core": "8.15.0",
"@lwc/shared": "8.15.0",
"@lwc/features": "8.15.0"
},
"lwc": {
"modules": [
Expand Down
10 changes: 5 additions & 5 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": "8.14.0",
"version": "8.15.0",
"description": "Renders LWC components in a server environment.",
"keywords": [
"lwc"
Expand Down Expand Up @@ -46,10 +46,10 @@
}
},
"devDependencies": {
"@lwc/engine-core": "8.14.0",
"@lwc/rollup-plugin": "8.14.0",
"@lwc/shared": "8.14.0",
"@lwc/features": "8.14.0",
"@lwc/engine-core": "8.15.0",
"@lwc/rollup-plugin": "8.15.0",
"@lwc/shared": "8.15.0",
"@lwc/features": "8.15.0",
"@rollup/plugin-virtual": "^3.0.2",
"parse5": "^7.2.1"
}
Expand Down
9 changes: 9 additions & 0 deletions packages/@lwc/engine-server/src/__tests__/fixtures.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,13 @@ function testFixtures(options?: RollupLwcOptions) {
let result;
let err;
try {
config?.features?.forEach((flag) => {
lwcEngineServer.setFeatureFlagForTest(flag, true);
});

const module: LightningElementConstructor = (await import(compiledFixturePath))
.default;

result = formatHTML(
lwcEngineServer.renderComponent('fixture-test', module, config?.props ?? {})
);
Expand All @@ -144,6 +149,10 @@ function testFixtures(options?: RollupLwcOptions) {
err = _err?.message || 'An empty error occurred?!';
}

config?.features?.forEach((flag) => {
lwcEngineServer.setFeatureFlagForTest(flag, false);
});

return {
'expected.html': result,
'error.txt': err,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<fixture-test>
<template shadowrootmode="open">
<x-child accesskey="foo" aria-activedescendant="foo" aria-atomic="foo" aria-autocomplete="foo" aria-busy="foo" aria-checked="foo" aria-colcount="foo" aria-colindex="foo" aria-colspan="foo" aria-controls="foo" aria-current="foo" aria-describedby="foo" aria-details="foo" aria-disabled="foo" aria-errormessage="foo" aria-expanded="foo" aria-flowto="foo" aria-haspopup="foo" aria-hidden="foo" aria-invalid="foo" aria-keyshortcuts="foo" aria-label="foo" aria-labelledby="foo" aria-level="foo" aria-live="foo" aria-modal="foo" aria-multiline="foo" aria-multiselectable="foo" aria-orientation="foo" aria-owns="foo" aria-placeholder="foo" aria-posinset="foo" aria-pressed="foo" aria-readonly="foo" aria-relevant="foo" aria-required="foo" aria-roledescription="foo" aria-rowcount="foo" aria-rowindex="foo" aria-rowspan="foo" aria-selected="foo" aria-setsize="foo" aria-sort="foo" aria-valuemax="foo" aria-valuemin="foo" aria-valuenow="foo" aria-valuetext="foo" dir="foo" draggable="foo" exportparts="foo" id="foo" lang="foo" role="foo" spellcheck="foo" tabindex="foo" title="foo">
<x-child accesskey="foo" aria-activedescendant="foo" aria-atomic="foo" aria-autocomplete="foo" aria-busy="foo" aria-checked="foo" aria-colcount="foo" aria-colindex="foo" aria-colspan="foo" aria-controls="foo" aria-current="foo" aria-describedby="foo" aria-details="foo" aria-disabled="foo" aria-errormessage="foo" aria-expanded="foo" aria-flowto="foo" aria-haspopup="foo" aria-hidden="foo" aria-invalid="foo" aria-keyshortcuts="foo" aria-label="foo" aria-labelledby="foo" aria-level="foo" aria-live="foo" aria-modal="foo" aria-multiline="foo" aria-multiselectable="foo" aria-orientation="foo" aria-owns="foo" aria-placeholder="foo" aria-posinset="foo" aria-pressed="foo" aria-readonly="foo" aria-relevant="foo" aria-required="foo" aria-roledescription="foo" aria-rowcount="foo" aria-rowindex="foo" aria-rowspan="foo" aria-selected="foo" aria-setsize="foo" aria-sort="foo" aria-valuemax="foo" aria-valuemin="foo" aria-valuenow="foo" aria-valuetext="foo" dir="foo" exportparts="foo" id="foo" lang="foo" role="foo" title="foo">
<template shadowrootmode="open">
<span>
accessKey: foo
Expand Down Expand Up @@ -56,9 +56,6 @@
<span>
ariaHasPopup: foo
</span>
<span>
ariaHidden: foo
</span>
<span>
ariaInvalid: foo
</span>
Expand Down Expand Up @@ -191,9 +188,6 @@
<span>
disabled:
</span>
<span>
draggable: false
</span>
<span>
enterkeyhint:
</span>
Expand Down Expand Up @@ -305,12 +299,6 @@
<span>
selected:
</span>
<span>
spellcheck: true
</span>
<span>
tabIndex: -1
</span>
<span>
textarea:
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<span>ariaExpanded: {ariaExpanded}</span>
<span>ariaFlowTo: {ariaFlowTo}</span>
<span>ariaHasPopup: {ariaHasPopup}</span>
<span>ariaHidden: {ariaHidden}</span>
<span>ariaInvalid: {ariaInvalid}</span>
<span>ariaKeyShortcuts: {ariaKeyShortcuts}</span>
<span>ariaLabel: {ariaLabel}</span>
Expand Down Expand Up @@ -62,7 +61,6 @@
<span>details: {details}</span>
<span>dir: {dir}</span>
<span>disabled: {disabled}</span>
<span>draggable: {draggable}</span>
<span>enterkeyhint: {enterkeyhint}</span>
<span>exportparts: {exportparts}</span>
<span>fieldset: {fieldset}</span>
Expand Down Expand Up @@ -100,11 +98,9 @@
<span>rowSpan: {rowSpan}</span>
<span>select: {select}</span>
<span>selected: {selected}</span>
<span>spellcheck: {spellcheck}</span>
<span>tabIndex: {tabIndex}</span>
<span>textarea: {textarea}</span>
<span>title: {title}</span>
<span>translate: {translate}</span>
<span>useMap: {useMap}</span>
<span>video: {video}</span>
</template>
</template>
Loading