Schema: support subset of the Temporal API

オープン
#199 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript

調査の方向性

TypeScript スキーマの例から始め、リンクされている Temporal API の記事と polyfill のドキュメントを読みます。Hypergraph スキーマで Temporal.PlainDate、Temporal.PlainTime、Temporal.ZonedDateTime をどのように表現すべきかを判断し、既存の Date 型が削除されていることを確認します。issue にはファイル名もテストも記載されていないため、現在のスキーマ型の定義を見つけることも調査の一部です。

索引モデルが issue の本文から書いたものです。

説明

Schema SDK

This article https://brandondong.github.io/blog/javascript_dates/ (the history part is shocking e.g. how Chrome changed timezone parsing) triggered me to finally read up on the new native Temporal API that’s coming in JS. The best part: with a Polyfill it’s already working

Temporal supports a couple of Date/Time formats we want to have and my suggestion is to only use the Temporal API for Hypergraph. We could start with:

  • Temporal.PlainDate (only date without time and timezone)
  • Temporal.PlainTime (only time, no date or timezone)
  • Temporal.ZonedDateTime (date + time + timezone which can be UTC)

Schema example:

export class Person extends Entity.Class<Person>('Person')({
  birthday: Entity.PlainDate,
  alarm: Entity.PlainTime,
  upgradeToProAccount: Entity.ZonedDateTime,
}) {}

Great article with examples:L https://waspdev.com/articles/2025-05-24/temporal-api
Polyfill: https://www.npmjs.com/package/temporal-polyfill

Also remove Date then.

主要言語
TypeScript
スター
22
フォーク
12
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

graphprotocol/hypergraph のほかの issue

graphprotocol/hypergraph の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。