Open p-bakker opened 3 years ago
I'd like to be able to continue to specify a resolver as we do for the existing require implementation
I agree: where we use Rhino, I foresee us loading modules from a blob in the database or some other persistence store, so we need full control over how module paths are resolved
Additionally, we could support importing Java classes & packages through the ESM import statement: I think ESM allows for importing from 'modules' that aren't implemented in JavaScript
@szegedi as you authored the CommonJS implementation at one point in time and you seem to like fun tasks 😛, any chance you'd be interested in taking a stab at this one? 🙏
Big topic, see MDN Modules for some primer
Depends on Support ES5 this handling in strict mode, as all module code is to run in strict mode (and any other strict-mode anomalies we might have)
Some questions to be answered before setting out implementing this:
In cases where Rhino is integrated, maybe all of a sudden having the ability to import modules after upgrading Rhino is a security concern?