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

Remove commands we don't want to support #13

Merged
merged 5 commits into from
Mar 6, 2024

Conversation

matthova
Copy link
Collaborator

@matthova matthova commented Mar 5, 2024

No description provided.

@matthova matthova force-pushed the matthova/remove-old-commands branch from 6998928 to 6eb9aa5 Compare March 5, 2024 00:10
Copy link
Collaborator

@afgiel afgiel left a comment

Choose a reason for hiding this comment

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

yeeeet lgtm

@matthova matthova force-pushed the matthova/remove-old-commands branch from 6eb9aa5 to 7cf96c6 Compare March 5, 2024 18:37
Copy link
Contributor

@infinitestory infinitestory left a comment

Choose a reason for hiding this comment

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

1 comment

yeet

export default function LayoutMode() {
const handleLayoutModeUpdate = React.useCallback((update: {layout_mode: number}) => {
const handleLayoutModeUpdate = React.useCallback((update: EventPayloadData<"ACTIVITY_LAYOUT_MODE_UPDATE">) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Prefer the const for the action name Events.ACTIVITY_LAYOUT_MODE_UPDATE, here and below

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We would need to import as a type, i.e.

import type {Events, EventPayloadData} from '@discord/embedded-app-sdk';

type Foo = EventPayloadData<Events.ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE>['participants']

As-is we get autocomplete and it will throw an error if it's not a valid string. Do we feel strongly about enforcing that style? I'm (strong opinion, loosely held) pro using strings because of the smaller size and less footguns around importing an enum

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Per convo, this doc is migrated to the main docs site, but we can explore updating our patterns in the docs outside the scope of this PR

@matthova matthova force-pushed the matthova/remove-old-commands branch from 7cf96c6 to cdb26cc Compare March 6, 2024 22:40
@matthova matthova merged commit 8edcca6 into main Mar 6, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants