Open mhofman opened 3 years ago
The realms proposal has been historically facing some implementation challenges blocking it to advance to Stage 3.
The current low level API is good enough to have a membrane system plugged in. I'd like to explore these extensions as follow up proposals only.
The importBinding
intentionally requires a binding to avoid propagation of meaningless import
and without encouraging one to share values through the global.
As follow up proposals we need to explore three forms, at least:
import { name } from 'specifier'
There are open questions for all of them, and they all look like nice to have within their own complexity budget.
Setting a low level API that enables Realms to work if the first goal, and I'd love to unblock this first.
Not all modules have exported bindings. In particular, a "regular" script can be executed as a module if it is strict mode compatible, doesn't assume a shared scope with other scripts and doesn't use a top-level
this
as global.One way to support this subset of modules and scripts would be to execute them through an
importBinding
equivalent without a binding name. Combined with thegetGlobalPropertyValue
addition I suggested in https://github.com/leobalter/realms-polyfill/issues/5#issuecomment-807493424, it would also makeeval
unnecessary for these scripts.Related to the open question "Should a missing binding reject the importBinding promise?", since by definition such modules wouldn't have any bindings, so rejecting would be a problem.