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

Consider exporting all coders. #4820

Open
Satan-web3 opened this issue Aug 27, 2024 · 5 comments
Open

Consider exporting all coders. #4820

Satan-web3 opened this issue Aug 27, 2024 · 5 comments
Labels
enhancement New feature or improvement. minor-bump Planned for the next minor version bump. next-patch Issues scheduled for the next arch release. on-deck This Enhancement or Bug is currently being worked on. v6 Issues regarding v6

Comments

@Satan-web3
Copy link

Satan-web3 commented Aug 27, 2024

Describe the Feature

I want to change some functions of coders to implement some functionalities. But when I try to import like this:

import { AddressCoder } from "ethers/lib.esm/abi/coders/address.js";

It report Error [ERR_PACKAGE_PATH_NOT_EXPORTED]. So please consider exporting all coders in index.ts.

Code Example

In `src.ts/abi/index.ts`:

export { Coder, Reader } from './coders/abstract-coder.js';
export { AddressCoder } from "./coders/address.js";
export { ArrayCoder } from "./coders/array.js";
export { BooleanCoder } from "./coders/boolean.js";
export { BytesCoder } from "./coders/bytes.js";
export { FixedBytesCoder } from "./coders/fixed-bytes.js";
export { NullCoder } from "./coders/null.js";
export { NumberCoder } from "./coders/number.js";
export { StringCoder } from "./coders/string.js";
export { TupleCoder } from "./coders/tuple.js";
@Satan-web3 Satan-web3 added the enhancement New feature or improvement. label Aug 27, 2024
@ethers-io ethers-io deleted a comment Sep 12, 2024
@ricmoo ricmoo added the investigate Under investigation and may be a bug. label Sep 16, 2024
@ricmoo
Copy link
Member

ricmoo commented Sep 16, 2024

Ive been considering adding this using the exports; so it would be something to the effect of import { NumberCoder } from "ethers/abi".

@Satan-web3
Copy link
Author

Ive been considering adding this using the exports; so it would be something to the effect of import { NumberCoder } from "ethers/abi".

Thank you!

@Satan-web3
Copy link
Author

Ive been considering adding this using the exports; so it would be something to the effect of import { NumberCoder } from "ethers/abi".

When will this feature publish? I've been waiting for it for nearly a month.

@ricmoo
Copy link
Member

ricmoo commented Oct 16, 2024

Sorry. I'm still working on the next minor release, which this will go out in. I'm also planning to make the export prefixed with an underscore _ since it will be somewhat experimental.

@ricmoo ricmoo added on-deck This Enhancement or Bug is currently being worked on. minor-bump Planned for the next minor version bump. v6 Issues regarding v6 next-patch Issues scheduled for the next arch release. and removed investigate Under investigation and may be a bug. labels Oct 16, 2024
@Satan-web3
Copy link
Author

Satan-web3 commented Oct 16, 2024

Sorry. I'm still working on the next minor release, which this will go out in. I'm also planning to make the export prefixed with an underscore _ since it will be somewhat experimental.

I think it's better not to add it because the export doesn't conflict with other code. But the underscore is acceptable if you are planning to change some coders in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement. minor-bump Planned for the next minor version bump. next-patch Issues scheduled for the next arch release. on-deck This Enhancement or Bug is currently being worked on. v6 Issues regarding v6
Projects
None yet
Development

No branches or pull requests

2 participants