-
Notifications
You must be signed in to change notification settings - Fork 196
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
feat(common): clarify resourceId (hex) from resource (object) #1706
Conversation
🦋 Changeset detectedLatest commit: f77f2ce The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
packages/common/src/common.ts
Outdated
namespace: string; | ||
name: string; | ||
type: ResourceType; | ||
hex: Hex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should arguably call this resourceId
if we're calling the object "resource"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree this could be resourceId
@@ -30,9 +29,6 @@ | |||
"codegen": [ | |||
"./src/codegen/index.ts" | |||
], | |||
"deprecated": [ | |||
"./src/deprecated/index.ts" | |||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since there's @deprecated
typedoc operator that does a better job of signaling deprecated stuff, I am preferring that now over marking this as deprecated in the export path
import { Hex, stringToHex, hexToString, sliceHex, concatHex } from "viem"; | ||
|
||
/** @deprecated Use `tableIdToHex` and `hexToTableId` instead. */ | ||
export class TableId { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was deprecated/replaced a while ago but never removed and technically wouldn't work now anyway, so not sure we should consider this "breaking" because it's ~incompatible with the current MUD versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems like /deprecated
is not exported anymore, should we keep createContract
in the src
directory then? Or fully remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah i see now /deprecated
is still exported from the root index
, so nevermind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep! we're just keeping things in /deprecated
to make it easier to figure out what we need to remove in the future
in #1702, I found myself getting a bit confused between resource ID (hex on chain) and resource ID (object in client)
I'm not sure if this is better but pulling this out in case we think this is a good direction
should
hexToResource
beresourceIdToResource
ordecodeResourceId
?