diff --git a/aftman.toml b/aftman.toml index cf47552..4febcc7 100644 --- a/aftman.toml +++ b/aftman.toml @@ -1,7 +1,3 @@ -# This file lists tools managed by Aftman, a cross-platform toolchain manager. -# For more information, see https://github.com/LPGhatguy/aftman - -# To add a new tool, add an entry to this table. [tools] argon = "argon-rbx/argon@2.0.13" wally = "UpliftGames/wally@0.3.2" diff --git a/docs/api/index.md b/docs/api/index.md index 647d7de..28048b0 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -64,7 +64,7 @@ Creates a new compute object. #### Parameters - **processor:** `(get: (Constructor | any) -> ()) -> ()`\ - The main function which will be run everytime the value changes + The main function which will be run every time the value changes - **dependencies:** `{ State | Spring | Constructor }?`\ A table of dependencies whose values will be listened to diff --git a/docs/guide/new-components.md b/docs/guide/new-components.md index 2678a43..7da51d8 100644 --- a/docs/guide/new-components.md +++ b/docs/guide/new-components.md @@ -7,7 +7,7 @@ While working with user interface, you may start to realize that creating the sa ::: code-group ```lua:line-numbers [Component] local Aegis = require(path.to.Aegis) -local new = Aegis.new +local New = Aegis.new type BackgroundProps = { Color: Color3, @@ -16,7 +16,7 @@ type BackgroundProps = { } return function(props: BackgroundProps) - return new("Frame", { + return New("Frame", { BackgroundColor3 = props.Color, AnchorPoint = Vector2.new(0.5, 0.5), BroderSizePixel = 0, @@ -28,7 +28,7 @@ end ```lua:line-numbers [Script] local Aegis = require(path.to.Aegis) -local new = Aegis.new +local New = Aegis.new local BackgroundComponent = require(path.to.BackgroundComponent) @@ -49,7 +49,7 @@ local Main = new("ScreenGui", { ::: :::warning -Do not include a key named `Children` inside of your props table, it will be overwritten! +Do not include a key named `Children` inside your props table, it will be overwritten! ::: -The way you create components in Aegis is very similar to how you do it in React as well, but better performance and less confusion. \ No newline at end of file +Creating components in Aegis is very similar to how you would in React; we have found that this is the most user-friendly way to do so. \ No newline at end of file diff --git a/src/Constructors/new.luau b/src/Constructors/new.luau index 5da7390..91b0ebc 100644 --- a/src/Constructors/new.luau +++ b/src/Constructors/new.luau @@ -15,7 +15,7 @@ local Types = require(Root.Types) @return Instance ]] return function ( - classOrComponent: Types.ClassName | Types.Component, + classOrComponent: string | Types.Component, properties: (T & Types.Properties)?, children: Types.Children? ): Instance @@ -23,7 +23,7 @@ return function ( if type(classOrComponent) == "string" then local Success, Result = pcall(Instance.new, classOrComponent) -- Create the instance wrapped inside pcall - if Success == true then + if Success then if properties then for property, value in properties :: any do if property == "Parent" then diff --git a/src/Types.luau b/src/Types.luau index ea967f5..6f75ce8 100644 --- a/src/Types.luau +++ b/src/Types.luau @@ -22,30 +22,6 @@ export type Properties = { [string | Key]: any } export type Children = { [string | number]: any } export type DefaultKeys = "Ref" | "Events" | "Changes" | "Cleanup" | "Attributes" | "Tags" -export type ClassName = - "CanvasGroup" - | "Frame" - | "TextButton" - | "TextLabel" - | "ScrollingFrame" - | "TextBox" - | "VideoFrame" - | "ViewportFrame" - | "ImageButton" - | "ImageLabel" - | "BillboardGui" - | "ScreenGui" - | "SurfaceGui" - | "UICorner" - | "UIGradient" - | "UIPadding" - | "UIScale" - | "UIStroke" - | "UIGridLayout" - | "UIListLayout" - | "UIPageLayout" - | "UITableLayout" - | string export type Key = { KeyName: DefaultKeys | string,