roblox-ts

R

roblox-ts

Join the community to ask questions about roblox-ts and get answers from other members.

Join

I am so confused about the type, it should be "string" but it says it can't be any

``ts public getHashCode(): number { const { X, Y, Z } = this.position; const positionString: string = ${X}${Y}${Z}`; ...

Readonly Charm atom

Hello, For the context I am creating a service that manage goals as abstract as possible, having a progress and goal numeric value, getting completed when progress reach goal. So I want other services creating the goal to be able to know when this goal progress and so I thought about using atom for progress value (why not also goal value) but returning the atom would mean the other service could change the atom value, is it possible to have a readonly version of this atom?...
Solution:
return function()
return atom()
end
return function()
return atom()
end
...

Compiler error with reflection transformer

So, after add the rbxts-transformer-reflection transformer in the plugins json i got this error (im pretty new on this so i dont know why i get this error and srry for my bad english)
No description

Test Post

please ignore
Solution:
this is the solution

Profiling Slow Roblox-TS Compilation

Is there any profiling tool that would allow me to identify compilation hotspots in my roblox-ts codebase? I have tried enabling options like incremental compiling in tsconfig and it helped slightly but I still have to wait at least a whole second after saving a file for rbxtsc watch to finish compiling my code and then Rojo syncing it. A tool to help me diagnose slow compilation in my codebase may help me increase compilation speed without doing tedious tasks like annotating the return type of every function. I've attached a video of me making a change in a single file of my codebase and showing the 1-2 second delay in compilation. When I'm trying to make quick changes, it is a real hassle to tab into Roblox Studio and having to wait until Rojo syncs to be to playtest with the changes I made. I just want to be able to tab into Studio and immediately press F5 to go into play mode, like I can with my Luau codebases....

React and Vide

I have both react and vide in my project because I am using jabby and react for my own UI. It is forwarding the global to vide which is really weird and how would I change it so it only points to react globals
No description

tables cannot be cyclic

Hello, I got this error and I am not really sure about how to fix it ```ts private pickItem(item: Instance | undefined) { print("ppick up hell yea");...

Serializer<T>.serialize() yielding

everything after "serializing..." is not printing, indicating that serialize() is yielding. i have fiddled around with the schema types to no avail.
No description

Asphalt can't upload asset

``` [WARN asphalt::sync::perform] Failed to sync asset assets/UI/SlotPart.svg: Failed to upload asset Caused by: Failed to get image ID Caused by: Failed to parse asset delivery response Caused by: error decoding response body...

[SOLVED] Confused about OOP

I have method like this which works weirdly ```ts addItem(Item: new (...args: never[]) => Item) { if (this.item === undefined) { this.item = new Item();...

Mocking `loadstring` doesn't work with ui labs with the global mock loadstring

```ts //test.story.ts import fixLoadModule from "common/shared/utils/fix-load-module"; import { runTests } from "common/shared/utils/run-tests"; import { FunctionStory } from "@rbxts/ui-labs";...
No description

New to charm, how would i go about turning this into a state manager?

```ts import { atom } from "@rbxts/charm"; import { Players } from "@rbxts/services"; // Define interfaces for the state...

UI with roblox-ts

Hello! I am new to roblox-ts and I heard about roact for the UI but I see that some tickets have the tag React, and so I am a bit confused on the subject. So I wanted to know what are the good ways or tech to use to make UI with roblox-ts. Thanks in advance!

Using Lastest Jest

The latest vendor uses loadstring, how do you approach writing tests and execute them. I tried littensy's rbxts-jest-test repo and that will give me permission error since loadstring is plugin security. If I was to do this in a storybook with react, it would give me this weird blob of string and a "multiple runtime error". I saw littensy referring to this issue and resetting scripts at runtime. But this doesn't really help in terms of running the code without clicking run
No description

What is considered more optimized?

Changing the visible value or making the element optional ex: {display && <imagebutton/>} or <imagebutton Visible={display} />...

I keep getting this error when trying to publish packages

npm notice Publishing to https://registry.npmjs.org/ with tag latest and public access npm ERR! code E404 npm ERR! 404 Not Found - PUT https://registry.npmjs.org/@rbxts%2fnext-roblox - Not found npm ERR! 404 npm ERR! 404 '@rbxts/[email protected]' is not in this registry....
Next