Skip to content

Commit

Permalink
docs: finish 2.0 announcement
Browse files Browse the repository at this point in the history
  • Loading branch information
ssalbdivad committed Jan 17, 2025
1 parent 56f8d0b commit 7aaeae2
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 47 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
// has a "type" export
"^(node:)?os$"
],
"typescript.tsserver.experimental.enableProjectDiagnostics": true,
"typescript.tsdk": "./node_modules/typescript/lib",
// IF YOU UPDATE THE MOCHA CONFIG HERE, PLEASE ALSO UPDATE package.json/mocha AND ark/repo/mocha.jsonc
"mochaExplorer.nodeArgv": ["--conditions", "ark-ts", "--import", "tsx"],
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,5 +332,12 @@ Otherwise, consider sending me an email ([email protected]) or [message me on Dis
src="https://avatars.githubusercontent.com/u/47925045"
/></a>
</td>
<td>
<a href="https://github.com/tylim88"
><img
height="64px"
src="https://avatars.githubusercontent.com/u/5227509"
/></a>
</td>
</tr>
</table>
34 changes: 19 additions & 15 deletions ark/docs/components/AutoplayDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@ export type AutoplayDemoProps = React.DetailedHTMLProps<
React.VideoHTMLAttributes<HTMLVideoElement>,
HTMLVideoElement
> & { src: string }

// Note: not currently used, but copied over in case it's needed

export const AutoplayDemo = (props: AutoplayDemoProps) => (
<video
autoPlay
loop
controls={true}
// required for autoplay on Safari
playsInline
// there's no audio, but required for autoplay on Chrome
muted
// picture in picture doesn't work well since the page is designed around the demo
disablePictureInPicture={true}
{...props}
/>
<div style={{ opacity: 0.8 }}>
<video
autoPlay
loop
controls={true}
playsInline
muted
disablePictureInPicture={true}
style={{
borderRadius: "1rem",
boxShadow: "0 0 10px rgba(0, 0, 0, 0.3)"
}}
{...props}
/>
<p style={{ fontSize: "1rem" }}>
Type-level feedback on keystroke-{" "}
<b>no plugins or build steps required</b>.
</p>
</div>
)
13 changes: 5 additions & 8 deletions ark/docs/components/Hero.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { ArrowRightIcon } from "lucide-react"
import Link from "next/link"
import { AutoplayDemo } from "./AutoplayDemo.tsx"
import { PlatformCloud } from "./PlatformCloud.tsx"

export const Hero = () => (
<div className="flex justify-between">
<div className="flex flex-col md:flex-row justify-between">
<div className="absolute top-2 left-0 right-0">
<div className="flex justify-between">
<PlatformCloud main="ts" right="vscode" top="neovim" left="intellij" />
Expand All @@ -24,12 +25,8 @@ export const Hero = () => (
<ArrowRightIcon />
</Link>
</div>
<img
alt="A serene ark, sailing to runtime"
src="/image/splash.png"
className="-mt-16 hidden md:block"
height={400}
width={400}
/>
<div style={{ padding: "2rem", position: "relative" }}>
<AutoplayDemo src="https://github.com/user-attachments/assets/895c439e-fcd3-4420-93fa-299e829fcf26" />
</div>
</div>
)
29 changes: 28 additions & 1 deletion ark/docs/content/docs/blog/2.0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ title: Announcing ArkType 2.0
description: 100x faster validation with DX that will blow your mind
---

import { AutoplayDemo } from "../../../components/AutoplayDemo.tsx"
import { CodeBlock } from "../../../components/CodeBlock.tsx"
import { RuntimeBenchmarksGraph } from "../../../components/RuntimeBenchmarksGraph.tsx"

As of today, `[email protected]` is generally available and fully stable.

ArkType 2.0 brings types to runtime JS in a way that, until today, was a pipedream. Whether you're a first-time TypeScript dev trying to validate a form or a library author introspecting relationships, ArkType offers fundamentally better tools for navigating the perils of JavaScript.
ArkType 2.0 brings types to runtime JS in a way that, until today, has been a pipedream.

Whether you're a first-time TypeScript dev trying to validate a form or a library author introspecting relationships, ArkType offers fundamentally better tools for navigating the perils of JavaScript.

<AutoplayDemo src="https://github.com/user-attachments/assets/895c439e-fcd3-4420-93fa-299e829fcf26" />

### Unparalleled DX

Expand Down Expand Up @@ -50,3 +55,25 @@ Every schema is internally normalized and reduced to its purest and fastest
representation

<CodeBlock fromFile="intrinsicOptimization" />

### What next?

ArkType doesn't require a special environment or build step to work- [our intro](/docs/intro/setup) will have you up and running in seconds.

We have [big plans](https://github.com/orgs/arktypeio/projects/4) to ArkType 2.0 even further, but we're even more excited to see what you do with it!

[Starting coding](/docs/intro/setup)

[Check out the project on GitHub](/docs/intro/setup)

👋 [Join our Discord to lurk or ask questions](https://arktype.io/discord)

- Follow any of these accounts for updates:

- [@arktype.io](https://bsky.app/profile/arktype.io), [@ssalbdivad.dev](https://bsky.app/profile/ssalbdivad.dev) on BlueSky
- [@arktypeio](https://x.com/arktypeio), [@ssalbdivad](https://x.com/arktypeio) on X/Twitter

- Consider supporting my full-time work on ArkType...

- via [GitHub Sponsors](https://github.com/sponsors/arktypeio)
- by convincing your team to let me optimize your types and fix editor lag (reach out directly to one of the accounts listed or `[email protected]`)
24 changes: 2 additions & 22 deletions ark/repo/scratch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,7 @@ import { type } from "arktype"

const user = type({
name: "string",
projects: "string[]",
nested: {
nested2: {
key: "string.numeric.parse | number"
}
}
data: "number | (bigint | string)[]"
})

user.extends({ name: "string" }) //?

const out = user({
name: "Josh Goldberg",
projects: ["typescript-eslint", "mocha", 999]
})

if (out instanceof type.errors) {
console.log(`Encountered ${out.length} errors:`)
console.log(out.summary)
} else {
console.log(`Valid result:`)
console.log(out)
}

console.log(user.expression)
export type User = typeof user.infer

0 comments on commit 7aaeae2

Please sign in to comment.