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

Refactor Noir artifact types to be exported from a single Noir types-only package #4114

Open
spalladino opened this issue Jan 17, 2024 · 0 comments
Labels
T-refactor Type: this code needs refactoring

Comments

@spalladino
Copy link
Collaborator

Today type information for a compilation artifact is spread all over the place. There are types defined within rust code in Noir as [wasm_bindgen(typescript_custom_section)], others defined within typescript code in the noir_wasm package, others in foundation, and others in types. We should unify it in a single place.

We should create a new types-only package in the Noir repo with typescript types for Noir abi and compilation artifacts (and potentially a zod validator, already implemented on a discarded commit), which can be consumed from yarn-project.

Reason for not reusing noir-wasm is because the types are needed when building with nargo and consuming from ts, and it makes no sense to pull in the whole wasm package just for the type information. It's possible we could manage by setting the package as a devdependency only, but easier if we have a types package.

This would allow us to remove the type info from within the rust files, and also from foundation and types in yarn-packages. We should have tests to catch any drifts against these types.

See discussion here for more context.

@spalladino spalladino added the T-refactor Type: this code needs refactoring label Jan 17, 2024
@github-project-automation github-project-automation bot moved this to Todo in A3 Jan 17, 2024
@spalladino spalladino changed the title Refactor Noir artifact types to be exported by a noir types-only package Refactor Noir artifact types to be exported from a single noir types-only package Jan 17, 2024
@spalladino spalladino changed the title Refactor Noir artifact types to be exported from a single noir types-only package Refactor Noir artifact types to be exported from a single Noir types-only package Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-refactor Type: this code needs refactoring
Projects
Status: Todo
Development

No branches or pull requests

1 participant