Skip to content

Commit 9433efd

Browse files
authored
chore: remove dead code (#5435)
* chore: remove dead code getStylesheetTokenHost was removed in #4865 * chore: exporting isn't necessary
1 parent 5cdefeb commit 9433efd

File tree

2 files changed

+4
-21
lines changed

2 files changed

+4
-21
lines changed

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

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, salesforce.com, inc.
2+
* Copyright (c) 2025, Salesforce, Inc.
33
* All rights reserved.
44
* SPDX-License-Identifier: MIT
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -20,12 +20,11 @@ import { logError } from '../shared/logger';
2020

2121
import api from './api';
2222
import { RenderMode, ShadowMode } from './vm';
23-
import { computeHasScopedStyles, hasStyles } from './template';
23+
import { hasStyles } from './template';
2424
import { getStyleOrSwappedStyle } from './hot-swaps';
2525
import { checkVersionMismatch } from './check-version-mismatch';
26-
import { getComponentInternalDef } from './def';
2726
import { assertNotProd, EmptyArray } from './utils';
28-
import type { VCustomElement, VNode } from './vnodes';
27+
import type { VNode } from './vnodes';
2928
import type { Template } from './template';
3029
import type { VM } from './vm';
3130
import type { Stylesheet, Stylesheets } from '@lwc/shared';
@@ -321,22 +320,6 @@ export function getScopeTokenClass(owner: VM, legacy: boolean): string | null {
321320
);
322321
}
323322

324-
/**
325-
* This function returns the host style token for a custom element if it
326-
* exists. Otherwise it returns null.
327-
*
328-
* A host style token is applied to the component if scoped styles are used.
329-
* @param vnode
330-
*/
331-
export function getStylesheetTokenHost(vnode: VCustomElement): string | null {
332-
const { template } = getComponentInternalDef(vnode.ctor);
333-
const { vm } = vnode;
334-
const { stylesheetToken } = template;
335-
return !isUndefined(stylesheetToken) && computeHasScopedStyles(template, vm)
336-
? makeHostToken(stylesheetToken)
337-
: null;
338-
}
339-
340323
function getNearestNativeShadowComponent(vm: VM): VM | null {
341324
const owner = getNearestShadowComponent(vm);
342325
if (!isNull(owner) && owner.shadowMode === ShadowMode.Synthetic) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ function computeHasScopedStylesInStylesheets(stylesheets: Stylesheets | undefine
471471
return false;
472472
}
473473

474-
export function computeHasScopedStyles(template: Template, vm: VM | undefined): boolean {
474+
function computeHasScopedStyles(template: Template, vm: VM | undefined): boolean {
475475
const { stylesheets } = template;
476476
const vmStylesheets = !isUndefined(vm) ? vm.stylesheets : null;
477477

0 commit comments

Comments
 (0)