Skip to content

Commit

Permalink
chore: remove unused code (#2594)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmdartus authored Dec 7, 2021
1 parent 8138681 commit 43bad75
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 37 deletions.
31 changes: 8 additions & 23 deletions packages/@lwc/engine-core/src/3rdparty/snabbdom/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@

import { VM } from '../../framework/vm';

export type VNodeStyleDecls = Array<[string, string, boolean]>;
export interface On {
[event: string]: EventListener;
}
export type Attrs = Record<string, string | number | boolean>;
export type Classes = Record<string, boolean>;
export type Props = Record<string, any>;

export type Key = string | number;

export type VNodes = Array<VNode | null>;
Expand Down Expand Up @@ -70,17 +62,15 @@ export interface VComment extends VNode {
key: undefined;
}

export type CustomElementContext = Record<string, Record<string, any>>;

export interface VNodeData {
props?: Props;
attrs?: Attrs;
className?: any;
style?: any;
classMap?: Classes;
styleDecls?: VNodeStyleDecls;
context?: CustomElementContext;
on?: On;
props?: Record<string, any>;
attrs?: Record<string, string | number | boolean>;
className?: string;
style?: string;
classMap?: Record<string, boolean>;
styleDecls?: Array<[string, string, boolean]>;
context?: Record<string, Record<string, any>>;
on?: Record<string, Function>;
svg?: boolean;
}

Expand All @@ -96,8 +86,3 @@ export interface Hooks<N extends VNode> {
remove: (vNode: N, parentNode: Node) => void;
hydrate: (vNode: N, node: Node) => void;
}

export interface Module<N extends VNode> {
create?: (vNode: N) => void;
update?: (oldVNode: N, vNode: N) => void;
}
2 changes: 1 addition & 1 deletion packages/@lwc/engine-core/src/framework/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export function evaluateTemplate(vm: VM, html: Template): Array<VNode | null> {
return vnodes;
}

export function computeHasScopedStyles(template: Template): boolean {
function computeHasScopedStyles(template: Template): boolean {
const { stylesheets } = template;
if (!isUndefined(stylesheets)) {
for (let i = 0; i < stylesheets.length; i++) {
Expand Down
6 changes: 1 addition & 5 deletions packages/@lwc/style-compiler/src/postcss-lwc-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ function selectorProcessorFactory(transformConfig: SelectorScopingConfig) {
});
}

export interface PostCssLwcPluginOptions {
scoped: boolean;
}

export default function postCssLwcPlugin(options: PostCssLwcPluginOptions): TransformCallback {
export default function postCssLwcPlugin(options: { scoped: boolean }): TransformCallback {
// We need 2 types of selectors processors, since transforming the :host selector make the selector
// unusable when used in the context of the native shadow and vice-versa.
const nativeShadowSelectorProcessor = selectorProcessorFactory({
Expand Down
8 changes: 0 additions & 8 deletions packages/@lwc/synthetic-shadow/src/shared/node-ownership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,3 @@ export function getNodeKey(node: Node): number | undefined {
export function isNodeShadowed(node: Node): boolean {
return !isUndefined(getNodeOwnerKey(node));
}

/**
* This function verifies if a node (with or without owner key) is contained in a shadow root.
* Use with care since has high computational cost.
*/
export function isNodeDeepShadowed(node: Node): boolean {
return !isUndefined(getNodeNearestOwnerKey(node));
}

0 comments on commit 43bad75

Please sign in to comment.