Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Standard Schema: スキーマライブラリの統一企画とは何か
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Nozomu Ikuta
May 24, 2025
Technology
2.4k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Standard Schema: スキーマライブラリの統一企画とは何か
TSKaigi 2025 の登壇資料です
Nozomu Ikuta
May 24, 2025
More Decks by Nozomu Ikuta
See All by Nozomu Ikuta
Go 1.24 のイテレータ from byte to bite
nozomuikuta
0
110
Demystifying Vite Internals
nozomuikuta
3
2.9k
Nuxt DevTools 101
nozomuikuta
3
2.2k
Deep Dive to UnJS and Nuxt 3
nozomuikuta
3
3.1k
OSS作者はじめの一歩
nozomuikuta
1
260
2022 年は Docus に注目しよう
nozomuikuta
1
140
Go初学者、最初の1週間の学び
nozomuikuta
1
130
Other Decks in Technology
See All in Technology
【Claude Code】鹿野さんに聞く 私の推しの並行開発環境 大公開 / claude-code-parallel-2026-07-15
tonkotsuboy_com
11
7.1k
End-to-Endで考える信頼性 —LINEアプリにおけるクライアント開発×SRE連携の実践
maruloop
4
4.1k
ruby.wasmとPicoRuby.wasmに対応した仮想DOMライブラリを作ってる話 #kaigieffect_kaigi
sue445
PRO
0
140
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
110k
アカウントが増えてからでは遅い? ~ マルチアカウント統制の勘所 ~
kenichinakamura
0
230
Kaggleで成長するために意識したこと
prgckwb
2
320
クラウド上のデータ復旧で見落としがちな制約: 医療系 SaaS の BCP 設計から得た教訓
kakehashi
PRO
0
3.4k
個人開発で育てる「大規模設計の苗床」 - AI時代の1人開発から始める業務への知識接続 / The Seedbed for Large-Scale Design - From AI-Era Solo Projects to Professional Knowledge
bitkey
PRO
0
170
Claude Code 珍プレー好プレー
shinyasaita
0
330
世界、断片、モデル。そして理解
ardbeg1958
1
110
公式ドキュメントの歩き方etc
coco_se
0
100
DatabricksにおけるMCPソリューション
taka_aki
1
240
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
320
Making Projects Easy
brettharned
120
6.7k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
180
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
260
Designing for Timeless Needs
cassininazir
1
320
Fashionably flexible responsive web design (full day workshop)
malarkey
408
67k
Music & Morning Musume
bryan
47
7.3k
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
340
Agile that works and the tools we love
rasmusluckow
331
22k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
420
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
610
Transcript
Nozomu Ikuta 24th May 2025 Standard Schema: εΩʔϚϥΠϒϥϦͷ౷Ұن֨ͱԿ͔
εΩʔϚϥΠϒϥϦͬͯ·͔͢
• Zod • Valibot • ArkType • etc.
͍͟͏ͱ՝͋Γ·͢
• ϩοΫΠϯ • ΞμϓλɺΞμϓλɺΞμϓλ… • etc.
newmo Ͱͬͯͳ͍Ͱ͢
Tierͷߟ͑ํ Tier 1 : ͜ΕΛࣺͯΔ࣌ίʔυΛҰ͔Β ॻ͖֮͢ޛΛ࣋ͭʮ৺த͢Δʯ૬ख Tier 2 : ࠩ͠ସ͑ʹେ͖ͳ࿑ྗΛඞཁͱ
͢Δʮڧ͘ґଘ͢Δʯ૬ख Tier 3 : ͍ͣΕࠩ͠ସ͑Δ͜ͱΛఆͨ͠ ʮґଘΛܰ͘͢Δʯ૬ख Communication Design 32 Modular Monolith Monorepo ~ γϯϓϧ͞Λอͪͳ͕ΒmonorepoͷϝϦοτΛ࠷େԽ͢Δ ~ JSConf 2024 ΑΓ
ఏڙػೳ΄΅ಉ͡
• ϥϯλΠϜόϦσʔγϣϯ • όϦσʔγϣϯͷResultܕ • όϦσʔγϣϯΤϥʔͷҰཡ • εΩʔϚͷܕਪ
Standard Schema
• Zod, Valibot, ArkType ͷ࡞ऀʹΑͬ ͯઃܭ͞Εͨ • StandardSchemaV1 ͱ͍͏୯Ұͷ interface
͓Αͼ namespace ͱͯ͠ ఆٛ͞Ε͍ͯΔ
interface StandardSchemaV1<Input = unknown, Output = Input> { readonly '~standard':
StandardSchemaV1.Props<Input, Output>; } export declare namespace StandardSchemaV1 { // ϓϩύςΟఆٛ } • APIίϯϑϦΫτճආͷͨΊ `~standard` ϓϩύςΟԼʹͯ͢ఆٛ͢Δ
interface Props<Input = unknown, Output = Input> { readonly version:
1; readonly vendor: string; readonly validate: ( value: unknown ) => Result<Output> | Promise<Result<Output>>; readonly types?: Types<Input, Output> | unde fi ned; } • όϦσʔγϣϯؔ • εΩʔϚͷܕਪ
type Result<Output> = SuccessResult<Output> | FailureResult; interface SuccessResult<Output> { readonly
value: Output; readonly issues?: unde fi ned; } interface FailureResult { readonly issues: ReadonlyArray<Issue>; } • όϦσʔγϣϯͷResultܕ • Τϥʔissuesͱ͍͏ྻͰදݱ͢Δ
interface Issue { readonly message: string; readonly path?: ReadonlyArray<PropertyKey |
PathSegment> | unde fi ned; } interface PathSegment { readonly key: PropertyKey; } • όϦσʔγϣϯΤϥʔ • ͻͱͭͷΤϥʔϝοηʔδͱϓϩύςΟΩʔͰදݱ͢Δ
interface Types<Input = unknown, Output = Input> { readonly input:
Input; readonly output: Output; } type InferInput<Schema extends StandardSchemaV1> = NonNullable< Schema['~standard']['types'] >['input']; type InferOutput<Schema extends StandardSchemaV1> = NonNullable< Schema['~standard']['types'] >['output']; • εΩʔϚͷܕਪ
·ͱΊ
• Standard SchemaͰεΩʔϚϥΠϒϥϦͷ૬ޓӡ༻ੑ͕ߴ·Δ • ओཁͳεΩʔϚϥΠϒϥϦ͢ͰʹରԠࡁΈ • εΩʔϚϥΠϒϥϦͷࠩผԽ͕͘͠ͳΔ͔ʢʁʣ
ࢀߟจݙ • https://github.com/standard-schema • https://github.com/colinhacks/zod • https://github.com/fabian-hiller/valibot • https://github.com/arktypeio/arktype •
https://speakerdeck.com/yuisakamoto/modular-monolith-monorepo- sinpurusawobao-tinagaramonoreponomeritutowozui-da-hua-suru
@nozomuikuta • ιϑτΣΞΤϯδχΞ • Vue.js-JP ڞಉΦʔΨφΠβʔ • UnJS ϝϯόʔ •
Shibuya.go ओ࠵
None
None