Home / Companies / Convex / Blog / December 2023

December 2023 Summaries

3 posts from Convex

Filter
Month: Year:
Post Summaries Back to Blog
Zod is a TypeScript-first schema validation library that facilitates data validation and type safety in TypeScript projects by defining data formats and validating them at runtime. It is particularly beneficial for server-side validation and end-to-end type safety, as it ensures that the data received in JSON payloads corresponds to expected types, eliminating the need for duplicate type definitions. Zod is commonly used alongside frameworks like tRPC and Convex to validate function arguments and outputs, offering a straightforward way to integrate type validation across client and server sides. By using Zod with tools like Convex-helpers, developers can convert Zod validators into Convex validators, ensuring that data types are consistently validated throughout the application lifecycle. Additionally, Zod aids in output validation by restricting the data returned by functions to specified types, which enhances data security and reduces the risk of leaking sensitive information. While using Zod for database schema definitions is possible, it comes with limitations, particularly when more refined types are involved, requiring careful handling during data reads and writes to maintain data integrity.
Dec 15, 2023 2,697 words in the original blog post.
The text explores the intricacies of customizing serverless functions in backend development, advocating for minimizing the use of middleware due to its potential complexity and opaqueness. It highlights the challenges posed by middleware, such as difficulty in tracing request modifications and understanding execution order, which can lead to increased cognitive load and type safety issues. The author suggests adopting principles of function customization that are obvious, explicit, and type-safe, utilizing patterns like decorators in Python or custom functions in TypeScript to achieve these goals. Examples are provided using the Convex platform, demonstrating how to modify function contexts and arguments for tasks like user authentication and API key validation without relying on traditional middleware. The text emphasizes the importance of clear, discoverable, and predictable customization processes, recommending encapsulation of behavior in a single function to enhance readability and maintainability, while also offering strategies to ensure adherence to these practices through tools like ESLint and type-checking in TypeScript.
Dec 14, 2023 2,848 words in the original blog post.
A hackathon was hosted to create innovative features for a Notion clone using the backend platform Convex, following a tutorial by CodeWithAntonio. The event, titled the Notion Clone Build Bounty, attracted many participants, with Konrad Hylton winning the best multiplayer/collaborative feature category for his implementation of real-time cursor presence and UI for adding/removing collaborators. Shreyas Chaliha won for the best use of Convex's features by integrating chat and image storage using Convex's native capabilities. Shyam Raghuwanshi was the runner-up for creating a role-editing-style collaboration feature, while Dr. Sajjad Mahmood received an honorable mention for adding collaborative features and sharing capabilities. The event highlighted Convex's modular nature, which facilitated the addition of new features, and emphasized the enthusiasm and collaboration within the CodeWithAntonio community.
Dec 12, 2023 667 words in the original blog post.