Digital-Alchemy-TS / code-glue

Top secret stuff
1 stars 0 forks source link

Shared variable runtime checks #21

Open zoe-codez opened 2 weeks ago

zoe-codez commented 2 weeks ago

🪤 Context

There isn't any enforcement in the shared variables system that the value received is actually matches the type definitions that are declared. The easiest path to resolving this would be finding a way to integrate ts-runtime-checks.

In theory... should be able to take the provided type definitions from the user, convert those to a validation function (pre-compute), then use that logic to validate every set

📬 Caveats

Maybe as a strict mode? Unclear on the level of overlap with just regular type checking being used to block the code from running in the first place.

idea pile item

linear[bot] commented 2 weeks ago

CG-1 Shared variable runtime checks

chrisdrackett commented 2 weeks ago

I remember we looked into this when doing form generation, but its been 4 or 5 years. I'll try and dig up my notes :D

zoe-codez commented 2 weeks ago

Gotta check this out! - https://googlefeud.github.io/ts-runtime-checks/playground/

Think it's possible to pre-compute a validation function based on used provided type definitions by leveraging that library. Crazy cool project, you can get REALLY complex definitions before it starts breaking down