Obtaining deferred namespace imports

Đang mở
#119 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
javascript, wasm
Lĩnh vực
api, compilers

Hướng nghiên cứu

Start by reading the linked TC39 deferred evaluation proposal and WebAssembly ESM integration issue 101, then compare the proposed namespace and deferred-namespace import conventions with the ESM integration semantics described here. Done means reaching an agreed convention and implementing support for obtaining the corresponding JavaScript module namespace objects.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

The deferred evaluation proposal (https://github.com/tc39/proposal-defer-import-eval) is at Stage 3 in TC39 and starting to be implemented now.

We naturally support this in the ESM integration for deferring WebAssembly evaluation as already tracked in https://github.com/WebAssembly/esm-integration/issues/101, but what we do not support is obtaining access to deferred JS namespaces.

This means that WebAssembly cannot import other modules in a way that indicates their execution should be deferred, like JS will be able to do.

The reason for this is that WebAssembly has no way to get the JS module namespace object itself currently as it only imports named exports directly.

For the ESM integration only, the strawman proposal here is to support an import convention form that can be used to obtain the JS module namespace object:

(import "./mod.js" "wasm-js:namespace" (global $ns externref))
(import "./mod.js" "wasm-js:deferred-namespace" (global $ns externref))

In ECMA-262 this directly corresponds to the fact that ~namespace~ and ~deferred-namespace~ are already specified as being supported through the ResolveExport path on the module record, so that we are using the export name position for the convention is not purely a hack, but also matches the underlying specification semantics (see https://tc39.es/proposal-defer-import-eval/#abstract-resolveexport).

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của WebAssembly/esm-integration

Tất cả issue của WebAssembly/esm-integration

Issue tương tự

Thêm issue về Backend & API Design

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.