Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Bug fix: Remove incorrect typings from contract #5142

Merged
merged 1 commit into from
May 26, 2022

Conversation

eggplantzzz
Copy link
Contributor

In response to #4825, this PR removes the types from @truffle/contract.

Copy link
Contributor

@haltman-at haltman-at left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We said we're doing this, right? So let's do it! (Although, should this be marked as a breaking change to contract?)

@eggplantzzz
Copy link
Contributor Author

@haltman-at oh man, I don't know. I guess they never worked so maybe not?

Copy link
Member

@cds-amal cds-amal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outta here!

@eggplantzzz eggplantzzz merged commit 2d82260 into develop May 26, 2022
@eggplantzzz eggplantzzz deleted the remove-contract-types branch May 26, 2022 14:19
@wbt
Copy link
Contributor

wbt commented Jun 24, 2022

Yep...this was a breaking change on @truffle/contract put out on a patch-level bump. I'd really hoped this cluster of projects would get away from that practice, but it's unfortunately still fairly common.

Prior to merging this, there was a way to get Typescript to compile a TypeScript file with the line "import TruffleContract from '@truffle/contract';" (though it would drop that import in the transpiled code) and now previously working code can't even get past that line in failing to compile:

error TS7016: Could not find a declaration file for module '@truffle/contract'. '/project/path/node_modules/@truffle/contract/index.js' implicitly has an 'any' type. Try npm i --save-dev @types/truffle__contract if it exists or add a new declaration (.d.ts) file containing declare module '@truffle/contract';

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants