reactiverse / es4x

🚀 fast JavaScript 4 Eclipse Vert.x
https://reactiverse.io/es4x/
Apache License 2.0
881 stars 75 forks source link

PR: Tracking progress for later alignment with web-modules. #598

Open lemanschik opened 1 year ago

lemanschik commented 1 year ago

This can be ignored by the most people you will see it soon in your editor. and browser without any intervention needed this is a internal engineering change nothing big to worry about.

es4x issues

Overall Tracking

pmlopes commented 1 year ago

Parsing and look up is complete, the final step is how to register the source maps. This means that the file system resolver needs to issue events whenever a file is read to attempt to load the map if present.

lemanschik commented 1 year ago

@pmlopes

import('./resolverIdHook.js?id=myModuleSpecifier').then((resolvedId)=>import(resolvedId));
// This defines what happens 
const importObject = { imports: { imported_func: (arg) => console.log(arg) } };

WebAssembly.instantiateStreaming(fetch("simple.wasm"), importObject).then(
  (loadedInMemory) => loadedInMemory.instance.exports.exported_func()
);

import maps get executed on a other layer they get static into mem no need to look at it after instantiation.