You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
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
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.
The text was updated successfully, but these errors were encountered: