バリデーションライブラリである Zod を、Next.js で活用する TIPS の紹介です。筆者が Zod を知り・使い始めたのは、React Hook Form のリゾルバーがきっかけです。ブラウザでバリデーションを行うので、不正な入力値検証を API リクエストが発生する前に実行できます。 この Zod はフロントだけではなく、サーバープロセスでも使用できます。例えば、tRPC・Zodiosなどに見られるように、サーバーへのリクエスト(入力値)を検証しつつ型推論も解決してくれるソリューションとして注目されています。 Next.js API Routes に Zod を組み込む Next.js には REST API の実装手段として、API Routes が提供されています。しかし、reqに含まれる入力値検証は自前で用意する必要があります。この入力値検証に Zod を使用されている方
I'm still working on learning Rust. Beyond syntax, learning a language requires familiarizing oneself with its idioms and ecosystem. I'm at a point where I want to explore testing in Rust. The initial problem We have used Dependency Injection a lot - for ages on the JVM. Even if you're not using a framework, Dependency Injection helps decouple components. Here's a basic example: class Car(private
When we create components in React, normally they exist within the component tree. This is mostly fine, but sometimes we want certain parts of a component to appear outside the component tree, or somewhere entirely different. This is a common requirement when we create modal popup windows, which need to be above all other components. We may create these within a component, but ultimately we'll wan
Building Inclusive Mini Golf: A Practical Guide to Accessible XR Development Colby Morgan discusses practical strategies and technical examples for building accessible and inclusive XR experiences. Learn about their core design principles, including accessibility at the start, invisible features, simplicity, and layered depth, using Walkabout Mini Golf as a case study.
Hello, I'm developer of typescript-json and have measure a benchmark comparing performance with other competitive libraries. By the benchmark, my library typescript-json has been turned out that maximum 1,000x times faster than zod. Being proud of such performance enhancement, I hope many TypeScript developers to adapt my library. Advantage of typescript-json is not only better performance, but al
はじめにこんにちは。フューチャーの棚井龍之介と申します。認証認可連載の 4 本目を担当しました。 認証認可周りは最近触りたてでして、普段の開発業務では、Go・React・AWS を利用しています。 先日、React ベースのモバイル向け Web アプリに Auth0 の認証を実装したところ、Silent Authentication(サイレント認証)のタイミングでブラウザからトークンが消失し、ログイン状態が維持できない現象に遭遇しました。 調べたところ、Safari に搭載されているトラッキング防止機能の ITP(Intelligent Tracking Prevention / インテリジェント・トラッキング・プリベンション)が原因だと判明しました。 調べる過程で、Cookie の基本的な機能からアドテク周りの技術要素、最近のプライバシー保護トレンドについて触れる機会を得ましたので、技術
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く