Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the ECMAScript module system #64

Closed
oovm opened this issue Jul 8, 2019 · 5 comments · Fixed by #2922
Closed

Implement the ECMAScript module system #64

oovm opened this issue Jul 8, 2019 · 5 comments · Fixed by #2922
Assignees
Labels
enhancement New feature or request parser Issues surrounding the parser
Milestone

Comments

@oovm
Copy link
Contributor

oovm commented Jul 8, 2019

Things like implement require/import alias.

@jasonwilliams
Copy link
Member

jasonwilliams commented Jul 8, 2019

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
Copy link
Member

Work has started on import parsing jasonwilliams#259

@Razican Razican added the enhancement New feature or request label Apr 3, 2020
@oovm oovm closed this as completed Jul 12, 2020
@theoparis
Copy link

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

@Razican
Copy link
Member

Razican commented Feb 25, 2022

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 Razican reopened this Feb 25, 2022
@Razican Razican changed the title Is there any plan for module system? Implement the ECMAScript module system Feb 26, 2022
@jedel1043 jedel1043 added the parser Issues surrounding the parser label Aug 22, 2022
@Razican Razican self-assigned this Oct 28, 2022
@Razican
Copy link
Member

Razican commented Oct 28, 2022

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 Razican added this to the v0.17.0 milestone Oct 28, 2022
@Razican Razican linked a pull request Nov 5, 2022 that will close this issue
@jedel1043 jedel1043 removed a link to a pull request Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request parser Issues surrounding the parser
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants