Skip to content

Commit

Permalink
rc8
Browse files Browse the repository at this point in the history
  • Loading branch information
2jammers committed Sep 13, 2024
1 parent 4734497 commit 25fd34a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
5 changes: 5 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Adds a fix for an incorrect type reference
- Simplifies controller type

## [9.0.0-rc7] - 2024-09-02

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/Storage.luau
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local Types = require(script.Parent.Types)
return {
Controllers = {} :: {Types.UserController<any>},
Controllers = {} :: {Types.Controller<any>},
Workers = {} :: {Types.Worker},
}
12 changes: 6 additions & 6 deletions src/Types.luau
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export type Controller = {
export type Controller<T> = {
Start: (() -> ())?,
Init: (() -> ())?,
Uses: {Controller}?,
}

export type DevController<T> = T & Controller
Uses: {
any
}?,
} & T

export type WorkerType =
"PostSimulation"
Expand All @@ -20,7 +20,7 @@ export type Worker = {
}

export type Storage = {
Controllers: {DevController<any>},
Controllers: {Controller<any>},
Workers: {Worker},
}

Expand Down
10 changes: 5 additions & 5 deletions src/init.luau
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ local function LoadController(callback: () -> (), type: "Start" | "Init")
end

-- Starts/inits a list of controllers internally
local function LoadAllControllers(controllers: { Types.DevController<any> })
local function LoadAllControllers(controllers: { Types.Controller<any> })
for _, controller in controllers do
if controller["Uses"] and type(controller.Uses) == "table" then
for _, usedController in controller.Uses :: any do
Expand Down Expand Up @@ -69,7 +69,7 @@ end
[Learn More](https://luminlabsdev.github.io/framework/api/#load)
]=]
local function Load(containers: { Instance }, filter: ((ModuleScript) -> boolean)?): { Types.DevController<any> }
local function Load(containers: { Instance }, filter: ((ModuleScript) -> boolean)?): { Types.Controller<any> }
local Controllers = {}
for _, container in containers do
for _, module in container:GetChildren() do
Expand All @@ -87,7 +87,7 @@ end
[Learn More](https://luminlabsdev.github.io/framework/api/#start)
]=]
local function Start(loaded: { Types.DevController<any> })
local function Start(loaded: { Types.Controller<any> })
Debugger.Assert(Started, "AlreadyStarted")

LoadAllControllers(loaded)
Expand All @@ -108,7 +108,7 @@ end
[Learn More](https://luminlabsdev.github.io/framework/api/#new)
]=]
local function New<T>(members: Types.DevController<T>): T
local function New<T>(members: Types.Controller<T>): T
Debugger.Assert(Started, "AlreadyStarted")
table.insert(Storage.Controllers, members)
return members
Expand Down Expand Up @@ -157,7 +157,7 @@ Debugger.SetMetadata({

return table.freeze({
-- Version
version = { major = 9, minor = 0, patch = 0, rc = 7 },
version = { major = 9, minor = 0, patch = 0, rc = 8 },

-- Loaders
Start = Start,
Expand Down
2 changes: 1 addition & 1 deletion wally.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "lumin/framework"
description = "A lightning fast & amazing game framework for Roblox"
version = "9.0.0-rc7"
version = "9.0.0-rc8"
license = "MIT"
registry = "https://github.com/UpliftGames/wally-index"
realm = "shared"
Expand Down

0 comments on commit 25fd34a

Please sign in to comment.