Skip to content

Commit

Permalink
0.3.0-rc2
Browse files Browse the repository at this point in the history
  • Loading branch information
jmesrje committed Dec 15, 2024
1 parent 4bb6065 commit 36ba836
Show file tree
Hide file tree
Showing 18 changed files with 63 additions and 172 deletions.
File renamed without changes.
35 changes: 13 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@ permissions:
id-token: write

jobs:
bump:
name: Bump Versions
changelog:
name: Changelog
runs-on: ubuntu-latest
outputs:
release-body: ${{ steps.update-changelog.outputs.release-notes }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: 'main'
- uses: actions/checkout@v4

- name: Update changelog
id: update-changelog
Expand All @@ -38,54 +35,48 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest
needs: bump
needs: changelog
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Setup Pesde
uses: 2jammers/[email protected]
with:
cache: 'true'
pesde-version: 'v0.5.1+registry.0.1.0'
cache: true

- name: Install dependencies
run: pesde install

- name: Generate sourcemap
run: rojo sourcemap standalone.project.json --output sourcemap.json

- name: Format code
run: stylua src/

- name: Build standalone
- name: Standalone build
run: rojo build standalone.project.json --output ./Standalone.rbxm

- name: Draft release
uses: softprops/action-gh-release@v2.2.0
- name: Standalone release
uses: softprops/action-gh-release@v2.0.9
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
prerelease: ${{ contains(github.ref_name, 'rc') }}
generate_release_notes: true
body: |
## Changelog
${{ needs.bump.outputs.release-body }}
${{ needs.changelog.outputs.release-body }}
files: |
./Standalone.rbxm
package:
name: Package
runs-on: ubuntu-latest
needs: bump
needs: changelog
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Setup Pesde
uses: 2jammers/[email protected]
with:
pesde-version: 'v0.5.1+registry.0.1.0'
cache: true
token: '${{ secrets.PESDE_TOKEN }}'

- name: Publish
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ A light, fast, and efficient UI framework that has a small learning curve.

In order to use **lumin/ui** you must have the following dependencies installed:

* [`pesde@v0.5.1+registry.0.1.0^`](https://github.com/pesde-pkg/pesde)
* [`rojo@v7.4.4^`](https://github.com/rojo-rbx/rojo)
* [`pesde@^0.5.1`](https://github.com/pesde-pkg/pesde)
* [`rojo@^7.4.4`](https://github.com/rojo-rbx/rojo)

## Usage

Expand All @@ -34,8 +34,7 @@ New "ScreenGui" {
AnchorPoint = Vector2.new(0.5, 0.5),
Position = UDim2.fromScale(0.5, 0.5),
Size = UDim2.fromOffset(100, 100),
ZIndex = 1,
ZIndex = 1,small
Event("Activated", function()
print("Button clicked!")
end)
Expand Down
12 changes: 3 additions & 9 deletions dev.project.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"emitLegacyScripts": false,
"name": "ui-framework",
"name": "ui",
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
"ui-framework": {
"ui": {
"$className": "Folder",
"src": {
"$path": "src"
Expand All @@ -14,13 +14,7 @@
}
},
"tests": {
"$className": "Folder",
"Client": {
"$path": "tests/client"
},
"Server": {
"$path": "tests/server"
}
"$path": "tests"
}
}
}
Expand Down
15 changes: 11 additions & 4 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.3.0-rc1] - 2024-12-15
### Fixed

## [0.3.0] - 2024-12-15
- Fixed possible bugs
- Minified longer code
- Improved memory usage

### Removed

- Removed old log types

## [0.3.0-rc1] - 2024-12-15

### Added

Expand Down Expand Up @@ -121,5 +129,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Released [Aegis](/)!

[unreleased]: https://github.com/lumin-org/ui/compare/v0.3.0-rc1...HEAD
[0.3.0-rc1]: https://github.com/lumin-org/ui/compare/v0.3.0...v0.3.0-rc1
[0.3.0]: https://github.com/lumin-org/ui/compare/494ed6244654f0eb7886177eff2f6c86520cb742...v0.3.0
[0.3.0-rc1]: https://github.com/lumin-org/ui/compare/494ed6244654f0eb7886177eff2f6c86520cb742...v0.3.0-rc1
4 changes: 2 additions & 2 deletions pesde.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "lumin/ui"
version = "0.3.0-rc1"
description = "A small, fast, and efficient UI framework that has a small learning curve"
version = "0.3.0-rc2"
description = "A light, fast, and efficient UI framework that has a small learning curve"
authors = ["2jammers"]
repository = "https://github.com/lumin-org/ui"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src/Apply.luau
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ return function(instance: Instance, property: any, value: any)
if PropType == "number" then -- If the property is a modifier
if ValueType == "function" then -- If the value is an action
(value :: Types.Action)(instance)
else -- If the value is an instance
elseif ValueType == "userdata" then -- If the value is anything else, it's an instance
value.Parent = instance
value.Name = property
end
Expand Down
18 changes: 4 additions & 14 deletions src/Computed.luau
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local Types = require(Root.Types)
local Debugger = require(Root.Parent.roblox_packages.debugger)

local Class = {}
Class.__index = Class

-- Functions

Expand All @@ -22,7 +23,7 @@ end

local function Listener(self: Types.Computed)
return function()
self._Value = self._Processor(Use)
self._Value = self._Processor(Use) -- Set the value of the computed to the processed value

if self._Instances ~= nil then
for prop, instance in self._Instances do
Expand All @@ -42,27 +43,16 @@ function Class.Get(self: Types.Computed): any
end

function Class._Bind(self: Types.Computed, prop: string, instance: Instance)
if self._Instances == nil then
self._Instances = {}
end

(self._Instances :: {})[prop] = instance;
(instance :: any)[prop] = self._Value
end

--[=[
Destroys the compute object.
Destroys the compute object, but not the state dependencies.
[Open Documentation](https://lumin-org.github.io/ui/api/computed/#destroy)
]=]
function Class.Destroy(self: Types.Computed)
if self._Dependencies then
for dependency: any, disconnect: any in self._Dependencies do
disconnect()
self._Dependencies[dependency] = nil
end
end

table.clear(self :: any)
setmetatable(self :: any, nil)
end
Expand All @@ -78,7 +68,7 @@ return function(
processor: (use: (value: Types.State | any) -> ()) -> (),
dependencies: { Types.State | Types.Spring }?
): Types.ComputedExport
local self = setmetatable({}, { __index = Class })
local self = setmetatable({}, Class)

self._Type = "Computed"
self._Processor = processor
Expand Down
5 changes: 0 additions & 5 deletions src/Logs.luau
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
return {
IncompatibleType = "Data type '%s' is incompatible",
NotAnimatable = "%s is not an animatable object type",
FailedCreation = "%s could not be created; '%s'",
AlreadyExists = "Item '%s' already exists",

InvalidType = "Expected type %s; got '%s'",
InvalidKey = "Expected valid key type; got '%s'",
InvalidClass = "'%s' is not an instance class name",
InvalidPropOrEvent = "'%s' is not a property/event of the %s class",
}
2 changes: 1 addition & 1 deletion src/New.luau
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ return function(class: string)
end
end
else
Debugger.Fatal("FailedCreation", class, New)
Debugger.Fatal("InvalidClass", class)
end

return New
Expand Down
8 changes: 5 additions & 3 deletions src/Spring.luau
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ local Spr = require(Root.Parent.roblox_packages.spr)
local Types = require(Root.Types)

local Class = {}
Class.__index = Class

local Animatable = {
"boolean",
"number",
Expand All @@ -22,8 +24,8 @@ local Animatable = {
-- Functions

function Class._Bind(self: Types.Spring, prop: string, instance: Instance)
(instance :: any)[prop] = self._Goal:Get() -- Set the prop of the instance to the initial goal
table.insert(self._Instances, instance)
table.insert(self._Instances, instance)
;(instance :: any)[prop] = self._Goal:Get() -- Set the prop of the instance to the initial goal
self._Goal:Listen(function(new) -- When the goal changes, set the target to the new value
Spr.target(instance, self._Damping, self._Frequency, {
[prop] = new,
Expand Down Expand Up @@ -75,7 +77,7 @@ return function(goal: Types.State, damping: number?, frequency: number?): Types.
Debugger.Assert(table.find(Animatable, typeof((goal :: any):Get())), "NotAnimatable", typeof((goal :: any):Get()))
Debugger.Assert(type(goal) == "table" and goal._Type == "State", "InvalidType", "State", type(goal))

local self = setmetatable({}, { __index = Class })
local self = setmetatable({}, Class)

self._Type = "Spring"
self._Damping = damping or 1
Expand Down
3 changes: 2 additions & 1 deletion src/State.luau
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local Types = require(Root.Types)
local Debugger = require(Root.Parent.roblox_packages.debugger)

local Class = {}
Class.__index = Class

-- Functions

Expand Down Expand Up @@ -83,7 +84,7 @@ end
return function(initial: any): Types.StateExport
Debugger.Assert(type(initial) ~= "table", "InvalidType", "any", "table")

local self = setmetatable({}, { __index = Class })
local self = setmetatable({}, Class)

self._Type = "State"
self._Value = initial
Expand Down
11 changes: 4 additions & 7 deletions standalone.project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
"tree": {
"$className": "Folder",
"src": {
"$className": "Folder",
"init": {
"$path": "src"
},
"roblox_packages": {
"$path": "roblox_packages"
}
"$path": "src"
},
"roblox_packages": {
"$path": "roblox_packages"
}
}
}
25 changes: 11 additions & 14 deletions tests/client/UI.client.luau
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
-- SERVICES >
-- Variables
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

-- FOLDERS >
local Package = ReplicatedStorage["ui-framework"]
local Package = ReplicatedStorage.ui

-- DEPENDENCIES >
local Framework = require(Package.src)
local UI = require(Package.src)
local MyComponent = require(script.Parent.components.Background)

-- VARIABLES >
local Player = Players.LocalPlayer
local New = Framework.New
local Event = Framework.Event
local Changed = Framework.Changed
local State = Framework.State("Hello")
local Goal = Framework.State(UDim2.fromScale(0.5, 1))
local Spring = Framework.Spring(Goal :: any, 0.5, 5)
local New = UI.New
local Event = UI.Event
local Changed = UI.Changed
local Tags = UI.Tags
local State = UI.State("Hello")
local Goal = UI.State(UDim2.fromScale(0.5, 1))
local Spring = UI.Spring(Goal :: any, 0.5, 5)
local c = 1

-- UI
Expand Down Expand Up @@ -54,13 +52,12 @@ New "ScreenGui" {
print(new)
end),

Text = "Test",
Text = State,
Position = UDim2.fromScale(0.5, 0.2),
Size = UDim2.fromOffset(100, 100),
ZIndex = 3,
},
}


task.wait(10)
State:Set("TEST!!!")
6 changes: 3 additions & 3 deletions tests/client/components/Background.luau
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
local ReplicatedStorage = game:GetService("ReplicatedStorage")

-- FOLDERS >
local Package = ReplicatedStorage["ui-framework"]
local Package = ReplicatedStorage.ui

-- DEPENDENCIES >
local Framework = require(Package.src)
local UI = require(Package.src)

-- VARIABLES >
local New = Framework.New
local New = UI.New

type Background = {
Color: Color3,
Expand Down
Loading

0 comments on commit 36ba836

Please sign in to comment.