Node-addon-api: Support for import.meta and dynamic import() callbacks.

Created on 8 Oct 2018  路  9Comments  路  Source: nodejs/node-addon-api

It looks like some emerging APIs are required to be covered by API in order to support hooking into import.meta and dynamic import(). See https://github.com/jkrems/loader/issues/1 for more details. \cc @jkrems

stale

Most helpful comment

Is this the right place for that? If there are new APIs they would go into core as C N-API apis and then later be wrapped by node-addon-api right?

All 9 comments

I think this applies to module APIs in general - e.g. creating / compiling a module also doesn't exist.

i started working on parts of this a while ago. having callbacks for import.meta and dynamic import would need to wait on us finishing whatever is going on in core though. node needs to own those two callbacks from the engine.

Is this the right place for that? If there are new APIs they would go into core as C N-API apis and then later be wrapped by node-addon-api right?

@mhdawson Where should I file the API request _(repo/issue-tracker)_?

@jdalton in this case nodejs/ecmascript-modules, specifically src/node_api.cc

This is not a nodejs/ecmascript-modules aspect though. It is already used by ModuleWrap:

So what would be the procedure to get this through core?

@smotaal you would need to make an API that exposes them here https://github.com/nodejs/ecmascript-modules/blob/master/src/node_api.cc

This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.

I think that the discussion was leading towards the work needing to be done in core first versus node-addon-api, therefore closing. Please let us know if that is not the right thing to do.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

romandev picture romandev  路  5Comments

fivdi picture fivdi  路  8Comments

Globik picture Globik  路  9Comments

langxiong picture langxiong  路  5Comments

jeffrson picture jeffrson  路  4Comments