@lwc/ssr-compiler 8.3.0 → 8.5.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/compile-js/generate-markup.d.ts +5 -0
- package/dist/compile-js/index.d.ts +2 -1
- package/dist/compile-js/stylesheets.d.ts +1 -1
- package/dist/compile-js/types.d.ts +0 -1
- package/dist/compile-template/index.d.ts +2 -1
- package/dist/compile-template/shared.d.ts +13 -2
- package/dist/estree/builders.d.ts +9 -5
- package/dist/estree/validators.d.ts +1 -6
- package/dist/index.cjs.js +408 -236
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +411 -239
- package/dist/index.js.map +1 -1
- package/dist/shared.d.ts +1 -0
- package/dist/transmogrify.d.ts +50 -0
- package/package.json +4 -4
|
@@ -13,3 +13,8 @@ import type { ComponentMetaState } from './types';
|
|
|
13
13
|
* - deferring to the template function for yielding child content
|
|
14
14
|
*/
|
|
15
15
|
export declare function addGenerateMarkupExport(program: Program, state: ComponentMetaState, filename: string): void;
|
|
16
|
+
/**
|
|
17
|
+
* Attach the `generateMarkup` function to the Component class so that it can be found later
|
|
18
|
+
* during `renderComponent`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function assignGenerateMarkupToComponent(program: Program, state: ComponentMetaState): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { NodePath } from 'estree-toolkit';
|
|
2
2
|
import type { ImportDeclaration } from 'estree';
|
|
3
3
|
import type { ComponentMetaState } from './types';
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function catalogAndReplaceStyleImports(path: NodePath<ImportDeclaration>, state: ComponentMetaState): void;
|
|
5
5
|
/**
|
|
6
6
|
* This adds implicit style imports to the compiled component artifact.
|
|
7
7
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Config as TemplateCompilerConfig } from '@lwc/template-compiler';
|
|
2
|
-
|
|
2
|
+
import type { CompilationMode } from '../shared';
|
|
3
|
+
export default function compileTemplate(src: string, filename: string, options: TemplateCompilerConfig, compilationMode: CompilationMode): {
|
|
3
4
|
code: string;
|
|
4
5
|
};
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { Node as IrNode } from '@lwc/template-compiler';
|
|
2
|
+
import { TransformerContext } from './types';
|
|
3
|
+
import type { Statement as EsStatement, Expression as EsExpression } from 'estree';
|
|
4
|
+
export declare const bImportHtmlEscape: () => import("estree").ImportDeclaration;
|
|
3
5
|
export declare const importHtmlEscapeKey = "import:htmlEscape";
|
|
4
6
|
export declare const isValidIdentifier: (str: string) => boolean;
|
|
5
7
|
export declare function optimizeAdjacentYieldStmts(statements: EsStatement[]): EsStatement[];
|
|
8
|
+
export declare function bAttributeValue(node: IrNode, attrName: string): EsExpression;
|
|
9
|
+
/**
|
|
10
|
+
* Given an expression in a context, return an expression that may be scoped to that context.
|
|
11
|
+
* For example, for the expression `foo`, it will typically be `instance.foo`, but if we're
|
|
12
|
+
* inside a `for:each` block then the `foo` variable may refer to the scoped `foo`,
|
|
13
|
+
* e.g. `<template for:each={foos} for:item="foo">`
|
|
14
|
+
* @param expression
|
|
15
|
+
*/
|
|
16
|
+
export declare function getScopedExpression(expression: EsExpression, cxt: TransformerContext): EsExpression;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { ImportDeclaration } from 'estree';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
/** Creates a default import statement, e.g. `import pkg from "pkg"` */
|
|
3
|
+
export declare const bImportDefaultDeclaration: (name: string, source: string) => ImportDeclaration;
|
|
4
|
+
/**
|
|
5
|
+
* Creates an import statement, e.g. `import { foo, bar as $bar$ } from "pkg"`.
|
|
6
|
+
* Does not support default or namespace imports (`import pkg` or `import * as pkg`).
|
|
7
|
+
* @param imports names to be imported; values can be a string (plain import) or object (aliased)
|
|
8
|
+
* @param source source location to import from; defaults to @lwc/ssr-runtime
|
|
9
|
+
*/
|
|
10
|
+
export declare const bImportDeclaration: (imports: (string | Record<string, string>)[], source?: string) => ImportDeclaration;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import type { CallExpression, Identifier, MemberExpression
|
|
1
|
+
import type { CallExpression, Identifier, MemberExpression } from 'estree';
|
|
2
2
|
import type { Checker } from 'estree-toolkit/dist/generated/is-type';
|
|
3
3
|
import type { Node } from 'estree-toolkit/dist/helpers';
|
|
4
|
-
/** Node representing a string literal. */
|
|
5
|
-
type StringLiteral = SimpleLiteral & {
|
|
6
|
-
value: string;
|
|
7
|
-
};
|
|
8
|
-
export declare const isStringLiteral: (node: Node | null | undefined) => node is StringLiteral;
|
|
9
4
|
/** Node representing an identifier named "render". */
|
|
10
5
|
type RenderIdentifier = Identifier & {
|
|
11
6
|
name: 'render';
|