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

[hermes-parser] Support Import Attributes #1458

Open
ojj1123 opened this issue Jul 13, 2024 · 2 comments
Open

[hermes-parser] Support Import Attributes #1458

ojj1123 opened this issue Jul 13, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ojj1123
Copy link

ojj1123 commented Jul 13, 2024

Bug Description

Hermes git revision (if applicable):
React Native version:
OS:
Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64):

Steps To Reproduce

  1. Parse JavaScript code uses Import Attributes with hermes-parser
  2. Check the result AST.

code example:

const { parse } = require('hermes-parser');

const ast = parse('import json from "./foo.json" with { type: "json" };');

The Expected Behavior

It outputs the correct AST

The Current Behavior

SyntaxError: ';' expected (1:30)
import json from "./foo.json" with { type: "json" };

Reference

@ojj1123 ojj1123 added the bug Something isn't working label Jul 13, 2024
@ojj1123 ojj1123 changed the title Support Import Attributes [hermes-parser] Support Import Attributes Jul 13, 2024
@avp avp added enhancement New feature or request and removed bug Something isn't working labels Jul 22, 2024
@avp
Copy link
Contributor

avp commented Jul 22, 2024

This feature is at stage 3 and appears to have changed recently, so we still have the old assert keyword. We can update it to have the new with instead.

@ojj1123
Copy link
Author

ojj1123 commented Oct 9, 2024

It seems like it advanced import attributes to stage 4.

https://x.com/robpalmer2/status/1843491103120732585

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants