[BridgeJS] Support union types
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 静か
- 技術スタック
- javascript, swift, typescript
- 領域
- api
調査の方向性
ファイルやテストは指定されていません。まず、issueで参照されている既存のrawvalueサポートを見つけ、示されているTypeScriptのunionがSwiftにどのように対応付けられているかを確認してください。バリアント間の実行時の変更をどのように表現すべきかを明確にしてください。Example unionとexample()シグネチャが正しく相互運用でき、FooとBarの間の動的な変更も含まれることが完了の条件です。
索引モデルが issue の本文から書いたものです。
説明
Union types (other than rawvalue which are already done) should be supported. The best way to do this is unclear to me so this issue functions as a discussion point.
Example:
export type Foo = { foo: string }
export type Bar = { bar: string }
export type Example = Foo | Bar
export function example(): Example
Could maybe generate:
@JSClass struct Foo {
@JSGetter var foo: String
@JSSetter func setFoo(_ value: String) throws(JSException)
}
@JSClass struct Bar {
@JSGetter var bar: String
@JSSetter func setBar(_ value: String) throws(JSException)
}
@JSClass enum Example {
case foo(Foo)
case bar(Bar)
}
@JSFunction func example() throws(JSException) -> Example
Note that ts unions can change dynamically eg if I set foo to null and bar to a string, the type changes from Foo to Bar, so idk if that works with an enum like this in Swift.
- 主要言語
- Swift
- スター
- 986
- フォーク
- 76
- 平均マージ
- 21時間 11分
- マージ済み PR(30日)
- 4
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
swiftwasm/JavaScriptKit のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
swiftwasm/JavaScriptKit#793 ·
-
swiftwasm/JavaScriptKit#785 · 担当者 1 名 ·
-
[SwiftBuild] Preserve duplicate archive members when SwiftBuild expands static archives for linking オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
swiftwasm/JavaScriptKit#781 · コメント 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
swiftwasm/JavaScriptKit#773 ·
-
swiftwasm/JavaScriptKit#767 · 担当者 1 名 ·
swiftwasm/JavaScriptKit の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
manaflow-ai/cmux#13763 ·
-
type: feature request
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
googleapis/google-cloud-swift#1036 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
wultra/mtoken-sdk-ios#253 ·
-
area:dictation documentation P2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
uttrflow/uttrflow-swift#1180 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100