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

Remove enum types from N-API #721

Closed
Wodann opened this issue Oct 29, 2024 · 5 comments
Closed

Remove enum types from N-API #721

Wodann opened this issue Oct 29, 2024 · 5 comments
Assignees

Comments

@Wodann
Copy link
Member

Wodann commented Oct 29, 2024

Hardhat is using isolatedModules to ensure compatibility with single-file transpilation tools like tsx. With isolatedModules, const enums can’t be inlined, since this setting assumes each file compiles independently rather than together.

Instead of using enums, it would be better to generate constants, similar to what was done for SpecId.

original discussion

Definition of done
Remove all instances of const enum types from the N-API in the feat/multichain branch

@github-project-automation github-project-automation bot moved this to Unconfirmed in EDR Oct 29, 2024
@Wodann Wodann moved this from Unconfirmed to Todo in EDR Oct 29, 2024
@iosh
Copy link

iosh commented Oct 29, 2024

@Wodann @agostbiro Can i try this? and can you provide more detail information? I didn't see any difference between MineOrdering and SpecId they're both const enum.

@agostbiro
Copy link
Member

agostbiro commented Oct 29, 2024

Thanks for your interest @iosh , I think the issue is in the feat/multichain branch, but I'm not up-to-date on the progress there, so I'll defer to @Wodann.

@Wodann
Copy link
Member Author

Wodann commented Oct 30, 2024

Thank you for your interest, @iosh! I've added some links to point you in the right direction, but there two more requirements that I'm clarifying with the requester. Once that's done, I'll update the issue description and assign it to you 🙂

@alcuadrado
Copy link
Member

I think another option is generating non-const enums. const enums are so surprising/confusing.

@Wodann
Copy link
Member Author

Wodann commented Nov 5, 2024

After discussing this, we realised that the solution was trivial and I implemented it in the above PR.

Thank you for your interest, @iosh! Please have a look at some of our other issues for a good first issue 😊

@Wodann Wodann closed this as completed Nov 5, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in EDR Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

4 participants