@lwc/template-compiler
Advanced tools
Comparing version 3.6.0 to 3.7.0
import * as t from '../shared/estree'; | ||
import { ChildNode, Element, Expression, ComplexExpression, Literal, LWCDirectiveRenderMode, Root, EventListener, RefDirective } from '../shared/types'; | ||
import { ChildNode, Expression, ComplexExpression, Literal, LWCDirectiveRenderMode, Root, EventListener, RefDirective, StaticElement } from '../shared/types'; | ||
import State from '../state'; | ||
@@ -105,3 +105,5 @@ export default class CodeGen { | ||
bindExpression(expression: Expression | Literal | ComplexExpression): t.Expression; | ||
genStaticElement(element: Element, slotParentName?: string): t.Expression; | ||
genStaticElement(element: StaticElement, slotParentName?: string): t.Expression; | ||
genStaticParts(element: StaticElement): t.ArrayExpression | undefined; | ||
genStaticPart(partId: number, databagProperties: t.Property[]): t.CallExpression; | ||
} |
@@ -1,2 +0,2 @@ | ||
import * as parse5 from 'parse5'; | ||
import { Token as parse5Tokens } from '../shared/parse5'; | ||
import { Attribute, BaseElement, SourceLocation } from '../shared/types'; | ||
@@ -8,7 +8,7 @@ import ParserCtx from './parser'; | ||
export declare function isFragmentOnlyUrl(url: string): boolean; | ||
export declare function normalizeAttributeValue(ctx: ParserCtx, raw: string, tag: string, attr: parse5.Attribute, location: SourceLocation): { | ||
export declare function normalizeAttributeValue(ctx: ParserCtx, raw: string, tag: string, attr: parse5Tokens.Attribute, location: SourceLocation): { | ||
value: string; | ||
escapedExpression: boolean; | ||
}; | ||
export declare function attributeName(attr: parse5.Attribute): string; | ||
export declare function attributeName(attr: parse5Tokens.Attribute): string; | ||
export declare function isProhibitedIsAttribute(attrName: string): boolean; | ||
@@ -15,0 +15,0 @@ export declare function isTabIndexAttribute(attrName: string): boolean; |
@@ -1,2 +0,3 @@ | ||
import { DocumentFragment, ParsingError } from 'parse5'; | ||
import { ParserError } from 'parse5'; | ||
import { DocumentFragment } from '../../shared/parse5'; | ||
import type ParserCtx from '../parser'; | ||
@@ -6,3 +7,3 @@ interface ParseFragmentConfig { | ||
sourceCodeLocationInfo: boolean; | ||
onParseError: (error: ParsingError) => void; | ||
onParseError: (err: ParserError) => void; | ||
} | ||
@@ -9,0 +10,0 @@ /** |
import type { Node as AcornNode } from 'acorn'; | ||
import type { Preprocessor as Parse5Preprocessor } from '../../shared/parse5'; | ||
export type PreparsedExpressionMap = Map<number, AcornNode>; | ||
export type Preprocessor = Omit<Parse5Preprocessor, 'pos'> & { | ||
pos: number; | ||
advance: () => void; | ||
}; |
@@ -1,5 +0,4 @@ | ||
import * as parse5 from 'parse5'; | ||
import ParserCtx from './parser'; | ||
export declare function parseHTML(ctx: ParserCtx, source: string): parse5.DocumentFragment; | ||
export declare function parseHTML(ctx: ParserCtx, source: string): import("parse5/dist/tree-adapters/default").DocumentFragment; | ||
export declare function cleanTextNode(value: string): string; | ||
export declare function decodeTextContent(source: string): string; |
@@ -1,13 +0,13 @@ | ||
import * as parse5 from 'parse5'; | ||
import { Token as parse5TokenInfo } from './parse5'; | ||
import { Literal, SourceLocation, Element, ExternalComponent, Component, Expression, ComplexExpression, Comment, Text, ForEach, ForBlock, Slot, Identifier, Root, EventListener, KeyDirective, DynamicDirective, DomDirective, PreserveCommentsDirective, RenderModeDirective, Attribute, Property, ParentNode, BaseNode, ForOf, LWCDirectiveRenderMode, If, IfBlock, ElseBlock, ElseifBlock, ElementSourceLocation, InnerHTMLDirective, BaseElement, LWCDirectiveDomMode, RefDirective, SpreadDirective, ElementDirective, RootDirective, SlotBindDirective, ScopedSlotFragment, SlotDataDirective, IsDirective, LwcComponent, LwcTagName, BaseLwcElement } from './types'; | ||
export declare function root(parse5ElmLocation: parse5.ElementLocation): Root; | ||
export declare function element(tagName: string, namespaceURI: string, parse5ElmLocation: parse5.ElementLocation): Element; | ||
export declare function externalComponent(tagName: string, parse5ElmLocation: parse5.ElementLocation): ExternalComponent; | ||
export declare function component(tagName: string, parse5ElmLocation: parse5.ElementLocation): Component; | ||
export declare function lwcComponent(tagName: LwcTagName, parse5ElmLocation: parse5.ElementLocation): LwcComponent; | ||
export declare function slot(slotName: string, parse5ElmLocation: parse5.ElementLocation): Slot; | ||
export declare function text(raw: string, value: Literal | Expression | ComplexExpression, parse5Location: parse5.Location): Text; | ||
export declare function comment(raw: string, value: string, parse5Location: parse5.Location): Comment; | ||
export declare function elementSourceLocation(parse5ElmLocation: parse5.ElementLocation): ElementSourceLocation; | ||
export declare function sourceLocation(location: parse5.Location): SourceLocation; | ||
export declare function root(parse5ElmLocation: parse5TokenInfo.ElementLocation): Root; | ||
export declare function element(tagName: string, namespaceURI: string, parse5ElmLocation: parse5TokenInfo.ElementLocation): Element; | ||
export declare function externalComponent(tagName: string, parse5ElmLocation: parse5TokenInfo.ElementLocation): ExternalComponent; | ||
export declare function component(tagName: string, parse5ElmLocation: parse5TokenInfo.ElementLocation): Component; | ||
export declare function lwcComponent(tagName: LwcTagName, parse5ElmLocation: parse5TokenInfo.ElementLocation): LwcComponent; | ||
export declare function slot(slotName: string, parse5ElmLocation: parse5TokenInfo.ElementLocation): Slot; | ||
export declare function text(raw: string, value: Literal | Expression | ComplexExpression, parse5Location: parse5TokenInfo.Location): Text; | ||
export declare function comment(raw: string, value: string, parse5Location: parse5TokenInfo.Location): Comment; | ||
export declare function elementSourceLocation(parse5ElmLocation: parse5TokenInfo.ElementLocation): ElementSourceLocation; | ||
export declare function sourceLocation(location: parse5TokenInfo.Location): SourceLocation; | ||
export declare function literal<T extends string | boolean>(value: T): Literal<T>; | ||
@@ -14,0 +14,0 @@ export declare function forEach(expression: Expression, elementLocation: SourceLocation, directiveLocation: SourceLocation, item: Identifier, index?: Identifier): ForEach; |
@@ -1,5 +0,19 @@ | ||
import * as parse5 from 'parse5'; | ||
export declare function isElementNode(node: parse5.Node): node is parse5.Element; | ||
export declare function isCommentNode(node: parse5.Node): node is parse5.CommentNode; | ||
export declare function isTextNode(node: parse5.Node): node is parse5.TextNode; | ||
export declare function getTemplateContent(templateElement: parse5.Element): parse5.DocumentFragment | undefined; | ||
import { Token } from 'parse5'; | ||
import type { DefaultTreeAdapterMap } from 'parse5'; | ||
import type { Tokenizer } from 'parse5'; | ||
export type Preprocessor = Tokenizer['preprocessor']; | ||
export type ElementLocation = Token.ElementLocation; | ||
export type ChildNode = DefaultTreeAdapterMap['childNode']; | ||
export type CommentNode = DefaultTreeAdapterMap['commentNode']; | ||
export type Document = DefaultTreeAdapterMap['document']; | ||
export type DocumentFragment = DefaultTreeAdapterMap['documentFragment']; | ||
export type Element = DefaultTreeAdapterMap['element']; | ||
export type Node = DefaultTreeAdapterMap['node']; | ||
export type Template = DefaultTreeAdapterMap['template']; | ||
export type TextNode = DefaultTreeAdapterMap['textNode']; | ||
export { Token }; | ||
export declare function isElementNode(node: Node | null): node is Element; | ||
export declare function isCommentNode(node: Node): node is CommentNode; | ||
export declare function isTextNode(node: Node): node is TextNode; | ||
export declare function isTemplateNode(node: Node): node is Template; | ||
export declare function getTemplateContent(templateElement: Element | Template): DocumentFragment | undefined; |
@@ -131,2 +131,5 @@ import { CompilerDiagnostic } from '@lwc/errors'; | ||
} | ||
export interface StaticElement extends Element { | ||
children: (StaticElement | Text)[]; | ||
} | ||
export interface ExternalComponent extends AbstractBaseElement { | ||
@@ -133,0 +136,0 @@ type: 'ExternalComponent'; |
@@ -7,3 +7,3 @@ { | ||
"name": "@lwc/template-compiler", | ||
"version": "3.6.0", | ||
"version": "3.7.0", | ||
"description": "Template compiler package", | ||
@@ -46,9 +46,8 @@ "keywords": [ | ||
"dependencies": { | ||
"@lwc/errors": "3.6.0", | ||
"@lwc/shared": "3.6.0", | ||
"@lwc/errors": "3.7.0", | ||
"@lwc/shared": "3.7.0", | ||
"acorn": "~8.10.0", | ||
"astring": "~1.8.6", | ||
"estree-walker": "~2.0.2", | ||
"he": "~1.2.0", | ||
"parse5": "~6.0.1" | ||
"he": "~1.2.0" | ||
}, | ||
@@ -58,5 +57,5 @@ "devDependencies": { | ||
"@types/he": "^1.2.1", | ||
"@types/parse5": "^6.0.2", | ||
"@types/source-map": "0.5.7" | ||
"@types/source-map": "0.5.7", | ||
"parse5": "~7.1.2" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Obfuscated code
Supply chain riskObfuscated files are intentionally packed to hide their behavior. This could be a sign of malware.
Found 1 instance in 1 package
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2868079
6
28939
1
4
+ Added@lwc/errors@3.7.0(transitive)
+ Added@lwc/shared@3.7.0(transitive)
- Removedparse5@~6.0.1
- Removed@lwc/errors@3.6.0(transitive)
- Removed@lwc/shared@3.6.0(transitive)
- Removedparse5@6.0.1(transitive)
Updated@lwc/errors@3.7.0
Updated@lwc/shared@3.7.0