@lwc/template-compiler 8.28.1 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -2
- package/dist/index.js +39 -45
- package/dist/shared/types.d.ts +39 -36
- package/package.json +8 -4
- package/dist/index.cjs.js +0 -14583
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Config } from './config';
|
|
2
2
|
import type { TemplateCompileResult, TemplateParseResult } from './shared/types';
|
|
3
3
|
export * from './shared/types';
|
|
4
|
-
export { CustomRendererConfig, CustomRendererElementConfig } from './shared/renderer-hooks';
|
|
5
|
-
export { Config } from './config';
|
|
4
|
+
export type { CustomRendererConfig, CustomRendererElementConfig } from './shared/renderer-hooks';
|
|
5
|
+
export type { Config } from './config';
|
|
6
6
|
export { toPropertyName } from './shared/utils';
|
|
7
7
|
export { kebabcaseToCamelcase } from './shared/naming';
|
|
8
8
|
export { generateScopeTokens } from './scopeTokens';
|
package/dist/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright (c) 2026 Salesforce, Inc.
|
|
3
3
|
*/
|
|
4
4
|
import { invariant, TemplateErrors, generateCompilerError, CompilerError, normalizeToDiagnostic, generateCompilerDiagnostic, ParserDiagnostics, DiagnosticLevel, CompilerMetrics } from '@lwc/errors';
|
|
5
|
-
import path from 'path';
|
|
5
|
+
import path from 'node:path';
|
|
6
6
|
import { StringCharAt, hasOwnProperty, getAPIVersionFromNumber, HTML_NAMESPACE, AriaAttrNameToPropNameMap, fromEntries, ArrayFrom, SPECIAL_PROPERTY_ATTRIBUTE_MAPPING, isAPIFeatureEnabled, minApiVersion, ID_REFERENCING_ATTRIBUTES_SET, SVG_NAMESPACE, isBooleanAttribute, isGlobalHtmlAttribute, isAriaAttribute, isVoidElement, MATHML_NAMESPACE, isNull, isUndefined, IMPORTANT_FLAG, isArray, ArrayEvery, ArraySome, normalizeStyleAttributeValue, htmlEscape, parseStyleText, LWC_VERSION_COMMENT } from '@lwc/shared';
|
|
7
|
-
import
|
|
7
|
+
import he from 'he';
|
|
8
8
|
import { parseExpressionAt, isIdentifierStart, isIdentifierChar } from 'acorn';
|
|
9
9
|
import * as astring from 'astring';
|
|
10
10
|
|
|
@@ -9243,52 +9243,46 @@ function isAttribute$1(node) {
|
|
|
9243
9243
|
return node.type === 'Attribute';
|
|
9244
9244
|
}
|
|
9245
9245
|
|
|
9246
|
-
|
|
9247
|
-
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
LWCDirectiveRenderMode["light"] = "light";
|
|
9254
|
-
})(LWCDirectiveRenderMode || (LWCDirectiveRenderMode = {}));
|
|
9246
|
+
const LWCDirectiveDomMode = {
|
|
9247
|
+
manual: 'manual',
|
|
9248
|
+
};
|
|
9249
|
+
const LWCDirectiveRenderMode = {
|
|
9250
|
+
shadow: 'shadow',
|
|
9251
|
+
light: 'light',
|
|
9252
|
+
};
|
|
9255
9253
|
/**
|
|
9256
9254
|
* All supported special LWC tags, they should all begin with lwc:*
|
|
9257
9255
|
*/
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
9267
|
-
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
|
|
9271
|
-
|
|
9272
|
-
var ElementDirectiveName;
|
|
9273
|
-
(function (ElementDirectiveName) {
|
|
9274
|
-
ElementDirectiveName["Dom"] = "lwc:dom";
|
|
9256
|
+
const LwcTagName = {
|
|
9257
|
+
Component: 'lwc:component',
|
|
9258
|
+
};
|
|
9259
|
+
const TemplateDirectiveName = {
|
|
9260
|
+
If: 'if:true',
|
|
9261
|
+
IfBlock: 'lwc:if',
|
|
9262
|
+
ElseifBlock: 'lwc:elseif',
|
|
9263
|
+
ElseBlock: 'lwc:else',
|
|
9264
|
+
ForEach: 'for:each',
|
|
9265
|
+
ForOf: 'for:of',
|
|
9266
|
+
ScopedSlotFragment: 'lwc:slot-data',
|
|
9267
|
+
};
|
|
9268
|
+
const ElementDirectiveName = {
|
|
9269
|
+
Dom: 'lwc:dom',
|
|
9275
9270
|
// TODO [#3331]: remove usage of lwc:dynamic in 246
|
|
9276
|
-
|
|
9277
|
-
|
|
9278
|
-
|
|
9279
|
-
|
|
9280
|
-
|
|
9281
|
-
|
|
9282
|
-
|
|
9283
|
-
|
|
9284
|
-
|
|
9285
|
-
|
|
9286
|
-
}
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
})(RootDirectiveName || (RootDirectiveName = {}));
|
|
9271
|
+
Dynamic: 'lwc:dynamic',
|
|
9272
|
+
Is: 'lwc:is',
|
|
9273
|
+
External: 'lwc:external',
|
|
9274
|
+
InnerHTML: 'lwc:inner-html',
|
|
9275
|
+
Ref: 'lwc:ref',
|
|
9276
|
+
SlotBind: 'lwc:slot-bind',
|
|
9277
|
+
SlotData: 'lwc:slot-data',
|
|
9278
|
+
Spread: 'lwc:spread',
|
|
9279
|
+
On: 'lwc:on',
|
|
9280
|
+
Key: 'key',
|
|
9281
|
+
};
|
|
9282
|
+
const RootDirectiveName = {
|
|
9283
|
+
PreserveComments: 'lwc:preserve-comments',
|
|
9284
|
+
RenderMode: 'lwc:render-mode',
|
|
9285
|
+
};
|
|
9292
9286
|
|
|
9293
9287
|
/*
|
|
9294
9288
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -14549,5 +14543,5 @@ function compile(source, filename, config) {
|
|
|
14549
14543
|
}
|
|
14550
14544
|
|
|
14551
14545
|
export { ElementDirectiveName, LWCDirectiveDomMode, LWCDirectiveRenderMode, LwcTagName, RootDirectiveName, TemplateDirectiveName, bindExpression, compile, compile as default, generateScopeTokens, kebabcaseToCamelcase, parse, toPropertyName };
|
|
14552
|
-
/** version:
|
|
14546
|
+
/** version: 9.0.0 */
|
|
14553
14547
|
//# sourceMappingURL=index.js.map
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -8,13 +8,15 @@ export interface TemplateCompileResult extends TemplateParseResult {
|
|
|
8
8
|
code: string;
|
|
9
9
|
cssScopeTokens: string[];
|
|
10
10
|
}
|
|
11
|
-
export declare
|
|
12
|
-
manual
|
|
13
|
-
}
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
export declare const LWCDirectiveDomMode: {
|
|
12
|
+
readonly manual: "manual";
|
|
13
|
+
};
|
|
14
|
+
export type LWCDirectiveDomMode = (typeof LWCDirectiveDomMode)[keyof typeof LWCDirectiveDomMode];
|
|
15
|
+
export declare const LWCDirectiveRenderMode: {
|
|
16
|
+
readonly shadow: "shadow";
|
|
17
|
+
readonly light: "light";
|
|
18
|
+
};
|
|
19
|
+
export type LWCDirectiveRenderMode = (typeof LWCDirectiveRenderMode)[keyof typeof LWCDirectiveRenderMode];
|
|
18
20
|
export interface BaseNode {
|
|
19
21
|
type: string;
|
|
20
22
|
location: SourceLocation;
|
|
@@ -159,24 +161,25 @@ export interface LwcComponent extends BaseLwcElement<'lwc:component'> {
|
|
|
159
161
|
/**
|
|
160
162
|
* All supported special LWC tags, they should all begin with lwc:*
|
|
161
163
|
*/
|
|
162
|
-
export declare
|
|
163
|
-
Component
|
|
164
|
-
}
|
|
164
|
+
export declare const LwcTagName: {
|
|
165
|
+
readonly Component: "lwc:component";
|
|
166
|
+
};
|
|
167
|
+
export type LwcTagName = (typeof LwcTagName)[keyof typeof LwcTagName];
|
|
165
168
|
export type BaseElement = Element | ExternalComponent | Component | Slot | LwcComponent;
|
|
166
169
|
export interface Root extends BaseParentNode {
|
|
167
170
|
type: 'Root';
|
|
168
171
|
location: ElementSourceLocation;
|
|
169
172
|
directives: RootDirective[];
|
|
170
173
|
}
|
|
171
|
-
export declare
|
|
172
|
-
If
|
|
173
|
-
IfBlock
|
|
174
|
-
ElseifBlock
|
|
175
|
-
ElseBlock
|
|
176
|
-
ForEach
|
|
177
|
-
ForOf
|
|
178
|
-
ScopedSlotFragment
|
|
179
|
-
}
|
|
174
|
+
export declare const TemplateDirectiveName: {
|
|
175
|
+
readonly If: "if:true";
|
|
176
|
+
readonly IfBlock: "lwc:if";
|
|
177
|
+
readonly ElseifBlock: "lwc:elseif";
|
|
178
|
+
readonly ElseBlock: "lwc:else";
|
|
179
|
+
readonly ForEach: "for:each";
|
|
180
|
+
readonly ForOf: "for:of";
|
|
181
|
+
readonly ScopedSlotFragment: "lwc:slot-data";
|
|
182
|
+
};
|
|
180
183
|
interface DirectiveParentNode<T extends keyof typeof TemplateDirectiveName> extends BaseParentNode {
|
|
181
184
|
directiveLocation: SourceLocation;
|
|
182
185
|
type: T;
|
|
@@ -227,22 +230,22 @@ export type ForBlock = ForEach | ForOf;
|
|
|
227
230
|
export type ParentNode = Root | ForBlock | If | IfBlock | ElseifBlock | ElseBlock | BaseElement | ScopedSlotFragment;
|
|
228
231
|
export type ChildNode = ForBlock | If | IfBlock | ElseifBlock | ElseBlock | BaseElement | Comment | Text | ScopedSlotFragment;
|
|
229
232
|
export type Node = Root | ForBlock | If | IfBlock | ElseifBlock | ElseBlock | BaseElement | Comment | Text | ScopedSlotFragment;
|
|
230
|
-
export declare
|
|
231
|
-
Dom
|
|
232
|
-
Dynamic
|
|
233
|
-
Is
|
|
234
|
-
External
|
|
235
|
-
InnerHTML
|
|
236
|
-
Ref
|
|
237
|
-
SlotBind
|
|
238
|
-
SlotData
|
|
239
|
-
Spread
|
|
240
|
-
On
|
|
241
|
-
Key
|
|
242
|
-
}
|
|
243
|
-
export declare
|
|
244
|
-
PreserveComments
|
|
245
|
-
RenderMode
|
|
246
|
-
}
|
|
233
|
+
export declare const ElementDirectiveName: {
|
|
234
|
+
readonly Dom: "lwc:dom";
|
|
235
|
+
readonly Dynamic: "lwc:dynamic";
|
|
236
|
+
readonly Is: "lwc:is";
|
|
237
|
+
readonly External: "lwc:external";
|
|
238
|
+
readonly InnerHTML: "lwc:inner-html";
|
|
239
|
+
readonly Ref: "lwc:ref";
|
|
240
|
+
readonly SlotBind: "lwc:slot-bind";
|
|
241
|
+
readonly SlotData: "lwc:slot-data";
|
|
242
|
+
readonly Spread: "lwc:spread";
|
|
243
|
+
readonly On: "lwc:on";
|
|
244
|
+
readonly Key: "key";
|
|
245
|
+
};
|
|
246
|
+
export declare const RootDirectiveName: {
|
|
247
|
+
readonly PreserveComments: "lwc:preserve-comments";
|
|
248
|
+
readonly RenderMode: "lwc:render-mode";
|
|
249
|
+
};
|
|
247
250
|
export {};
|
|
248
251
|
//# sourceMappingURL=types.d.ts.map
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
|
|
5
5
|
],
|
|
6
6
|
"name": "@lwc/template-compiler",
|
|
7
|
-
"version": "
|
|
7
|
+
"version": "9.0.0",
|
|
8
8
|
"description": "Template compiler package",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"lwc"
|
|
@@ -19,13 +19,17 @@
|
|
|
19
19
|
"url": "https://github.com/salesforce/lwc/issues"
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
|
22
|
+
"type": "module",
|
|
22
23
|
"publishConfig": {
|
|
23
24
|
"access": "public"
|
|
24
25
|
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=16.6.0"
|
|
28
|
+
},
|
|
25
29
|
"volta": {
|
|
26
30
|
"extends": "../../../package.json"
|
|
27
31
|
},
|
|
28
|
-
"main": "dist/index.
|
|
32
|
+
"main": "dist/index.js",
|
|
29
33
|
"module": "dist/index.js",
|
|
30
34
|
"types": "dist/index.d.ts",
|
|
31
35
|
"files": [
|
|
@@ -46,8 +50,8 @@
|
|
|
46
50
|
}
|
|
47
51
|
},
|
|
48
52
|
"dependencies": {
|
|
49
|
-
"@lwc/errors": "
|
|
50
|
-
"@lwc/shared": "
|
|
53
|
+
"@lwc/errors": "9.0.0",
|
|
54
|
+
"@lwc/shared": "9.0.0",
|
|
51
55
|
"acorn": "~8.15.0",
|
|
52
56
|
"astring": "~1.9.0",
|
|
53
57
|
"he": "~1.2.0"
|