Interaction with `configureAll` from Custom Descriptors
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- javascript, wasm
- Lĩnh vực
- web-dev
Hướng nghiên cứu
Start with the custom descriptors proposal's Overview.md section on the configureAll configuration API, then review the issue's ESM integration approach using a start function, exported mutable globals, and property access helpers. Determine whether a better way exists to export constructors created by configureAll, including the relationship with configured prototypes; the issue is done when a concrete integration direction is agreed.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The custom descriptors proposal includes a new configureAll builtin. Among other things, configureAll has the ability to wrap WebAssembly function references to make them callable with new. configureAll takes a JS object as an externref argument and writes all the constructors it creates this way as properties on that object.
This way of "returning" an arbitrary number of constructors by writing them to an object works great for hand-written JS (the object they are written to can even be globalThis, making the constructors ambiently available), but does not play well with ESM integration. With ESM integration, it would ideally be possible to export these constructors directly, which is presumably what an equivalent JS module would do.
The best method I've come up with for exporting constructors created by configureAll is to do this:
- Import helper functions for creating a fresh JS object and accessing an object's properties by name.
- In the start function, call
configureAll, passing it a fresh JS object allocated via the allocation helper. - In the start function, use the property access helper to pull out each configured constructor and assign it to an exported mutable global.
AFAICT, there's no way to avoid the exported globals being mutable because they cannot be initialized with constant expressions.
If anyone has any better ideas, I'd love to hear them. The only other thing I've come up with is that we could have a name mangling scheme on function exports that tells ESM integration to generate the same new-callable wrapper that configureAll would have generated. This is only a partial solution, though, because it does not link up the constructor function with a configured prototype the way configureAll does.
- Ngôn ngữ chính
- WebAssembly
- Star
- 458
- Fork
- 40
- Merge trung bình
- 10 ngày 37 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của WebAssembly/esm-integration
-
Supporting WebAssembly.JSTag importCó thể đã có người làm @guybedford đã nhận 190 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
WebAssembly/esm-integration#120 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
WebAssembly/esm-integration#119 ·
-
String Constants BikeshedĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
WebAssembly/esm-integration#118 · 10 bình luận ·
-
Worker imports & memory sharingĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
WebAssembly/esm-integration#112 · 9 bình luận ·
-
Bundler test suiteĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
WebAssembly/esm-integration#109 · 1 bình luận ·
Tất cả issue của WebAssembly/esm-integration
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
mailcow/mailcow-dockerized#7677 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
gcivil-nyu-org/team5-mon-fall26#145 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
gcivil-nyu-org/team3-mon-fall26#156 ·
Maintainer thường phản hồi trong vòng 1 ngày