<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/first-draft-of-the-new-pipe-function-vdzuuaffo" -->

---
title: First draft of the new pipe function | daily.dev
description: Valibot's maintainer shares the first draft of a rewritten pipe function that reduces the library's mental model to schemas, methods, and actions. The rewrite...
canonical: https://daily.dev/posts/first-draft-of-the-new-pipe-function-vdzuuaffo
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: First draft of the new pipe function | daily.dev
og:description: Valibot's maintainer shares the first draft of a rewritten pipe function that reduces the library's mental model to schemas, methods, and actions. The rewrite...
og:url: https://daily.dev/posts/first-draft-of-the-new-pipe-function-vdzuuaffo
og:image: https://api.daily.dev/og/posts/vdZuuAFFO.png
og:image:alt: First draft of the new pipe function
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# First draft of the new pipe function

**[Valibot: The modular and type safe schema library](https://daily.dev/sources/valibot)** · 7 min read · 0 upvotes · 0 comments

## Summary

Valibot's maintainer shares the first draft of a rewritten pipe function that reduces the library's mental model to schemas, methods, and actions. The rewrite removes the pipe argument from schema functions, drops async variants for primitives, adds nested pipes, supports type transformations, and introduces objectWithRest, looseObject, and strictObject schemas to replace the removed rest argument. Type safety is improved with per-schema issue types, and the community is invited to help implement remaining parts starting April 8, with a Codemod-based migration planned.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://valibot.dev/blog/first-draft-of-the-new-pipe-function>

## Questions this post answers

### How does the new pipe function change Valibot's schema API compared to before?

Valibot's rewrite moves validation pipelines into a standalone pipe function instead of passing a pipe argument to schema functions. Schemas like v.string() become validation-only, while v.pipe(v.string(), v.email()) adds actions afterward. Pipes can now be nested (wrapping one pipe inside another) and support data type transformations, letting a schema have a different input type than its output type.

_Developers planning a Valibot migration can track breaking API changes like this on daily.dev._

### What replaced the rest argument in Valibot's object schema?

Valibot removed the rest argument from its object schema and replaced it with dedicated schema functions: objectWithRest for allowing typed extra properties, plus looseObject and strictObject for allowing or disallowing unknown entries respectively. This change alone reduces bundle size by up to 150 bytes for users who don't need the rest functionality.

_Teams evaluating validation libraries can compare API tradeoffs like this on daily.dev._

### How much bundle size reduction does Valibot's new pipe implementation offer?

The rewritten pipe implementation delivers roughly a 15-20% average bundle size reduction even for code that uses the pipe function, and larger savings for schemas that skip piping entirely since the pipe argument was removed from schema functions. Additional savings come from dropping async variants like stringAsync for primitive schemas, since async support is now handled entirely within the pipe.

_Developers optimizing bundle size can follow library changes like this on daily.dev._

## Similar posts on daily.dev

- [irony/aspipes](https://daily.dev/posts/irony-aspipes-znewory2z) · Hacker News · 7 upvotes · 0 comments
- [Valibot v1.5: Faster schema construction, Unicode code points, and stricter validation](https://daily.dev/posts/valibot-v1-5-faster-schema-construction-unicode-code-points-and-stricter-validation-fcqzm9kyo) · Valibot: The modular and type safe schema library · 5 upvotes · 1 comments
- [Lessons from Upgrading a Large TypeScript App to Zod 4](https://daily.dev/posts/lessons-from-upgrading-a-large-typescript-app-to-zod-4-pjirn6kxz) · Viget · 7 upvotes · 0 comments
- [Building Type-Safe APIs with itty-spec: A Contract-First Approach](https://daily.dev/posts/building-type-safe-apis-with-itty-spec-a-contract-first-approach-zmpai9qdb) · DEV · 2 upvotes · 0 comments
- [Apollo Connectors v0.4 is Generally Available](https://daily.dev/posts/apollo-connectors-v0-4-is-generally-available-ubrg7s993) · Apollo Blog · 0 upvotes · 0 comments

---

Tags: [#open-source](https://daily.dev/tags/open-source), [#architecture](https://daily.dev/tags/architecture), [#typescript](https://daily.dev/tags/typescript)

[View this post on daily.dev](https://daily.dev/posts/first-draft-of-the-new-pipe-function-vdzuuaffo)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"First draft of the new pipe function","url":"https://daily.dev/posts/first-draft-of-the-new-pipe-function-vdzuuaffo","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/first-draft-of-the-new-pipe-function-vdzuuaffo"},"datePublished":"2026-08-23T12:19:50.843Z","dateModified":"2026-08-23T12:41:30.951Z","description":"Valibot's maintainer shares the first draft of a rewritten pipe function that reduces the library's mental model to schemas, methods, and actions. The rewrite...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/860fbee3efc393cc6c129dbedfa14639?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/860fbee3efc393cc6c129dbedfa14639?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Valibot: The modular and type safe schema library","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Valibot: The modular and type safe schema library","logo":"https://media.daily.dev/image/upload/s--GHNQZY4x--/f_auto,q_auto/v1787487507/logos/valibot?_a=BAMAMicg0","url":"https://daily.dev/sources/valibot"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/first-draft-of-the-new-pipe-function-vdzuuaffo","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"open-source,architecture,typescript","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Valibot: The modular and type safe schema library","item":"https://daily.dev/sources/valibot"},{"@type":"ListItem","position":3,"name":"First draft of the new pipe function"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/first-draft-of-the-new-pipe-function-vdzuuaffo#faq","mainEntity":[{"@type":"Question","name":"How does the new pipe function change Valibot's schema API compared to before?","acceptedAnswer":{"@type":"Answer","text":"Valibot's rewrite moves validation pipelines into a standalone pipe function instead of passing a pipe argument to schema functions. Schemas like v.string() become validation-only, while v.pipe(v.string(), v.email()) adds actions afterward. Pipes can now be nested (wrapping one pipe inside another) and support data type transformations, letting a schema have a different input type than its output type. Developers planning a Valibot migration can track breaking API changes like this on daily.dev."}},{"@type":"Question","name":"What replaced the rest argument in Valibot's object schema?","acceptedAnswer":{"@type":"Answer","text":"Valibot removed the rest argument from its object schema and replaced it with dedicated schema functions: objectWithRest for allowing typed extra properties, plus looseObject and strictObject for allowing or disallowing unknown entries respectively. This change alone reduces bundle size by up to 150 bytes for users who don't need the rest functionality. Teams evaluating validation libraries can compare API tradeoffs like this on daily.dev."}},{"@type":"Question","name":"How much bundle size reduction does Valibot's new pipe implementation offer?","acceptedAnswer":{"@type":"Answer","text":"The rewritten pipe implementation delivers roughly a 15-20% average bundle size reduction even for code that uses the pipe function, and larger savings for schemas that skip piping entirely since the pipe argument was removed from schema functions. Additional savings come from dropping async variants like stringAsync for primitive schemas, since async support is now handled entirely within the pipe. Developers optimizing bundle size can follow library changes like this on daily.dev."}}]}
```

