swiftwasm / swiftwasm/JavaScriptKit

`JSNumber` type to support `long long` type in Web API IDL

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

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

enhancement
主要言語
Swift
スター
986
フォーク
76
平均マージ
21時間 11分
マージ済み PR(30日)
4

説明

Rust folks have a similar issue, where long long shouldn't be mapped to Int64, which is bridged to BigInt on JS side. https://github.com/rustwasm/wasm-bindgen/issues/800

Checked a few other places where long long is used, like AudioData, Blob, and File and all of them return a JS number in corresponding properties, not BigInt. I'm 95% sure none of these support BigInt, remaining 5% certainty could be added by writing actual tests. I personally vote for either keeping these Int32 as proposed, or creating a new union type. Just riffing:

enum JSNumber: ExpressibleByIntegerLiteral, ExpressibleByFloatLiteral {
case integer(Int32)
case float(Double)
// ...
}

Should we add such type to JSKit then?

cc @kateinoigakukun

Originally posted by @MaxDesiatov in https://github.com/swiftwasm/WebAPIKit/issues/42#issuecomment-1125355976

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

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

はじめの一歩

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

調査の方向性

まず、JSKit における Web API IDL の long long 値の扱いを確認し、issue で言及されている AudioData、Blob、File のプロパティを wasm-bindgen issue 800 と比較します。完了とするには、JavaScript の数値の表現を決定し、これらのプロパティが BigInt をサポートするか確認するテストを用意する必要があります。実装ファイルやテストは指定されていません。

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

評価

技術スタック
javascript, swift, wasm
領域
api, web-dev
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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