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
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
ZOZOTOWNの進化と信頼性を両立する負荷試験
zozotech
PRO
2
190
誤解だらけの開発生産性 / Myths and Misconceptions about Developer Productivity
i35_267
2
800
「ちゃんとやっている」は独りよがりだった ― 不安に寄り添うインシデント対応へ / Towards incident response that addresses anxieties
chmikata
1
6k
Amplify Gen2でbackend.tsにCDKを定義する/しない事によるCDKの挙動の違いとユースケース
smt7174
1
410
インフラと開発の垣根を超えていき!〜元AWSインフラエンジニアがAWS開発で奮闘している話〜
hatahata021
3
300
ゴールデンパスは敷いただけでは道にならない ─ 企画部門のエンジニアが技術標準を事業価値に変えるまで
mhrtech
1
220
知らん間に、回ってる
ming_ayami
0
720
Devsumi 2026 Summer 人もAIも使える共通基盤を事業の加速装置にする~デザインシステム運用に学ぶ組織レバレッジ~ 渡辺 凌央
legalontechnologies
PRO
1
240
生成AI×AWS CDK×AWS FISで"振り返れる"ミニGameDayをつくろう
yoshimi0227
1
400
SRE本の知られざる名シーン / The Hidden Gems of Google SRE Book
nari_ex
1
420
ruby.wasmとPicoRuby.wasmに対応した仮想DOMライブラリを作ってる話 #kaigieffect_kaigi
sue445
PRO
0
150
発表と総括 / Presentations and Summary
ks91
PRO
0
140
Featured
See All Featured
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
280
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
The Pragmatic Product Professional
lauravandoore
37
7.4k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
350
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
240
The Language of Interfaces
destraynor
162
27k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
410
Optimizing for Happiness
mojombo
378
71k
Typedesign – Prime Four
hannesfritz
42
3.1k
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