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
https://github.com/samchon/typia now works with sveltekit via ts-patch which allows it to get its preprocessing done. Recipe below. (needs some duplicate steps removed)
It does this kind of thing: ` // STRICT VALIDATORS export function equals(input: unknown | T): input is T; export function assertEquals(input: unknown | T): T; export function validateEquals(input: unknown | T): IValidation;
// JSON export function assertParse(input: string): T; // type safe parser export function assertStringify(input: T): string; // safe and faster ` etc. by simply using your Typescript efforts and precompiling the hard parts. To me that makes it a great match for svelte.
So question: is there a way to automate this and package it together so it is seamless for svelte users? I am happy to do the hacking if someone can point me in the right direction.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
https://github.com/samchon/typia now works with sveltekit via ts-patch which allows it to get its preprocessing done. Recipe below. (needs some duplicate steps removed)
It does this kind of thing:
`
// STRICT VALIDATORS
export function equals(input: unknown | T): input is T;
export function assertEquals(input: unknown | T): T;
export function validateEquals(input: unknown | T): IValidation;
// JSON
export function assertParse(input: string): T; // type safe parser
export function assertStringify(input: T): string; // safe and faster
`
etc. by simply using your Typescript efforts and precompiling the hard parts. To me that makes it a great match for svelte.
So question: is there a way to automate this and package it together so it is seamless for svelte users? I am happy to do the hacking if someone can point me in the right direction.
RECIPE
npm create svelte@latest
npm install sveltestrap
npm install --save-dev eslint-config-prettier eslint-plugin-prettier
git init
npx typia setup
--compiler (ts-patch)
--manager (npm|pnpm|yarn)
--project {tsconfig.json file path}
npm install --save-dev typescript
npm install --save-dev ts-node
npm install --save-dev ts-patch
npx ts-patch install
npm install --save typescript@latest
npm install --save-dev @rollup/plugin-typescript
vite.config.ts
import typescript from '@rollup/plugin-typescript';
plugins: [sveltekit(), typescript()],
package.json
"scripts": {
"prepare": "ts-patch install”,
tsconfig.json
"compilerOptions": {
"strict": true,
"plugins": [
{
"transform": "typia/lib/transform",
// "functional": true, // validate function type
// "numeric": true, // check
isNaN()andisFinite()}
],
npm run prepare
npm run dev -- --open
Beta Was this translation helpful? Give feedback.
All reactions