Forest Logo
search
package_2

leafframeworkrbx

By @alexeylegasov63

Roblox

Mirrored from Wally

This version ships no README. Showing the README from v0.1.6, mirrored from wally.

LeafFramework

LeafFramework — lightweight, modular Roblox framework built around components, services, and lifecycle events. Manages dependencies, asynchronous initialization, and per-frame updates efficiently. Very influenced by the Flamework.

Features

  • Components: attachable to any Instance via CollectionService tags.
  • Services / Controllers: modular, dependency-aware, loaded in proper order.
  • Lifecycle: onInit, onStart, onTick, onPhysics, onRender.
  • Asynchronous initialization using Promise.
  • Attributes: synchronized properties on components (self.Attributes), auto-updates with Instance.
  • Reusable thread system for efficient lifecycle execution.
  • Dependency Resolver: topological sorting, circular dependency detection.

Installation

Wally

Leaf = "alexeylegasov63/leafframeworkrbx@0.1.5"

Usage

Initialization & Running

LeafFramework.addServices(game.ServerScriptService.Services)
LeafFramework.addComponents(game.ServerScriptService.Components)
LeafFramework.addComponentsDeep(game.ReplicatedStorage.Components)
W
-- And more more more

LeafFramework.run({
    profiling = true -- optional
}):catch(warn)

Creating a Service

-- DamageService.lua
local DamageService = {
    LoadOrder = 2
}

function DamageService:onInit()
    self._time = 0
end

function DamageService:onTick(dt)
    self._time += dt
end

function DamageService:calculateDamage(damager)
    return damager.Attributes.Damage * self._time
end

return DamageService

Creating a Component

-- DamagerComponent.lua
local DamagerComponent = {
    Name = "Damager",
    Tag = "Damager", -- Optional
    Attributes = {
        Damage = 10,
        LastDamage = 0,
    },
    Depends = {
        DamageService = {}
    }
}

function DamagerComponent:onSpawn()
	self.Super.onSpawn(self) -- If you wish to have BaseComponent stuff

    print(self.Depends.DamageService:calculateDamage(self)) -- Use the dependency

	self:onAttributeChanged("Damage", function(new, last)
		print("Hello, Flamework!", new, last)
	end)
end

    print(self.Depends.DamageService:calculateDamage(self)) -- Use the dependency

	self:onAttributeChanged("Damage", function(new, last)
		print("Hello, Flamework!", new, last)
	end)
end


return DamagerComponent

Using a Component

local Components = require(game.ServerScriptService.LeafFramework.Components)

local damager = Components.addComponent(somePart, "Damager")
print(damager.Attributes.Damage) -- 10

damager.Attributes.LastDamage = 5
print(damager.Instance:GetAttribute("LastDamage")) -- 5

Lifecycle Methods

function SomeService:onTick(dt)
    print("Heartbeat delta:", dt)
end

function SomeService:onPhysics()
    print("Physics step")
end

-- Client-only
function SomeService:onRender()
    print("Render update")
end
argon build

Package Details

Install command (Click to copy)


Version

0.4.5

License

MIT

check_circle

Safe for commercial use

infoThe package archive does not include its license text; the license is declared in its manifest metadata.

Automated license review — not legal advice.