@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 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 * as he from 'he';
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
- var LWCDirectiveDomMode;
9247
- (function (LWCDirectiveDomMode) {
9248
- LWCDirectiveDomMode["manual"] = "manual";
9249
- })(LWCDirectiveDomMode || (LWCDirectiveDomMode = {}));
9250
- var LWCDirectiveRenderMode;
9251
- (function (LWCDirectiveRenderMode) {
9252
- LWCDirectiveRenderMode["shadow"] = "shadow";
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
- var LwcTagName;
9259
- (function (LwcTagName) {
9260
- LwcTagName["Component"] = "lwc:component";
9261
- })(LwcTagName || (LwcTagName = {}));
9262
- var TemplateDirectiveName;
9263
- (function (TemplateDirectiveName) {
9264
- TemplateDirectiveName["If"] = "if:true";
9265
- TemplateDirectiveName["IfBlock"] = "lwc:if";
9266
- TemplateDirectiveName["ElseifBlock"] = "lwc:elseif";
9267
- TemplateDirectiveName["ElseBlock"] = "lwc:else";
9268
- TemplateDirectiveName["ForEach"] = "for:each";
9269
- TemplateDirectiveName["ForOf"] = "for:of";
9270
- TemplateDirectiveName["ScopedSlotFragment"] = "lwc:slot-data";
9271
- })(TemplateDirectiveName || (TemplateDirectiveName = {}));
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
- ElementDirectiveName["Dynamic"] = "lwc:dynamic";
9277
- ElementDirectiveName["Is"] = "lwc:is";
9278
- ElementDirectiveName["External"] = "lwc:external";
9279
- ElementDirectiveName["InnerHTML"] = "lwc:inner-html";
9280
- ElementDirectiveName["Ref"] = "lwc:ref";
9281
- ElementDirectiveName["SlotBind"] = "lwc:slot-bind";
9282
- ElementDirectiveName["SlotData"] = "lwc:slot-data";
9283
- ElementDirectiveName["Spread"] = "lwc:spread";
9284
- ElementDirectiveName["On"] = "lwc:on";
9285
- ElementDirectiveName["Key"] = "key";
9286
- })(ElementDirectiveName || (ElementDirectiveName = {}));
9287
- var RootDirectiveName;
9288
- (function (RootDirectiveName) {
9289
- RootDirectiveName["PreserveComments"] = "lwc:preserve-comments";
9290
- RootDirectiveName["RenderMode"] = "lwc:render-mode";
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: 8.28.1 */
14546
+ /** version: 9.0.0 */
14553
14547
  //# sourceMappingURL=index.js.map
@@ -8,13 +8,15 @@ export interface TemplateCompileResult extends TemplateParseResult {
8
8
  code: string;
9
9
  cssScopeTokens: string[];
10
10
  }
11
- export declare enum LWCDirectiveDomMode {
12
- manual = "manual"
13
- }
14
- export declare enum LWCDirectiveRenderMode {
15
- shadow = "shadow",
16
- light = "light"
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 enum LwcTagName {
163
- Component = "lwc: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 enum TemplateDirectiveName {
172
- If = "if:true",
173
- IfBlock = "lwc:if",
174
- ElseifBlock = "lwc:elseif",
175
- ElseBlock = "lwc:else",
176
- ForEach = "for:each",
177
- ForOf = "for:of",
178
- ScopedSlotFragment = "lwc:slot-data"
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 enum ElementDirectiveName {
231
- Dom = "lwc:dom",
232
- Dynamic = "lwc:dynamic",
233
- Is = "lwc:is",
234
- External = "lwc:external",
235
- InnerHTML = "lwc:inner-html",
236
- Ref = "lwc:ref",
237
- SlotBind = "lwc:slot-bind",
238
- SlotData = "lwc:slot-data",
239
- Spread = "lwc:spread",
240
- On = "lwc:on",
241
- Key = "key"
242
- }
243
- export declare enum RootDirectiveName {
244
- PreserveComments = "lwc:preserve-comments",
245
- RenderMode = "lwc:render-mode"
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": "8.28.1",
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.cjs.js",
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": "8.28.1",
50
- "@lwc/shared": "8.28.1",
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"