swiftwasm / swiftwasm/JavaScriptKit

Plugin infrastructure

未關閉
#66 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

enhancement
主要語言
Swift
星號
986
分支
76
平均合併
21 小時 11 分鐘
30 天內合併 PR
4

描述

Currently, JavaScript-based features must be directly implemented in JavaScriptKit to be able to access important features like the heap and the JSValue parsing/serializing routines. This means that less-common things like TypedArray or potential Combine-Promise integration (see #62) would have to increase the bundle size for everyone. One solution to this would be defining some sort of public JS-side API that allows providing custom functions to the WASM runtime. As long as we encourage users of this API to prefix their methods there should be no collision issues.

It would be nice to restructure JavaScriptKit itself to make use of the plugin API too:

  • swjs_core: release
  • swjs_object: get_prop, set_prop, get_subscript, set_subscript, instanceof
  • swjs_string: decode, encode, load
  • swjs_function: call, apply, call_new, create
  • swjs_typedarray: create

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先整理現有的 JavaScript/WASM 橋接層以及列出的入口點:swjs_core、swjs_object、swjs_string、swjs_function 和 swjs_typedarray。確定公開 plugin API 的邊界,以及列出的 JavaScriptKit 功能可以如何使用它;完成的標準是設計已經確定,並且可以遷移提議的函式,而不必向每個 bundle 新增未使用的功能。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript, swift, wasm
領域
api, tooling
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。