Skip to content

Support ES2025 JSON modules #780

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

Open
p-bakker opened this issue Jan 2, 2025 · 7 comments · May be fixed by #1039
Open

Support ES2025 JSON modules #780

p-bakker opened this issue Jan 2, 2025 · 7 comments · May be fixed by #1039
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@p-bakker
Copy link

p-bakker commented Jan 2, 2025

See https://github.com/tc39/proposal-json-modules

@bnoordhuis bnoordhuis added enhancement New feature or request good first issue Good for newcomers labels Jan 2, 2025
@saghul
Copy link
Contributor

saghul commented Jan 2, 2025

I started working on import attributes, which IIRC is a pre-requisite for this, before the Xmas break. I hope to get back to it soon!

@LowByteFox
Copy link

I wrote a custom patch for this a while ago, hopefully I can find it in my backups, I probably didn't implement it really well as it used a JSValue for data after with statement

it still may be worth it to look at(?)

@saghul
Copy link
Contributor

saghul commented Apr 28, 2025

Sure thing, send it over if you can find it!

@LowByteFox
Copy link

Couldn't find it unfortunately, I could only find a bit of chat with my friend and bit of scraps of the patch, but not much I'm afraid

could in theory quickly write it again if I can remember how I did it

@LowByteFox
Copy link

I have managed to write the patch again, not really an equivalent to the previous one as I have decided to not introduce many/any breaking changes, couldn't upload the patch in the issue as GitHub has issues with it on Linux, so I have made GitHub gist instead:
https://gist.github.com/LowByteFox/7e651cc624f05b65ef2e8614292f9069

Haven't tested it for leaks yet, if there are any possible improvements, I'll be glad to implement them. I have gotten an idea to implement support for JSON modules in quickjs-libc.c unless desired somewhere else, then could make a PR

@saghul
Copy link
Contributor

saghul commented Apr 29, 2025

Very useful, I'll take a look! Or would you rather send it as a PR, enable 262 tests and handle feedback like so?

@LowByteFox
Copy link

LowByteFox commented Apr 29, 2025

That would work, should I also implement JSON modules while at it? Reaction is enough

@LowByteFox LowByteFox linked a pull request Apr 29, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants