[RFC]: add `@stdlib/wasm/instantiate`
Los mantenedores suelen responder en 1 día
@0PrashantYadav0 ya está trabajando en esto.
Desde el 12/8/2026.
- #14417 de @0PrashantYadav0 — abierto
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Description
This RFC proposes to add @stdlib/wasm/instantiate
Findings
@stdlib/wasm/module-wrapper still calls platform globals for compilation and instantiation. Async paths use WebAssembly.instantiate; sync paths use WebAssembly.Module and WebAssembly.Instance. Those TODOs point at @stdlib/wasm/instantiate (and related packages).
The existing @stdlib/wasm/memory package is the right pattern: feature-detect with @stdlib/assert/has-wasm-support, export a strict native alias when supported, otherwise a polyfill that throws not implemented. @stdlib/wasm/instantiate should follow that same shape, except the export is a function (not a constructor).
@stdlib/promise/ctor (with polyfill) already under review in #14140 and will be used by module-wrapper for initialize(). That item is done and is not part of this work.
WebAssembly.instantiate and new WebAssembly.Instance(...) are different APIs. The TODOs map both names to @stdlib/wasm/instantiate, but they should stay separate: instantiate for the async function, and a later @stdlib/wasm/instance for the sync constructor (same idea as memory / module).
Native instantiate has two overloads that must pass through unchanged:
- bytes →
Promise<{ module, instance }> - compiled module →
Promise<Instance>
Future plan
- Ship
@stdlib/wasm/instantiateas a thin alias ofWebAssembly.instantiate(package, tests, docs, namespace export). Done. - Add
@stdlib/wasm/moduleforWebAssembly.Module. - Add
@stdlib/wasm/instanceforWebAssembly.Instance. - Update
module-wrapperto use the new packages and remove the remaining TODOs. - Optionally extract
PAGE_SIZEto@stdlib/constants/wasm/page-size.
Related Issues
Related PR #14140
Questions
No.
Other
No.
Checklist
- I have read and understood the Code of Conduct.
- Searched for existing issues and pull requests.
- The issue name begins with
RFC:.
- Lenguaje dominante
- JavaScript
- Estrellas
- 6k
- Forks
- 1.3k
- Merge medio
- 1 d 10 h
- PR fusionados (30 d)
- 568
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de stdlib-js/stdlib
-
Fix JavaScript lint errorsPosiblemente ocupada @lb1192176991-lab la tomó hace 3 días. AbiertoGood First Issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
stdlib-js/stdlib#15831 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
`@stdlib/string/base/percent-encode` produces malformed encoding and silently drops charactersPosiblemente ocupada @barbierajput378-pixel la tomó hace 7 días. AbiertoBug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
stdlib-js/stdlib#15595 · 6 comentarios ·
Los mantenedores suelen responder en 1 día
-
[Bug]: kumaraswamy/kurtosis returns non-excess kurtosis (missing −3)Posiblemente ocupada @Planeshifter la tomó hace 7 días. AbiertoBug Statistics
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
stdlib-js/stdlib#15461 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Bug]: rayleigh/mgf returns wrong values due to misplaced parenthesisPosiblemente ocupada @anandkaranubc la tomó hace 10 días. AbiertoBug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
stdlib-js/stdlib#15456 · 6 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
@stdlib/array/fixed-endian-factory allows misaligned byte offsets and fractional lengthsPosiblemente ocupada @kanikasharma-18 la tomó hace 23 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
stdlib-js/stdlib#15193 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de stdlib-js/stdlib
Issues similares
-
[Feature]:Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Uuriko/project-room#1554 ·
Los mantenedores suelen responder en 1 día
-
automated issue report
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
lirantal/discoprint#36 ·
Los mantenedores suelen responder en 1 día
-
accepting PR Content:HTML
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
mdn/content#45988 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
pnpm/pnpm#16635 · 1 comentario ·
Los mantenedores suelen responder en 1 día