-
Notifications
You must be signed in to change notification settings - Fork 154
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
Add localized description to the dev server kit #2703
Conversation
Thanks for your contribution! Depending on what you are working on, you may want to request a review from a Shopify team:
|
9c94483
to
4dc4205
Compare
Coverage report
Test suite run success1427 tests passing in 669 suites. Report generated by 🧪jest coverage report action from 84fddcf |
This comment has been minimized.
This comment has been minimized.
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.
Looks great - dev flow works. We're just missing a change here to get the description deployed:
return { |
packages/ui-extensions-server-kit/src/ExtensionServerClient/ExtensionServerClient.ts
Show resolved
Hide resolved
ad7ee34
to
7417a88
Compare
...(extension.description && { | ||
description: | ||
parsedTranslation && extension.description?.startsWith('t:') | ||
? this._getLocalizedValue(parsedTranslation, extension.description) | ||
: extension.description, | ||
}), |
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.
probably don't need to check if there is a description, this should be safe:
...(extension.description && { | |
description: | |
parsedTranslation && extension.description?.startsWith('t:') | |
? this._getLocalizedValue(parsedTranslation, extension.description) | |
: extension.description, | |
}), | |
description: | |
parsedTranslation && extension.description?.startsWith('t:') | |
? this._getLocalizedValue(parsedTranslation, extension.description) | |
: extension.description, |
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.
Wouldn't that end up having also a description: undefined
value in the payload if there is no description?
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.
right, is that a bad thing? if you prefer to not have description
at all that's ok for me.
but anyone reading the payload won't care if it's undefined or just not present, the result would be the same no?
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 wouldn't make a difference since description
is always optional. Consumers of the payload will always need to check if it's present so it doesn't matter if it's undefined
or not set.
7715a8c
to
55128d8
Compare
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.
Looks good aside from the comment about the pnpm-lock. We also need a changeset. Can you generate one please?
edcdcb3
to
84fddcf
Compare
WHY are these changes introduced?
Enabling localized description for deving ui_extensions.
Fixes #393
The optional description field is supported on the deploy flow for UI Extensions but there was this missing pice to be able to
dev
it.WHAT is this pull request doing?
Adding
description
and the translation logic to the websocket message payloads.How to test your changes?
git checkout update-drafts-for-all-extensions-in-dev
description: 't:new_key'
shopify app dev --path your_app_folder_here
Measuring impact
How do we know this change was effective? Please choose one:
Checklist
dev
ordeploy
have been reflected in the internal flowchart.