Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to use typia directly without build step as alternative #1006

Open
loynoir opened this issue Mar 16, 2024 · 2 comments
Open

Provide a way to use typia directly without build step as alternative #1006

loynoir opened this issue Mar 16, 2024 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@loynoir
Copy link

loynoir commented Mar 16, 2024

Feature Request

Provide a way to use typia directly without build step as alternative

Comparison

  • jsonschema is good, but ugly to read and write, one can use ajv validator with or without build step

  • @sinclair/typebox generate subset of jsonschema, and reflect awesome types from definition, provides validator without build step. But does not provide easy way to use it AOT.

  • typia is awesome at very easy for typescript user, and provides AOT. But seems must AOT.

Thought

I think, it will be more awesome if provide an easy way to use typia without build step.

Additonal

If I remember correctly, both ajv and typebox use new Function() approach.

@samchon
Copy link
Owner

samchon commented Mar 17, 2024

No way without AOT inn typia.

@samchon samchon self-assigned this Mar 17, 2024
@samchon samchon added the question Further information is requested label Mar 17, 2024
@loynoir
Copy link
Author

loynoir commented Mar 17, 2024

Maybe a nodejs loader?

https://nodejs.org/docs/latest/api/module.html#hooks

Something like https://github.com/privatenumber/tsx?tab=readme-ov-file#%EF%B8%8F-quick-start

$ npx tsx ./script.ts

Compilation is done within loader async load() when needed, user don't need to run build command.

$ export NODE_OPTIONS='--loader typia-loader --loader loader-from-tsx'
$ node ./script-use-typia-directly-without-compile.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants