You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the process, I found out that VITE's TypeScript2 plugin doesn't handle TS in Vue, so I added *.vue to the include path of the plugin. It worked, but because it was preprocessed by Vue and stripped of the type information, it couldn't generate the completed typia validation function.
However, if you advance the compilation process of TypeScript before the Vue plugin, then the compiler macros of Vue will not work.
So, we need a preprocessor that can run before the vue build process, handle TS with types and emit TS.
Functional implementation
So I tried to make a demo using unplugin, which I only tested on vite. unplugin-vue-typia
I'd like to know your thoughts and suggestions.
The text was updated successfully, but these errors were encountered:
I don't develop vue and front-end applications, so I have no insight into your suggestions. If you think the plugin you created is worthy of being widely distributed to many front-end developers, please send a PR with installation instructions in the document below.
How I got this idea
I want to make a form library that is as convenient as possible and has input validation and error prompts without template code.
He is based on
Typescript
andTypia
, It looks like this to use.In the process, I found out that VITE's
TypeScript2
plugin doesn't handle TS in Vue, so I added *.vue to the include path of the plugin. It worked, but because it was preprocessed by Vue and stripped of the type information, it couldn't generate the completed typia validation function.However, if you advance the compilation process of TypeScript before the Vue plugin, then the compiler macros of Vue will not work.
So, we need a preprocessor that can run before the vue build process, handle TS with types and emit TS.
Functional implementation
So I tried to make a demo using unplugin, which I only tested on vite.
unplugin-vue-typia
I'd like to know your thoughts and suggestions.
The text was updated successfully, but these errors were encountered: