mihajm
mihajm
Aarktype
Created by mihajm on 11/18/2024 in #questions
Some performance struggles
Dont worry about it we'll figure smthn out 🙂 worst case we dont define EVERY type in the system as a validator 😄 or other solutions like prebuilding the modules
35 replies
Aarktype
Created by mihajm on 11/18/2024 in #questions
Some performance struggles
+ ive already written a few decent size things depending on it..so itd be quite "fun" to extract it
35 replies
Aarktype
Created by mihajm on 11/18/2024 in #questions
Some performance struggles
Cool, will take a shot at rewriting it with .define and hopefuly that solves it 🙂 since otherwise im loving the syntax and extensibility of arktype
35 replies
Aarktype
Created by mihajm on 11/18/2024 in #questions
Some performance struggles
Fair enough so just the amount of branching with ands and ors?
35 replies
Aarktype
Created by mihajm on 11/18/2024 in #questions
Some performance struggles
Yup, would there also be a way of limiting recursion in say a type calling itself?
35 replies
Aarktype
Created by mihajm on 11/18/2024 in #questions
Some performance struggles
Tho a quite a few of them have basically infinite recursion + are just complex so to be expected a bit 🙂
35 replies
Aarktype
Created by mihajm on 11/18/2024 in #questions
Some performance struggles
Yup, we werent using them yet, just had a someone in the team take a crack at rewriting about half our pure TS types to schemas
35 replies
Aarktype
Created by mihajm on 11/18/2024 in #questions
Some performance struggles
Tho I assume a lot of bad stuff was written as I have yet to actually code review the types, for now I just commented them out and am testing strategies on a smaller scale 🙂
35 replies
Aarktype
Created by mihajm on 11/18/2024 in #questions
Some performance struggles
Hmm tbh I've found it pretty ok, the schema itself is good, so I find the entire thing intuitive enough 🙂 but I have yet to type everything again. Smthn was definitely wrong as with vs without defined types our tsc when from 75s to 2.6
35 replies
Aarktype
Created by mihajm on 11/18/2024 in #questions
Some performance struggles
Ah thats perfect then 🙂 ah ill check out type.define then I've simply been creating the schema objects (stuff id pass to type) and marking them as const 🙂
35 replies
Aarktype
Created by mihajm on 11/18/2024 in #questions
Some performance struggles
never mind...further testing shows that the performance is about equivalent 🙂
35 replies
Aarktype
Created by mihajm on 11/18/2024 in #questions
Some performance struggles
& is there any validation diference between something being optional or defined as [smthSchema, '|', "undefined"]? 🙂 cuz that would solve this easily 🙂
35 replies
Aarktype
Created by mihajm on 11/18/2024 in #questions
Some performance struggles
Is there a way to define optional objects in line without using scopes? I've noticed a decent performance uplift when I dont instantiate types until i need them & just define them as constant objects & utility functions that build the constant objects
35 replies
Aarktype
Created by mihajm on 11/18/2024 in #questions
Some performance struggles
I see 🙂 alright I'll give it a good 1-2 and post any outliers if I see them.
35 replies
Aarktype
Created by mihajm on 11/18/2024 in #questions
Some performance struggles
Is the TS server able to cache the infered outputs? Or would providing types as in type<MyType>(...) help? 🙂 yeah these ones i can mold quite a bit, but it had me worried for a second since we have much deeper types in our system 🙂
35 replies
Aarktype
Created by mihajm on 11/18/2024 in #questions
Some performance struggles
Thanks for the tips 🙂 ill mess around with some variations & ts traces tomorrow and hopefully ill be able to find a "fast" solution.
35 replies
Aarktype
Created by mihajm on 10/16/2024 in #questions
Is there a way to morph an optional value back to a required one?
I see, yeah ideally id map them directly as that would be much more efficient than iterating every time. For dx usecases the messages are great, but id love to use the same validators/errors within the forms themselves which is why I ask 🙂 ill keep you posted
20 replies
Aarktype
Created by mihajm on 10/16/2024 in #questions
Is there a way to morph an optional value back to a required one?
Btw is there a way to localize/customize the error messages?
20 replies
Aarktype
Created by mihajm on 10/16/2024 in #questions
Is there a way to morph an optional value back to a required one?
Ah sure, but as you said that would be 1 thing 🙂 that specific form takes in a JsonSchema and then defines a rule schema and N other JsonSchemas. Its basically a way of letting the user define a transform Of A -> B | C and when to do one or the other. But lucky for me the users didnt need all that because my head was exploding from the initial implementation 🙂 either way amazing job on ArkType im gonna get to creating schemas for our larger objects tomorrow so I'm in for some quick learning 😄
20 replies
Aarktype
Created by mihajm on 10/16/2024 in #questions
Is there a way to morph an optional value back to a required one?
No description
20 replies