boa icon indicating copy to clipboard operation
boa copied to clipboard

Implement the ECMAScript module system

Open oovm opened this issue 6 years ago • 4 comments

Things like implement require/import alias.

oovm avatar Jul 08 '19 11:07 oovm

Nope, I haven't got this far yet, feel free to let us know if you have any ideas or if you wanted try something out. In theory the interpreter can run multiple times against new files

It would need to be modified to return a Value back into something else, instead of the String it returns currently

jasonwilliams avatar Jul 08 '19 13:07 jasonwilliams

Work has started on import parsing https://github.com/jasonwilliams/boa/pull/259

jasonwilliams avatar Mar 09 '20 16:03 jasonwilliams

Any updates on this? The PR was closed a while ago, and i can't find another decent, embeddable rust javascript engine like this 😕

theoparis avatar Feb 25 '22 07:02 theoparis

Any updates on this? The PR was closed a while ago, and i can't find another decent, embeddable rust javascript engine like this 😕

I will soon add a project for this, it's definitely in the pipeline, along with generators and a async/await support.

Razican avatar Feb 25 '22 07:02 Razican

I'm working on the Module parsing now. This will probably require some changes on how we parse, since we no longer have just "scripts", we also have "modules", which require a bit of a different parsing.

Not a big deal, though. For now I will work on the parsing, and see how we go from there. I would also like to see how to adapt our tester to be able to test modules.

On the API side, I'm thinking that it would be interesting to be able to initialize the Context with a module loader, and we can provide a simple "file module loader" which would load modules from a given path. This would enable users to create their own module loader, so that they can import modules from files, databases, memory or from wherever they want.

I expect to have a PR ready during the weekend, for the parsing. If you want to see progress, check the import_parse branch.

Razican avatar Oct 28 '22 08:10 Razican