es4x icon indicating copy to clipboard operation
es4x copied to clipboard

Native libraries

Open tahonaPL opened this issue 3 years ago • 3 comments

Hi,

First of all - "Amazing work". This framework is amazing good job.

I have one question: have you tried to wrap/ emulate (like game emulators are doing) the behavior of native Node JS libraries? I think if this will be possible you will unlock about 90% percent of npm libraries. that would be amazing. Projects would just switch to faster alternative.

Note: libraries would need to have modules like "http", "fs"..etc. - actually in my case they are the only I use.

PS. Sorry for my English.

tahonaPL avatar Jul 15 '22 06:07 tahonaPL

Hi @tahonaPL, thanks for your message!

There have been many requests about adding some shims for node modules, I don't think this would be very complex, I think the major step is to bootstrap a shim, for example, create the skeleton of the fs module. I'm pretty sure that we can delegate all the stuff fs does to either graal or vert.x for whatever is missing.

If you'd be interesting in doing such experiments, I'd gladly support you. I think if we get fs and http (for example) working, then tools like webpack and other bundlers could be used directly.

Other have also mentioned a slightly simpler project, create a small express shim delegating to vertx-web (which is not that different) which would allow us to use the same kind of API...

pmlopes avatar Jul 15 '22 07:07 pmlopes

I think express use http (server) under the hood. I think for express we we would need req, response objects and wrapper on vertx to have same router.

I would switch instantly if those would work.

tahonaPL avatar Jul 15 '22 12:07 tahonaPL

sadly I'm occupied with different project. But slowly I will be preparing for this. If you have some resources of how to start and eventually where I need to look to adapt to your framework. let me know.

tahonaPL avatar Jul 15 '22 13:07 tahonaPL