compiler

package
v0.35.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentCompiler

type ComponentCompiler struct {
	BaseDir         string
	Cache           map[string]*parser.Component
	Bundler         *assets.Bundler
	Resolver        *ComponentResolver
	CollectedStyles []parser.Style
	UsedComponents  []string
	// contains filtered or unexported fields
}

func NewComponentCompiler

func NewComponentCompiler(baseDir string) *ComponentCompiler

func (*ComponentCompiler) ClearCache

func (c *ComponentCompiler) ClearCache()

func (*ComponentCompiler) Compile

func (c *ComponentCompiler) Compile(filePath string, props map[string]interface{}, slots map[string]string) (string, error)

func (*ComponentCompiler) CompileWithContext

func (c *ComponentCompiler) CompileWithContext(filePath string, props map[string]interface{}, slots map[string]string, parentCtx *executor.Context) (string, error)

func (*ComponentCompiler) ProcessComponentTags

func (c *ComponentCompiler) ProcessComponentTags(template string, ctx *executor.Context) string

func (*ComponentCompiler) ResetComponentTracking

func (c *ComponentCompiler) ResetComponentTracking()

func (*ComponentCompiler) SetResolver

func (c *ComponentCompiler) SetResolver(resolver *ComponentResolver)

type ComponentResolver

type ComponentResolver struct {
	BaseDir        string
	ComponentDirs  []string
	CurrentFile    string
	ExplicitPaths  map[string]string
	Cache          map[string]string
	ComponentIndex map[string]string
}

func NewComponentResolver

func NewComponentResolver(baseDir string, componentDirs []string) *ComponentResolver

func (*ComponentResolver) ExtractComponentRefs

func (r *ComponentResolver) ExtractComponentRefs(template string) []string

func (*ComponentResolver) ParseImports

func (r *ComponentResolver) ParseImports(imports []Import)

func (*ComponentResolver) Resolve

func (r *ComponentResolver) Resolve(name string) (string, error)

func (*ComponentResolver) SetCurrentFile

func (r *ComponentResolver) SetCurrentFile(file string)

type Import

type Import struct {
	Path        string
	Alias       string
	IsComponent bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL