From c65a44173b9d7c90aa259d382ad96cc3f2a8e254 Mon Sep 17 00:00:00 2001 From: Richard Date: Fri, 25 Oct 2024 16:38:47 -0700 Subject: [PATCH 01/21] feat: add `` component --- README.md | 28 +++++++++++++++++++++++---- src/components.luau | 14 +++++++++++++- src/index.d.ts | 46 +++++++++++++++++++++++++++++++++------------ src/init.luau | 1 + 4 files changed, 72 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index b5ba9cf..8c00c1f 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,8 @@ Vide for roblox-ts brings JSX support to the library. As a result, this extensio > [!TIP] > -> - Vide JSX adds new components for syntax sugar, including ``, ``/``, ``, and ``. -> - Use the `action` prop to create a Vide action that gets the reference of the rendered element. +> - Vide JSX adds new components for syntax sugar, including ``, ``/``, ``/``, and ``. +> - Use the `action` prop to create a Vide action that receives the new instance as an argument. > - `switch` is a reserved keyword in TypeScript, so the `switch()` function is exposed under the alias `match()`. ### Installation @@ -60,8 +60,8 @@ To use JSX with Vide, you need to configure the `jsx` option in your `tsconfig.j ``` > [!NOTE] -> Custom JSX factories are available in an unreleased version of roblox-ts.
-> You can install it by running `npm install -D roblox-ts@next`. +> Vide JSX requires roblox-ts version 3.0 or higher. +> You can update roblox-ts by running `npm install -D roblox-ts@latest`. ### Code sample @@ -138,3 +138,23 @@ const items = source(["a", "b", "c"]); }}
; ``` + +### `` + +A component that renders its children with the `value` prop assigned to the context. The value can be accessed by calling the `context` function while the `children` function is running. + +`` is syntax sugar for `context(value, () => children)`. + +> [!NOTE] +> The context function must be called within the top-level of a component. Calling it within an effect or on a new thread will return the default value. + +```tsx +const theme = context("light"); + + + {() => { + const currentTheme = context(); + return ; + }} +; +``` diff --git a/src/components.luau b/src/components.luau index 165c74b..46b902e 100644 --- a/src/components.luau +++ b/src/components.luau @@ -1,6 +1,9 @@ +local context = require(script.Parent.context) +local indexes, values = require(script.Parent.maps)() local show = require(script.Parent.show) local switch = require(script.Parent.switch) -local indexes, values = require(script.Parent.maps)() + +type Context = context.Context type Case = { match: any, @@ -50,6 +53,14 @@ local function Show(props: { return show(props.when, props.children, props.fallback) end +local function Provider(props: { + context: Context, + value: T, + children: () -> any, +}) + return props.context(props.value, props.children) +end + return { Fragment = Fragment, Switch = Switch, @@ -57,4 +68,5 @@ return { For = For, Index = Index, Show = Show, + Provider = Provider, } diff --git a/src/index.d.ts b/src/index.d.ts index c83b289..ec7a721 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -536,24 +536,21 @@ declare namespace Vide { interface Context { (): T; - (value: T, component: () => void): void; + (value: T, component: () => U): U; } /** * Creates a new context that can be used to share state between components. * * @example - * ```ts - * const theme = context(); - * - * root(() => { - * theme("light", () => { - * print(theme()); // light - * theme("dark", () => { - * print(theme()); // dark - * }); - * }); - * }); + * ```tsx + * const theme = context("light"); + * + * + * {theme("dark", () => { + * return ; + * })} + * * ``` * * @template T The type of value to store in the context. @@ -564,6 +561,31 @@ declare namespace Vide { */ function context(defaultValue?: T): Context; + /** + * Renders a component with a new value in the context. The value will be + * passed to any components that read from the context within the component. + * + * **Note:** The context function must be called within the top-level of a + * component. Calling it within an effect or on a new thread will return the + * default value. + * + * @example + * ```tsx + * const theme = context("light"); + * + * + * {() => } + * + * ``` + * + * @param context The context to pass `children` to. + * @param value The new value to store in the context. + * @param children The component to render with the new context value. + * + * @returns The rendered component. + */ + function Provider(props: { context: Context; value: T; children: () => Node | void }): () => Node; + // Elements /** diff --git a/src/init.luau b/src/init.luau index e2fdf7d..4e5a1ec 100644 --- a/src/init.luau +++ b/src/init.luau @@ -110,6 +110,7 @@ local vide = { For = components.For, Index = components.Index, Show = components.Show, + Provider = components.Provider, } setmetatable(vide :: any, { From 1e5d8624024d944140ff2d26a677c51ec2b08abc Mon Sep 17 00:00:00 2001 From: Richard Date: Fri, 25 Oct 2024 16:41:45 -0700 Subject: [PATCH 02/21] 0.5.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1dd0537..74d5b78 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rbxts/vide", - "version": "0.4.6", + "version": "0.5.0", "description": "A reactive Luau library for creating UI", "main": "src/init.lua", "types": "src/index.d.ts", From 61a33766e0abcfb6474b9eaeed8f8a59948cfe5d Mon Sep 17 00:00:00 2001 From: Richard Date: Fri, 25 Oct 2024 16:57:18 -0700 Subject: [PATCH 03/21] docs: fix typo --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8c00c1f..62426af 100644 --- a/README.md +++ b/README.md @@ -146,15 +146,15 @@ A component that renders its children with the `value` prop assigned to the cont `` is syntax sugar for `context(value, () => children)`. > [!NOTE] -> The context function must be called within the top-level of a component. Calling it within an effect or on a new thread will return the default value. +> The context function must be called within the top-level of a component. Calling it within an effect or on a new thread may return the default value. ```tsx const theme = context("light"); {() => { - const currentTheme = context(); - return ; + const value = theme(); + return ; }} ; ``` From 03e9c1dc9465f9c932f9e98af5f57ef11edb56ce Mon Sep 17 00:00:00 2001 From: Richard Date: Mon, 25 Nov 2024 18:30:32 -0800 Subject: [PATCH 04/21] fix: check for single case in `` --- src/components.luau | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components.luau b/src/components.luau index 46b902e..f61a5f1 100644 --- a/src/components.luau +++ b/src/components.luau @@ -32,10 +32,15 @@ local function Switch(props: { condition: () -> any, children: { Case }, }) + local children = props.children :: { [any]: any } local map = {} - for _, node in props.children do - map[node.match] = node.children + if children.match then + map[children.match] = children.children + else + for _, node in children do + map[node.match] = node.children + end end return switch(props.condition)(map) From 32da4a68d83775b7a7ccb5bd88dcb983d235f34c Mon Sep 17 00:00:00 2001 From: Richard Date: Mon, 25 Nov 2024 18:30:49 -0800 Subject: [PATCH 05/21] 0.5.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 74d5b78..e206aa9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rbxts/vide", - "version": "0.5.0", + "version": "0.5.1", "description": "A reactive Luau library for creating UI", "main": "src/init.lua", "types": "src/index.d.ts", From 7fea2d44ec8fe6e1624bb6efb5bf9214677aa017 Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 1 Dec 2024 00:55:49 -0800 Subject: [PATCH 06/21] fix: add drag detector tag --- src/tags.luau | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tags.luau b/src/tags.luau index bbc6468..84c0871 100644 --- a/src/tags.luau +++ b/src/tags.luau @@ -234,6 +234,7 @@ local classNames = { "TrussPart", "UIAspectRatioConstraint", "UICorner", + "UIDragDetector", "UIFlexItem", "UIGradient", "UIGridLayout", From d1cf6b79901094e4bb2771118a45c28b2b9026dd Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 1 Dec 2024 00:56:00 -0800 Subject: [PATCH 07/21] 0.5.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e206aa9..f411e7c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rbxts/vide", - "version": "0.5.1", + "version": "0.5.2", "description": "A reactive Luau library for creating UI", "main": "src/init.lua", "types": "src/index.d.ts", From 4dfeaebb0e172fdd4b4cb0371b048ed415a759c8 Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 19 Dec 2024 10:51:02 -0800 Subject: [PATCH 08/21] fix: cast `Table` generic type to valid key --- src/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.d.ts b/src/index.d.ts index ec7a721..b5ae55b 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -1,6 +1,6 @@ type Destructor = () => void; type Key = string | number | symbol; -type Table = Map | ReadonlyMap | { readonly [P in Extract]: V }; +type Table = Map | ReadonlyMap | { readonly [P in K as Key]: V }; export = Vide; export as namespace Vide; From c1be60f6c44340d5a058c751be83fb5476976cb0 Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 19 Dec 2024 10:51:14 -0800 Subject: [PATCH 09/21] 0.5.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f411e7c..42f35b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rbxts/vide", - "version": "0.5.2", + "version": "0.5.3", "description": "A reactive Luau library for creating UI", "main": "src/init.lua", "types": "src/index.d.ts", From 976d38cef3ce66140630412f217a9bf0cdd41aa6 Mon Sep 17 00:00:00 2001 From: Richard Date: Sat, 25 Jan 2025 16:46:35 -0800 Subject: [PATCH 10/21] fix: add overloads for objects with index signatures --- src/index.d.ts | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index b5ae55b..ea1e3af 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -1,6 +1,5 @@ type Destructor = () => void; type Key = string | number | symbol; -type Table = Map | ReadonlyMap | { readonly [P in K as Key]: V }; export = Vide; export as namespace Vide; @@ -245,8 +244,16 @@ declare namespace Vide { */ // overload for an array input function indexes(input: () => readonly VI[], transform: (value: () => VI, index: number) => VO): () => VO[]; - // overload for a map or object input - function indexes(input: () => Table, transform: (value: () => VI, key: K) => VO): () => VO[]; + // overload for a map input + function indexes( + input: () => Map | ReadonlyMap, + transform: (value: () => VI, key: K) => VO, + ): () => VO[]; + // overload for an object input + function indexes( + input: () => { readonly [P in K]: VI }, + transform: (value: () => VI, key: K) => VO, + ): () => VO[]; /** * Maps each _value_ in a table source to a component. Returns a source @@ -273,8 +280,16 @@ declare namespace Vide { */ // overload for an array input function values(input: () => readonly VI[], transform: (value: VI, index: () => number) => VO): () => VO[]; - // overload for a map or object input - function values(input: () => Table, transform: (value: VI, key: () => K) => VO): () => VO[]; + // overload for a map input + function values( + input: () => Map | ReadonlyMap, + transform: (value: VI, key: () => K) => VO, + ): () => VO[]; + // overload for an object input + function values( + input: () => { readonly [P in K]: VI }, + transform: (value: VI, key: () => K) => VO, + ): () => VO[]; /** * Runs the callback function when the scope reruns or is destroyed. Should @@ -430,9 +445,14 @@ declare namespace Vide { each: () => readonly VI[]; children: (item: VI, index: () => number) => VO; }): () => VO[]; - // overload for a map or object input + // overload for a map input function For(props: { - each: () => Table; + each: () => Map | ReadonlyMap; + children: (value: VI, key: () => K) => VO; + }): () => VO[]; + // overload for an object input + function For(props: { + each: () => { readonly [P in K]: VI }; children: (value: VI, key: () => K) => VO; }): () => VO[]; @@ -466,9 +486,14 @@ declare namespace Vide { each: () => readonly VI[]; children: (item: () => VI, index: number) => VO; }): () => VO[]; - // overload for a map or object input + // overload for a map input function Index(props: { - each: () => Table; + each: () => Map | ReadonlyMap; + children: (value: () => VI, key: K) => VO; + }): () => VO[]; + // overload for an object input + function Index(props: { + each: () => { readonly [P in K]: VI }; children: (value: () => VI, key: K) => VO; }): () => VO[]; From bb4db8e9a67bea266a4a03daf8420dcc4cf80a4b Mon Sep 17 00:00:00 2001 From: Richard Date: Sat, 25 Jan 2025 16:46:44 -0800 Subject: [PATCH 11/21] 0.5.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 42f35b6..cdbcfe7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rbxts/vide", - "version": "0.5.3", + "version": "0.5.4", "description": "A reactive Luau library for creating UI", "main": "src/init.lua", "types": "src/index.d.ts", From 2312b64902eab3a4cf41eeae8a425cdb79cc5e25 Mon Sep 17 00:00:00 2001 From: littensy <56808540+littensy@users.noreply.github.com> Date: Sat, 8 Feb 2025 16:26:38 -0800 Subject: [PATCH 12/21] fix: insert actions after iterating over props --- src/jsx.luau | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/jsx.luau b/src/jsx.luau index 22e5749..0bbf8f0 100644 --- a/src/jsx.luau +++ b/src/jsx.luau @@ -27,6 +27,8 @@ local function jsx(tag: string | (Props) -> any, props: Props, ...): any if type(tag) == "string" then tag = tags[tag] or tag + local actions = {} + for key, value in props do if type(key) ~= "string" or IGNORED_CHANGE_PROPS[key] then continue @@ -35,11 +37,15 @@ local function jsx(tag: string | (Props) -> any, props: Props, ...): any local property = string.match(key, "^(.+)Changed$") if property then - table.insert(props, changed(property, value)) + table.insert(actions, changed(property, value)) props[key] = nil end end + for _, action in actions do + table.insert(props, action) + end + if props.action then table.insert(props, action(props.action)) props.action = nil From b67dacdebb172b319dfb9352456edd542a4163f4 Mon Sep 17 00:00:00 2001 From: littensy <56808540+littensy@users.noreply.github.com> Date: Sat, 8 Feb 2025 16:26:51 -0800 Subject: [PATCH 13/21] 0.5.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cdbcfe7..2992a9f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rbxts/vide", - "version": "0.5.4", + "version": "0.5.5", "description": "A reactive Luau library for creating UI", "main": "src/init.lua", "types": "src/index.d.ts", From 7f6a97bb97610bc9eeb98604c134f4289296209a Mon Sep 17 00:00:00 2001 From: Justice Almanzar Date: Sun, 16 Feb 2025 17:53:28 -0500 Subject: [PATCH 14/21] feat: untrack jsx components by default (#5) * untrack jsx components by default * lint fix? * return --- src/jsx.luau | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/jsx.luau b/src/jsx.luau index 0bbf8f0..962670e 100644 --- a/src/jsx.luau +++ b/src/jsx.luau @@ -2,6 +2,7 @@ local action = require(script.Parent.action)() local changed = require(script.Parent.changed) local create = require(script.Parent.create) local tags = require(script.Parent.tags) +local untrack = require(script.Parent.untrack) type Props = { [any]: any } @@ -67,7 +68,9 @@ local function jsx(tag: string | (Props) -> any, props: Props, ...): any props.children = ... end - return tag(props) + return untrack(function() + return tag(props) + end) end return jsx From dd007672611bbfab914a8d674e172288ebef8650 Mon Sep 17 00:00:00 2001 From: littensy <56808540+littensy@users.noreply.github.com> Date: Thu, 20 Feb 2025 21:38:43 -0800 Subject: [PATCH 15/21] 0.5.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2992a9f..eaafca8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rbxts/vide", - "version": "0.5.5", + "version": "0.5.6", "description": "A reactive Luau library for creating UI", "main": "src/init.lua", "types": "src/index.d.ts", From 52b63aff35c11bc93d0e30e9660a9d3443e2b588 Mon Sep 17 00:00:00 2001 From: littensy <56808540+littensy@users.noreply.github.com> Date: Tue, 18 Mar 2025 22:47:47 -0700 Subject: [PATCH 16/21] fix: make children prop optional --- src/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.d.ts b/src/index.d.ts index ea1e3af..688b476 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -34,7 +34,7 @@ declare namespace Vide { /** * Utility type for a component that accepts `children` as a prop. */ - type PropsWithChildren = Props & { children: Node }; + type PropsWithChildren = Props & { children?: Node }; /** * An object containing the custom logic to invoke when an instance is From f2547dc0ad8fe0ee5d1477b25a50f9f9aa353469 Mon Sep 17 00:00:00 2001 From: littensy <56808540+littensy@users.noreply.github.com> Date: Tue, 18 Mar 2025 22:47:54 -0700 Subject: [PATCH 17/21] 0.5.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eaafca8..c7752ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rbxts/vide", - "version": "0.5.6", + "version": "0.5.7", "description": "A reactive Luau library for creating UI", "main": "src/init.lua", "types": "src/index.d.ts", From f4e686dfc88fc8c1601a8ab42f109e397d1ce51e Mon Sep 17 00:00:00 2001 From: dai Date: Fri, 22 Aug 2025 00:47:59 +0200 Subject: [PATCH 18/21] feat: use rbxts Instances type (#6) --- src/index.d.ts | 415 +++++++++++++++++++++++++------------------------ 1 file changed, 209 insertions(+), 206 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index 688b476..75074dd 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -713,6 +713,213 @@ declare namespace Vide { InstanceEventCallbacks; } +type SupportedInstances = + | "accessory" + | "accessorydescription" + | "accoutrement" + | "actor" + | "adgui" + | "adportal" + | "aircontroller" + | "alignorientation" + | "alignposition" + | "angularvelocity" + | "animation" + | "animationconstraint" + | "animationcontroller" + | "animationrigdata" + | "animator" + | "archandles" + | "atmosphere" + | "attachment" + | "audioanalyzer" + | "audiochorus" + | "audiocompressor" + | "audiodeviceinput" + | "audiodeviceoutput" + | "audiodistortion" + | "audioecho" + | "audioemitter" + | "audioequalizer" + | "audiofader" + | "audioflanger" + | "audiolistener" + | "audiopitchshifter" + | "audioplayer" + | "audioreverb" + | "ballsocketconstraint" + | "beam" + | "billboardgui" + | "blockmesh" + | "bloomeffect" + | "blureffect" + | "bodyangularvelocity" + | "bodycolors" + | "bodyforce" + | "bodygyro" + | "bodyposition" + | "bodythrust" + | "bodyvelocity" + | "bone" + | "boolvalue" + | "boxhandleadornment" + | "brickcolorvalue" + | "buoyancysensor" + | "camera" + | "canvasgroup" + | "cframevalue" + | "charactermesh" + | "chorussoundeffect" + | "clickdetector" + | "climbcontroller" + | "clouds" + | "color3value" + | "colorcorrectioneffect" + | "compressorsoundeffect" + | "conehandleadornment" + | "configuration" + | "controllermanager" + | "controllerpartsensor" + | "cornerwedgepart" + | "curveanimation" + | "cylinderhandleadornment" + | "cylindermesh" + | "cylindricalconstraint" + | "decal" + | "depthoffieldeffect" + | "distortionsoundeffect" + | "doubleconstrainedvalue" + | "dragdetector" + | "dragger" + | "echosoundeffect" + | "editableimage" + | "editablemesh" + | "equalizersoundeffect" + | "eulerrotationcurve" + | "facecontrols" + | "fire" + | "flangesoundeffect" + | "floatcurve" + | "floorwire" + | "folder" + | "forcefield" + | "frame" + | "groundcontroller" + | "handles" + | "highlight" + | "hingeconstraint" + | "hole" + | "humanoid" + | "humanoidcontroller" + | "humanoiddescription" + | "ikcontrol" + | "imagebutton" + | "imagehandleadornment" + | "imagelabel" + | "intconstrainedvalue" + | "intvalue" + | "keyframe" + | "keyframemarker" + | "keyframesequence" + | "linearvelocity" + | "lineforce" + | "linehandleadornment" + | "localizationtable" + | "markercurve" + | "materialvariant" + | "model" + | "motor" + | "motor6d" + | "nocollisionconstraint" + | "numberpose" + | "numbervalue" + | "objectvalue" + | "pants" + | "part" + | "particleemitter" + | "pitchshiftsoundeffect" + | "planeconstraint" + | "pointlight" + | "pose" + | "prismaticconstraint" + | "proximityprompt" + | "rayvalue" + | "reverbsoundeffect" + | "rigidconstraint" + | "rocketpropulsion" + | "rodconstraint" + | "ropeconstraint" + | "rotationcurve" + | "screengui" + | "scrollingframe" + | "seat" + | "selectionbox" + | "selectionsphere" + | "shirt" + | "shirtgraphic" + | "sky" + | "smoke" + | "sound" + | "soundgroup" + | "sparkles" + | "spawnlocation" + | "specialmesh" + | "spherehandleadornment" + | "spotlight" + | "springconstraint" + | "stringvalue" + | "stylederive" + | "stylelink" + | "stylerule" + | "stylesheet" + | "sunrayseffect" + | "surfaceappearance" + | "surfacegui" + | "surfacelight" + | "surfaceselection" + | "swimcontroller" + | "textbox" + | "textbutton" + | "textlabel" + | "texture" + | "tool" + | "torque" + | "torsionspringconstraint" + | "trail" + | "tremolosoundeffect" + | "trusspart" + | "uiaspectratioconstraint" + | "uicorner" + | "uidragdetector" + | "uiflexitem" + | "uigradient" + | "uigridlayout" + | "uilistlayout" + | "uipadding" + | "uipagelayout" + | "uiscale" + | "uisizeconstraint" + | "uistroke" + | "uitablelayout" + | "uitextsizeconstraint" + | "universalconstraint" + | "vector3curve" + | "vector3value" + | "vectorforce" + | "vehiclecontroller" + | "vehicleseat" + | "velocitymotor" + | "videoframe" + | "viewportframe" + | "wedgepart" + | "weld" + | "weldconstraint" + | "wire" + | "wireframehandleadornment" + | "worldmodel" + | "wraplayer" + | "wraptarget" + declare global { namespace JSX { type Element = Vide.Node; @@ -724,212 +931,8 @@ declare global { children: {}; } - interface IntrinsicElements { - accessory: Vide.InstanceAttributes; - accessorydescription: Vide.InstanceAttributes; - accoutrement: Vide.InstanceAttributes; - actor: Vide.InstanceAttributes; - adgui: Vide.InstanceAttributes; - adportal: Vide.InstanceAttributes; - aircontroller: Vide.InstanceAttributes; - alignorientation: Vide.InstanceAttributes; - alignposition: Vide.InstanceAttributes; - angularvelocity: Vide.InstanceAttributes; - animation: Vide.InstanceAttributes; - animationconstraint: Vide.InstanceAttributes; - animationcontroller: Vide.InstanceAttributes; - animationrigdata: Vide.InstanceAttributes; - animator: Vide.InstanceAttributes; - archandles: Vide.InstanceAttributes; - atmosphere: Vide.InstanceAttributes; - attachment: Vide.InstanceAttributes; - audioanalyzer: Vide.InstanceAttributes; - audiochorus: Vide.InstanceAttributes; - audiocompressor: Vide.InstanceAttributes; - audiodeviceinput: Vide.InstanceAttributes; - audiodeviceoutput: Vide.InstanceAttributes; - audiodistortion: Vide.InstanceAttributes; - audioecho: Vide.InstanceAttributes; - audioemitter: Vide.InstanceAttributes; - audioequalizer: Vide.InstanceAttributes; - audiofader: Vide.InstanceAttributes; - audioflanger: Vide.InstanceAttributes; - audiolistener: Vide.InstanceAttributes; - audiopitchshifter: Vide.InstanceAttributes; - audioplayer: Vide.InstanceAttributes; - audioreverb: Vide.InstanceAttributes; - ballsocketconstraint: Vide.InstanceAttributes; - beam: Vide.InstanceAttributes; - billboardgui: Vide.InstanceAttributes; - blockmesh: Vide.InstanceAttributes; - bloomeffect: Vide.InstanceAttributes; - blureffect: Vide.InstanceAttributes; - bodyangularvelocity: Vide.InstanceAttributes; - bodycolors: Vide.InstanceAttributes; - bodyforce: Vide.InstanceAttributes; - bodygyro: Vide.InstanceAttributes; - bodyposition: Vide.InstanceAttributes; - bodythrust: Vide.InstanceAttributes; - bodyvelocity: Vide.InstanceAttributes; - bone: Vide.InstanceAttributes; - boolvalue: Vide.InstanceAttributes; - boxhandleadornment: Vide.InstanceAttributes; - brickcolorvalue: Vide.InstanceAttributes; - buoyancysensor: Vide.InstanceAttributes; - camera: Vide.InstanceAttributes; - canvasgroup: Vide.InstanceAttributes; - cframevalue: Vide.InstanceAttributes; - charactermesh: Vide.InstanceAttributes; - chorussoundeffect: Vide.InstanceAttributes; - clickdetector: Vide.InstanceAttributes; - climbcontroller: Vide.InstanceAttributes; - clouds: Vide.InstanceAttributes; - color3value: Vide.InstanceAttributes; - colorcorrectioneffect: Vide.InstanceAttributes; - compressorsoundeffect: Vide.InstanceAttributes; - conehandleadornment: Vide.InstanceAttributes; - configuration: Vide.InstanceAttributes; - controllermanager: Vide.InstanceAttributes; - controllerpartsensor: Vide.InstanceAttributes; - cornerwedgepart: Vide.InstanceAttributes; - curveanimation: Vide.InstanceAttributes; - cylinderhandleadornment: Vide.InstanceAttributes; - cylindermesh: Vide.InstanceAttributes; - cylindricalconstraint: Vide.InstanceAttributes; - decal: Vide.InstanceAttributes; - depthoffieldeffect: Vide.InstanceAttributes; - distortionsoundeffect: Vide.InstanceAttributes; - doubleconstrainedvalue: Vide.InstanceAttributes; - dragdetector: Vide.InstanceAttributes; - dragger: Vide.InstanceAttributes; - echosoundeffect: Vide.InstanceAttributes; - editableimage: Vide.InstanceAttributes; - editablemesh: Vide.InstanceAttributes; - equalizersoundeffect: Vide.InstanceAttributes; - eulerrotationcurve: Vide.InstanceAttributes; - facecontrols: Vide.InstanceAttributes; - fire: Vide.InstanceAttributes; - flangesoundeffect: Vide.InstanceAttributes; - floatcurve: Vide.InstanceAttributes; - floorwire: Vide.InstanceAttributes; - folder: Vide.InstanceAttributes; - forcefield: Vide.InstanceAttributes; - frame: Vide.InstanceAttributes; - groundcontroller: Vide.InstanceAttributes; - handles: Vide.InstanceAttributes; - highlight: Vide.InstanceAttributes; - hingeconstraint: Vide.InstanceAttributes; - hole: Vide.InstanceAttributes; - humanoid: Vide.InstanceAttributes; - humanoidcontroller: Vide.InstanceAttributes; - humanoiddescription: Vide.InstanceAttributes; - ikcontrol: Vide.InstanceAttributes; - imagebutton: Vide.InstanceAttributes; - imagehandleadornment: Vide.InstanceAttributes; - imagelabel: Vide.InstanceAttributes; - intconstrainedvalue: Vide.InstanceAttributes; - intvalue: Vide.InstanceAttributes; - keyframe: Vide.InstanceAttributes; - keyframemarker: Vide.InstanceAttributes; - keyframesequence: Vide.InstanceAttributes; - linearvelocity: Vide.InstanceAttributes; - lineforce: Vide.InstanceAttributes; - linehandleadornment: Vide.InstanceAttributes; - localizationtable: Vide.InstanceAttributes; - markercurve: Vide.InstanceAttributes; - materialvariant: Vide.InstanceAttributes; - model: Vide.InstanceAttributes; - motor: Vide.InstanceAttributes; - motor6d: Vide.InstanceAttributes; - nocollisionconstraint: Vide.InstanceAttributes; - numberpose: Vide.InstanceAttributes; - numbervalue: Vide.InstanceAttributes; - objectvalue: Vide.InstanceAttributes; - pants: Vide.InstanceAttributes; - part: Vide.InstanceAttributes; - particleemitter: Vide.InstanceAttributes; - pitchshiftsoundeffect: Vide.InstanceAttributes; - planeconstraint: Vide.InstanceAttributes; - pointlight: Vide.InstanceAttributes; - pose: Vide.InstanceAttributes; - prismaticconstraint: Vide.InstanceAttributes; - proximityprompt: Vide.InstanceAttributes; - rayvalue: Vide.InstanceAttributes; - reverbsoundeffect: Vide.InstanceAttributes; - rigidconstraint: Vide.InstanceAttributes; - rocketpropulsion: Vide.InstanceAttributes; - rodconstraint: Vide.InstanceAttributes; - ropeconstraint: Vide.InstanceAttributes; - rotationcurve: Vide.InstanceAttributes; - screengui: Vide.InstanceAttributes; - scrollingframe: Vide.InstanceAttributes; - seat: Vide.InstanceAttributes; - selectionbox: Vide.InstanceAttributes; - selectionsphere: Vide.InstanceAttributes; - shirt: Vide.InstanceAttributes; - shirtgraphic: Vide.InstanceAttributes; - sky: Vide.InstanceAttributes; - smoke: Vide.InstanceAttributes; - sound: Vide.InstanceAttributes; - soundgroup: Vide.InstanceAttributes; - sparkles: Vide.InstanceAttributes; - spawnlocation: Vide.InstanceAttributes; - specialmesh: Vide.InstanceAttributes; - spherehandleadornment: Vide.InstanceAttributes; - spotlight: Vide.InstanceAttributes; - springconstraint: Vide.InstanceAttributes; - stringvalue: Vide.InstanceAttributes; - stylederive: Vide.InstanceAttributes; - stylelink: Vide.InstanceAttributes; - stylerule: Vide.InstanceAttributes; - stylesheet: Vide.InstanceAttributes; - sunrayseffect: Vide.InstanceAttributes; - surfaceappearance: Vide.InstanceAttributes; - surfacegui: Vide.InstanceAttributes; - surfacelight: Vide.InstanceAttributes; - surfaceselection: Vide.InstanceAttributes; - swimcontroller: Vide.InstanceAttributes; - textbox: Vide.InstanceAttributes; - textbutton: Vide.InstanceAttributes; - textlabel: Vide.InstanceAttributes; - texture: Vide.InstanceAttributes; - tool: Vide.InstanceAttributes; - torque: Vide.InstanceAttributes; - torsionspringconstraint: Vide.InstanceAttributes; - trail: Vide.InstanceAttributes; - tremolosoundeffect: Vide.InstanceAttributes; - trusspart: Vide.InstanceAttributes; - uiaspectratioconstraint: Vide.InstanceAttributes; - uicorner: Vide.InstanceAttributes; - uidragdetector: Vide.InstanceAttributes; - uiflexitem: Vide.InstanceAttributes; - uigradient: Vide.InstanceAttributes; - uigridlayout: Vide.InstanceAttributes; - uilistlayout: Vide.InstanceAttributes; - uipadding: Vide.InstanceAttributes; - uipagelayout: Vide.InstanceAttributes; - uiscale: Vide.InstanceAttributes; - uisizeconstraint: Vide.InstanceAttributes; - uistroke: Vide.InstanceAttributes; - uitablelayout: Vide.InstanceAttributes; - uitextsizeconstraint: Vide.InstanceAttributes; - universalconstraint: Vide.InstanceAttributes; - vector3curve: Vide.InstanceAttributes; - vector3value: Vide.InstanceAttributes; - vectorforce: Vide.InstanceAttributes; - vehiclecontroller: Vide.InstanceAttributes; - vehicleseat: Vide.InstanceAttributes; - velocitymotor: Vide.InstanceAttributes; - videoframe: Vide.InstanceAttributes; - viewportframe: Vide.InstanceAttributes; - wedgepart: Vide.InstanceAttributes; - weld: Vide.InstanceAttributes; - weldconstraint: Vide.InstanceAttributes; - wire: Vide.InstanceAttributes; - wireframehandleadornment: Vide.InstanceAttributes; - worldmodel: Vide.InstanceAttributes; - wraplayer: Vide.InstanceAttributes; - wraptarget: Vide.InstanceAttributes; + type IntrinsicElements = { + [K in keyof Instances as Lowercase extends SupportedInstances ? Lowercase : K]: Instances[K] extends Instance ? Vide.InstanceAttributes : never } } } From 2bff6d02a2b266651460dd3b3700aa4cd98ce8f7 Mon Sep 17 00:00:00 2001 From: daimond113 Date: Tue, 18 Nov 2025 15:09:38 +0100 Subject: [PATCH 19/21] Switch to ReflectionService --- src/index.d.ts | 209 +------------------------------------ src/tags.luau | 278 +------------------------------------------------ 2 files changed, 3 insertions(+), 484 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index 75074dd..b1de014 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -713,213 +713,6 @@ declare namespace Vide { InstanceEventCallbacks; } -type SupportedInstances = - | "accessory" - | "accessorydescription" - | "accoutrement" - | "actor" - | "adgui" - | "adportal" - | "aircontroller" - | "alignorientation" - | "alignposition" - | "angularvelocity" - | "animation" - | "animationconstraint" - | "animationcontroller" - | "animationrigdata" - | "animator" - | "archandles" - | "atmosphere" - | "attachment" - | "audioanalyzer" - | "audiochorus" - | "audiocompressor" - | "audiodeviceinput" - | "audiodeviceoutput" - | "audiodistortion" - | "audioecho" - | "audioemitter" - | "audioequalizer" - | "audiofader" - | "audioflanger" - | "audiolistener" - | "audiopitchshifter" - | "audioplayer" - | "audioreverb" - | "ballsocketconstraint" - | "beam" - | "billboardgui" - | "blockmesh" - | "bloomeffect" - | "blureffect" - | "bodyangularvelocity" - | "bodycolors" - | "bodyforce" - | "bodygyro" - | "bodyposition" - | "bodythrust" - | "bodyvelocity" - | "bone" - | "boolvalue" - | "boxhandleadornment" - | "brickcolorvalue" - | "buoyancysensor" - | "camera" - | "canvasgroup" - | "cframevalue" - | "charactermesh" - | "chorussoundeffect" - | "clickdetector" - | "climbcontroller" - | "clouds" - | "color3value" - | "colorcorrectioneffect" - | "compressorsoundeffect" - | "conehandleadornment" - | "configuration" - | "controllermanager" - | "controllerpartsensor" - | "cornerwedgepart" - | "curveanimation" - | "cylinderhandleadornment" - | "cylindermesh" - | "cylindricalconstraint" - | "decal" - | "depthoffieldeffect" - | "distortionsoundeffect" - | "doubleconstrainedvalue" - | "dragdetector" - | "dragger" - | "echosoundeffect" - | "editableimage" - | "editablemesh" - | "equalizersoundeffect" - | "eulerrotationcurve" - | "facecontrols" - | "fire" - | "flangesoundeffect" - | "floatcurve" - | "floorwire" - | "folder" - | "forcefield" - | "frame" - | "groundcontroller" - | "handles" - | "highlight" - | "hingeconstraint" - | "hole" - | "humanoid" - | "humanoidcontroller" - | "humanoiddescription" - | "ikcontrol" - | "imagebutton" - | "imagehandleadornment" - | "imagelabel" - | "intconstrainedvalue" - | "intvalue" - | "keyframe" - | "keyframemarker" - | "keyframesequence" - | "linearvelocity" - | "lineforce" - | "linehandleadornment" - | "localizationtable" - | "markercurve" - | "materialvariant" - | "model" - | "motor" - | "motor6d" - | "nocollisionconstraint" - | "numberpose" - | "numbervalue" - | "objectvalue" - | "pants" - | "part" - | "particleemitter" - | "pitchshiftsoundeffect" - | "planeconstraint" - | "pointlight" - | "pose" - | "prismaticconstraint" - | "proximityprompt" - | "rayvalue" - | "reverbsoundeffect" - | "rigidconstraint" - | "rocketpropulsion" - | "rodconstraint" - | "ropeconstraint" - | "rotationcurve" - | "screengui" - | "scrollingframe" - | "seat" - | "selectionbox" - | "selectionsphere" - | "shirt" - | "shirtgraphic" - | "sky" - | "smoke" - | "sound" - | "soundgroup" - | "sparkles" - | "spawnlocation" - | "specialmesh" - | "spherehandleadornment" - | "spotlight" - | "springconstraint" - | "stringvalue" - | "stylederive" - | "stylelink" - | "stylerule" - | "stylesheet" - | "sunrayseffect" - | "surfaceappearance" - | "surfacegui" - | "surfacelight" - | "surfaceselection" - | "swimcontroller" - | "textbox" - | "textbutton" - | "textlabel" - | "texture" - | "tool" - | "torque" - | "torsionspringconstraint" - | "trail" - | "tremolosoundeffect" - | "trusspart" - | "uiaspectratioconstraint" - | "uicorner" - | "uidragdetector" - | "uiflexitem" - | "uigradient" - | "uigridlayout" - | "uilistlayout" - | "uipadding" - | "uipagelayout" - | "uiscale" - | "uisizeconstraint" - | "uistroke" - | "uitablelayout" - | "uitextsizeconstraint" - | "universalconstraint" - | "vector3curve" - | "vector3value" - | "vectorforce" - | "vehiclecontroller" - | "vehicleseat" - | "velocitymotor" - | "videoframe" - | "viewportframe" - | "wedgepart" - | "weld" - | "weldconstraint" - | "wire" - | "wireframehandleadornment" - | "worldmodel" - | "wraplayer" - | "wraptarget" - declare global { namespace JSX { type Element = Vide.Node; @@ -932,7 +725,7 @@ declare global { } type IntrinsicElements = { - [K in keyof Instances as Lowercase extends SupportedInstances ? Lowercase : K]: Instances[K] extends Instance ? Vide.InstanceAttributes : never + [K in keyof Instances as Lowercase]: Instances[K] extends Instance ? Vide.InstanceAttributes : never } } } diff --git a/src/tags.luau b/src/tags.luau index 84c0871..6248cf5 100644 --- a/src/tags.luau +++ b/src/tags.luau @@ -1,281 +1,7 @@ -local classNames = { - "Accessory", - "AccessoryDescription", - "Accoutrement", - "Actor", - "AdGui", - "AdPortal", - "AirController", - "AlignOrientation", - "AlignPosition", - "AngularVelocity", - "Animation", - "AnimationConstraint", - "AnimationController", - "AnimationRigData", - "Animator", - "ArcHandles", - "Atmosphere", - "Attachment", - "AudioAnalyzer", - "AudioChorus", - "AudioCompressor", - "AudioDeviceInput", - "AudioDeviceOutput", - "AudioDistortion", - "AudioEcho", - "AudioEmitter", - "AudioEqualizer", - "AudioFader", - "AudioFlanger", - "AudioListener", - "AudioPitchShifter", - "AudioPlayer", - "AudioReverb", - "AudioSearchParams", - "Backpack", - "BallSocketConstraint", - "Beam", - "BillboardGui", - "BindableEvent", - "BindableFunction", - "BlockMesh", - "BloomEffect", - "BlurEffect", - "BodyAngularVelocity", - "BodyColors", - "BodyForce", - "BodyGyro", - "BodyPartDescription", - "BodyPosition", - "BodyThrust", - "BodyVelocity", - "Bone", - "BoolValue", - "BoxHandleAdornment", - "Breakpoint", - "BrickColorValue", - "BubbleChatMessageProperties", - "BuoyancySensor", - "Camera", - "CanvasGroup", - "CFrameValue", - "CharacterMesh", - "ChorusSoundEffect", - "ClickDetector", - "ClimbController", - "Clouds", - "Color3Value", - "ColorCorrectionEffect", - "CompressorSoundEffect", - "ConeHandleAdornment", - "Configuration", - "ControllerManager", - "ControllerPartSensor", - "CornerWedgePart", - "CurveAnimation", - "CylinderHandleAdornment", - "CylinderMesh", - "CylindricalConstraint", - "DataStoreGetOptions", - "DataStoreIncrementOptions", - "DataStoreOptions", - "DataStoreSetOptions", - "Decal", - "DepthOfFieldEffect", - "Dialog", - "DialogChoice", - "DistortionSoundEffect", - "DoubleConstrainedValue", - "DragDetector", - "Dragger", - "EchoSoundEffect", - "EditableImage", - "EditableMesh", - "EqualizerSoundEffect", - "EulerRotationCurve", - "ExperienceInviteOptions", - "Explosion", - "FaceControls", - "FileMesh", - "Fire", - "FlangeSoundEffect", - "FloatCurve", - "FloorWire", - "Folder", - "ForceField", - "Frame", - "GetTextBoundsParams", - "Glue", - "GroundController", - "Handles", - "Hat", - "HiddenSurfaceRemovalAsset", - "Highlight", - "HingeConstraint", - "Hole", - "Humanoid", - "HumanoidController", - "HumanoidDescription", - "IKControl", - "ImageButton", - "ImageHandleAdornment", - "ImageLabel", - "IntConstrainedValue", - "InternalSyncItem", - "IntersectOperation", - "IntValue", - "Keyframe", - "KeyframeMarker", - "KeyframeSequence", - "LinearVelocity", - "LineForce", - "LineHandleAdornment", - "LocalizationTable", - "LocalScript", - "ManualGlue", - "ManualWeld", - "MarkerCurve", - "MaterialVariant", - "MeshPart", - "Model", - "ModuleScript", - "Motor", - "Motor6D", - "MotorFeature", - "NegateOperation", - "NoCollisionConstraint", - "NumberPose", - "NumberValue", - "ObjectValue", - "OperationGraph", - "Pants", - "Part", - "ParticleEmitter", - "PartOperation", - "Path2D", - "PathfindingLink", - "PathfindingModifier", - "PitchShiftSoundEffect", - "Plane", - "PlaneConstraint", - "PluginCapabilities", - "PointLight", - "Pose", - "PrismaticConstraint", - "ProximityPrompt", - "RayValue", - "RemoteEvent", - "RemoteFunction", - "ReverbSoundEffect", - "RigidConstraint", - "RobloxEditableImage", - "RocketPropulsion", - "RodConstraint", - "RopeConstraint", - "Rotate", - "RotateP", - "RotateV", - "RotationCurve", - "ScreenGui", - "Script", - "ScrollingFrame", - "Seat", - "SelectionBox", - "SelectionPartLasso", - "SelectionPointLasso", - "SelectionSphere", - "Shirt", - "ShirtGraphic", - "SkateboardController", - "SkateboardPlatform", - "Sky", - "Smoke", - "Snap", - "Sound", - "SoundGroup", - "Sparkles", - "SpawnLocation", - "SpecialMesh", - "SphereHandleAdornment", - "SpotLight", - "SpringConstraint", - "StarterGear", - "StringValue", - "StudioAttachment", - "StudioCallout", - "StyleDerive", - "StyleLink", - "StyleRule", - "StyleSheet", - "SunRaysEffect", - "SurfaceAppearance", - "SurfaceGui", - "SurfaceLight", - "SurfaceSelection", - "SwimController", - "Team", - "TeleportOptions", - "TerrainDetail", - "TerrainRegion", - "TextBox", - "TextButton", - "TextChannel", - "TextChatCommand", - "TextChatMessageProperties", - "TextLabel", - "Texture", - "Tool", - "Torque", - "TorsionSpringConstraint", - "TrackerStreamAnimation", - "Trail", - "TremoloSoundEffect", - "TrussPart", - "UIAspectRatioConstraint", - "UICorner", - "UIDragDetector", - "UIFlexItem", - "UIGradient", - "UIGridLayout", - "UIListLayout", - "UIPadding", - "UIPageLayout", - "UIScale", - "UISizeConstraint", - "UIStroke", - "UITableLayout", - "UITextSizeConstraint", - "UnionOperation", - "UniversalConstraint", - "UnreliableRemoteEvent", - "UserNotification", - "UserNotificationPayload", - "UserNotificationPayloadAnalyticsData", - "UserNotificationPayloadJoinExperience", - "UserNotificationPayloadParameterValue", - "Vector3Curve", - "Vector3Value", - "VectorForce", - "VehicleController", - "VehicleSeat", - "VelocityMotor", - "VideoFrame", - "ViewportFrame", - "WedgePart", - "Weld", - "WeldConstraint", - "Wire", - "WireframeHandleAdornment", - "WorldModel", - "WrapLayer", - "WrapTarget", -} - local tags = {} -for _, className in classNames do - tags[string.lower(className)] = className +for _, class in game:GetService("ReflectionService"):GetClasses() do + tags[string.lower(class.Name)] = class.Name end return tags From 9b4a2c19b4694b18fa36b46167121b587fb28cdc Mon Sep 17 00:00:00 2001 From: daimond113 Date: Tue, 18 Nov 2025 15:21:19 +0100 Subject: [PATCH 20/21] fix: switch to CreatableInstances --- src/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.d.ts b/src/index.d.ts index b1de014..6ee0213 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -725,7 +725,7 @@ declare global { } type IntrinsicElements = { - [K in keyof Instances as Lowercase]: Instances[K] extends Instance ? Vide.InstanceAttributes : never + [K in keyof CreatableInstances as Lowercase]: Vide.InstanceAttributes; } } } From d95964db59062d0c9b5e8978aebef597b95d58a0 Mon Sep 17 00:00:00 2001 From: daimond113 Date: Tue, 18 Nov 2025 16:11:53 +0100 Subject: [PATCH 21/21] fix: index CreatableInstances --- src/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.d.ts b/src/index.d.ts index 6ee0213..a732714 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -725,7 +725,7 @@ declare global { } type IntrinsicElements = { - [K in keyof CreatableInstances as Lowercase]: Vide.InstanceAttributes; + [K in keyof CreatableInstances as Lowercase]: Vide.InstanceAttributes; } } }