Skip to content

Revision 0.33.22#1065

Merged
sinclairzx81 merged 6 commits intomasterfrom
syntax
Nov 9, 2024
Merged

Revision 0.33.22#1065
sinclairzx81 merged 6 commits intomasterfrom
syntax

Conversation

@sinclairzx81
Copy link
Owner

This PR removes the Parse function from top level import and renames the internal submodule from @sinclair/typebox/parse to @sinclair/typebox/syntax. It also introduces two new Static types, StaticParseAsSchema and StaticParseAsType.

The removal of the Parse from top-level import is to reduce bundle sizes, but also to make the functionality more "opt-in" similar to the Value and TypeCompiler submodules.

The TS syntax can be imported via the syntax submodule.

import { Parse } from '@sinclair/typebox/syntax'
import { Static } from '@sinclair/typebox'

type T = Static<typeof T>

const T = Parse(`{
  x: number
  y: number
  z: number
}`) 

@sinclairzx81 sinclairzx81 merged commit 6cf8596 into master Nov 9, 2024
@sinclairzx81 sinclairzx81 deleted the syntax branch November 9, 2024 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant