dart-archive / wasm

Utilities for loading and running WASM modules from Dart code
https://pub.dev/packages/wasm
BSD 3-Clause "New" or "Revised" License
309 stars 25 forks source link

Provide an explicit public API and hide internals from users. #92

Closed modulovalue closed 1 year ago

modulovalue commented 2 years ago

This issue is a response to the feedback from liamappelbe in #91

Here is a rough sketch of what I plan to submit in separate PRs:

  1. wasm_api.dart which will expose the interfaces found in module.dart and all error types without the implementation details (it will be unused for the moment, to be migrated to in a subsequent PR).
  2. a migration from using constructors to construct a WasmModule instance to using a top level function to construct a WasmModule instance.
  3. all declarations (excluding the top level factory functions from 2.) in module.dart will be made private and the interfaces from wasm_api.dart will be exposed.
modulovalue commented 1 year ago

I'll split (3) i.e. the migration to the new explicit API into two phases:

  1. I'll migrate the exceptions and errors first and expose the new error and exception interfaces.
  2. then make the old declarations private and let them implement their new interface only versions.