Reference
@reckona/mreact-compiler/internal
55 public exports.
Function
FunctionanalyzeCompilerModuleContextToIr
function analyzeCompilerModuleContextToIr(context: CompilerModuleContext, input: Omit<AnalyzeToIrInput, "code" | "filename">): AnalyzeToIrOutputAnalyzes a pre-parsed compiler module context into compiler IR with diagnostics.FunctionanalyzeToIrfunction analyzeToIr(input: AnalyzeToIrInput): AnalyzeToIrOutputAnalyzes source code into compiler IR with diagnostics.FunctioncollectClientRouteModuleAnalysisfunction collectClientRouteModuleAnalysis(input: { code: string; filename?: string }): ClientRouteModuleAnalysisAnalyzes a route module for directives, static imports, exports, references, and render reachability.FunctioncollectClientRouteModuleAnalysisFromContextfunction collectClientRouteModuleAnalysisFromContext(context: CompilerModuleContext): ClientRouteModuleAnalysisAnalyzes a cached compiler module context for route-module metadata.FunctioncollectFormActionExpressionReferencesfunction collectFormActionExpressionReferences(input: { code: string; filename?: string }): FormActionExpressionReference[]Collects form action expression references and their source spans from a module.FunctioncollectFormActionReferenceNamesfunction collectFormActionReferenceNames(input: { code: string; filename?: string }): string[]Collects unique named form action references from a module.FunctioncollectFormActionReferencesfunction collectFormActionReferences(input: { code: string; filename?: string }): FormActionReference[]Collects named form action references and their source spans from a module.FunctioncollectIdentifierReferenceNamesfunction collectIdentifierReferenceNames(input: { code: string; filename?: string }): string[]Collects identifier reference names from a module, excluding declarations.FunctioncollectJsxComponentRootNamesfunction collectJsxComponentRootNames(input: { code: string; filename?: string }): string[]Collects root component names referenced by JSX elements in a module.FunctioncollectStaticExportReferencesfunction collectStaticExportReferences(input: { code: string; filename?: string }): StaticExportReference[]Collects static export declarations and their exported names.FunctioncollectStaticImportReferencesfunction collectStaticImportReferences(input: { code: string; filename?: string }): StaticImportReference[]Collects static import declarations and their local binding names.FunctioncollectStaticModuleSpecifiersfunction collectStaticModuleSpecifiers(input: { code: string; filename?: string }): string[]Collects module specifier strings from static import and export declarations.FunctioncollectTopLevelExportRenderInfofunction collectTopLevelExportRenderInfo(input: { code: string; filename?: string }): TopLevelExportRenderInfo[]Collects render reachability information for top-level exports in a module.FunctioncollectTopLevelValueExportNamesfunction collectTopLevelValueExportNames(input: { code: string; filename?: string }): string[]Collects value export names declared at the top level of a module.FunctioncreateCompilerModuleContextfunction createCompilerModuleContext(input: { code: string; filename?: string }): CompilerModuleContextCreates a compiler module context from source code and an optional filename.FunctiondemoteTopLevelExportDeclarationsfunction demoteTopLevelExportDeclarations(input: { code: string; filename?: string; names: readonly string[] }): stringConverts selected top-level export declarations into non-exported declarations.FunctionhasClientRuntimeSyntaxfunction hasClientRuntimeSyntax(input: { code: string; filename?: string }): booleanChecks whether a module contains syntax that requires client runtime execution.FunctionhasModuleDirectivefunction hasModuleDirective(input: { code: string; directive: string; filename?: string }): booleanChecks whether a module begins with a specific directive string.FunctionhasTopLevelExportDeclarationfunction hasTopLevelExportDeclaration(input: { code: string; filename?: string; names: readonly string[] }): booleanChecks whether a module declares any of the given names as top-level exports.FunctionhasUnguardedBrowserGlobalReferencefunction hasUnguardedBrowserGlobalReference(input: { code: string; filename?: string }): booleanChecks whether browser globals may execute during server rendering without a guard.FunctionreadTopLevelBooleanExportfunction readTopLevelBooleanExport(input: { code: string; filename?: string; name: string }): boolean | undefinedReads a top-level exported boolean literal by name, ignoring comments and non-literal values.FunctionreadTopLevelBooleanExportFromContextfunction readTopLevelBooleanExportFromContext(context: CompilerModuleContext, name: string): boolean | undefinedReads a top-level exported boolean literal from a cached compiler module context.FunctionstripTopLevelExportDeclarationsfunction stripTopLevelExportDeclarations(input: { code: string; filename?: string; names: readonly string[] }): stringRemoves top-level export declarations for selected names while preserving their values where possible.FunctionstripTypeScriptWithOxcfunction stripTypeScriptWithOxc(source: string): stringRemoves TypeScript syntax from a snippet with OXC while preserving JSX.FunctionstripUnusedStaticValueImportsfunction stripUnusedStaticValueImports(input: { code: string; filename?: string }): stringRemoves unused static value imports while preserving side-effect and type-only imports.FunctiontransformCompilerModuleContextfunction transformCompilerModuleContext(input: TransformInput & { moduleContext: CompilerModuleContext }): TransformOutputCompiles a pre-parsed compiler module context into client or server JavaScript output.Interface
InterfaceAnalyzeToIrInput
interface AnalyzeToIrInputConfigures source code, filename, target, and analysis options for IR generation.InterfaceAnalyzeToIrOutputinterface AnalyzeToIrOutputContains the module IR and diagnostics produced by compiler analysis.InterfaceAsyncBoundaryIrinterface AsyncBoundaryIrRepresents an async boundary lowered from an Await-style JSX construct.InterfaceClientRouteModuleAnalysisinterface ClientRouteModuleAnalysisSummarizes route-module imports, exports, directives, references, and reachable render roots.InterfaceClientRouteStaticImportReferenceinterface ClientRouteStaticImportReferenceDescribes a static import declaration with its individual specifiers.InterfaceCompilerModuleContextinterface CompilerModuleContextStores parsed OXC program data and parse errors for a compiler module.InterfaceComponentIrinterface ComponentIrRepresents one component discovered and lowered by compiler analysis.InterfaceComponentRefIrinterface ComponentRefIrRepresents a lowered component reference and its props, children, and boundary metadata.InterfaceConditionalIrinterface ConditionalIrRepresents a conditional JSX expression with true and false branches.InterfaceDynamicAttributeIrinterface DynamicAttributeIrRepresents a dynamic intrinsic attribute expression.InterfaceEventAttributeIrinterface EventAttributeIrRepresents an event handler attribute emitted for client hydration.InterfaceExprIrinterface ExprIrRepresents a dynamic expression emitted from JSX.InterfaceFormActionExpressionReferenceinterface FormActionExpressionReferenceDescribes a form action expression reference and both wrapper and expression source spans.InterfaceFormActionReferenceinterface FormActionReferenceDescribes a named form action reference and its source span.InterfaceJsxElementIrinterface JsxElementIrRepresents a lowered intrinsic JSX element.InterfaceJsxFragmentIrinterface JsxFragmentIrRepresents a JSX fragment and its lowered children.InterfaceListIrinterface ListIrRepresents a JSX list rendering expression and its lowered item body.InterfaceModuleIrinterface ModuleIrRepresents the compiler intermediate representation for one module.InterfaceSpreadAttributeIrinterface SpreadAttributeIrRepresents a spread attribute expression on an intrinsic element.InterfaceStaticAttributeIrinterface StaticAttributeIrRepresents a static intrinsic attribute.InterfaceStaticExportReferenceinterface StaticExportReferenceDescribes a static export declaration and the names it exports.InterfaceStaticExportSpecifierReferenceinterface StaticExportSpecifierReferenceDescribes one specifier inside a static export declaration.InterfaceStaticImportReferenceinterface StaticImportReferenceDescribes a static import declaration and the local names it introduces.InterfaceStaticImportSpecifierReferenceinterface StaticImportSpecifierReferenceDescribes one specifier inside a static import declaration.InterfaceTextIrinterface TextIrRepresents static text emitted from JSX.InterfaceTopLevelExportRenderInfointerface TopLevelExportRenderInfoDescribes render and client-runtime reachability for one top-level export.Type Alias
Type AliasAttributeIr
type AttributeIr = StaticAttributeIr | DynamicAttributeIr | EventAttributeIr | SpreadAttributeIrRepresents any intrinsic attribute shape supported by the compiler IR.Type AliasComponentPropIrtype ComponentPropIr = ComponentNamedPropIr | ComponentRenderPropIr | ComponentSpreadPropIrRepresents any prop shape supported by a component reference.Type AliasJsxNodeIrtype JsxNodeIr = JsxElementIr | ComponentRefIr | JsxFragmentIr | ConditionalIr | ListIr | TextIr | ExprIr | AsyncBoundaryIrRepresents any JSX node shape supported by the compiler intermediate representation.