swiftwasm / swiftwasm/JavaScriptKit
Plugin infrastructure
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 986
- Forks
- 76
- Avg merge
- 21h 11m
- Merged PRs (30d)
- 4
Description
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:releaseswjs_object:get_prop,set_prop,get_subscript,set_subscript,instanceofswjs_string:decode,encode,loadswjs_function:call,apply,call_new,createswjs_typedarray:create
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by mapping the existing JavaScript/WASM bridge and the listed entry points: swjs_core, swjs_object, swjs_string, swjs_function, and swjs_typedarray. Determine the public plugin API boundary and how the listed JavaScriptKit features could use it; done means the design is settled and the proposed functions can be migrated without adding unused functionality to every bundle.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, swift, wasm
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100