-
Notifications
You must be signed in to change notification settings - Fork 57
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
Upgrading to use ts-rs 10.0.0 #394
Conversation
Looks like everything changed from |
Ya the comments are a huge bonus. The interface vs type thing isn't too important for our purposes, both work. |
K this is ready for review now. |
pushd ../lemmy/scripts | ||
./test.sh | ||
pushd ../lemmy | ||
cargo test --workspace export_bindings |
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 is a way to generate the bindings without actually running the tests.
/** | ||
* Adds an admin to a site. | ||
*/ | ||
export type AddAdmin = { person_id: PersonId; added: boolean }; |
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.
ts-rs now uses types instead of interfaces, but we get comments now 🥳
@@ -73,6 +74,7 @@ export { CustomEmojiId } from "./types/CustomEmojiId"; | |||
export { CustomEmojiKeyword } from "./types/CustomEmojiKeyword"; | |||
export { CustomEmojiResponse } from "./types/CustomEmojiResponse"; | |||
export { CustomEmojiView } from "./types/CustomEmojiView"; | |||
export { DbUrl } from "./types/DbUrl"; |
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 DbUrl
and SensitiveString
be exposed as types for this? They're both just aliases for string
anyway.
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.
Its what ts-rs generates. Its not really worth it to try to rewrite the wrapper types ts(as....
) on the back end, especially since these are just simple aliases.
This upgrades to the newest version of ts-rs.
I also added a back-end check on the lemmy PR to make sure there are no nulls now, only optionals.