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

Updates localized field hooks in Unstable #2559

Open
wants to merge 3 commits into
base: unstable
Choose a base branch
from

Conversation

rcaplanshopify
Copy link
Contributor

@rcaplanshopify rcaplanshopify commented Jan 8, 2025

Background

This PR optimizes the useLocalizedFields hook and introduces the useLocalizedField hook. It also updates the related docs.

Solution

(Describe your solution, why this approach was chosen, and what the alternatives/impacts may be)

🎩

Unstable localized field API docs
Screenshot 2025-01-21 at 1 59 34 PM

Checklist

  • I have 🎩'd these changes
  • I have updated relevant documentation

@rcaplanshopify
Copy link
Contributor Author

/snapit

@shopify-github-actions-access
Copy link
Contributor

🫰✨ Thanks @rcaplanshopify! Your snapshot has been published to npm.

Test the snapshot by updating your package.json with the newly published version:

"@shopify/ui-extensions-react": "0.0.0-snapshot-20250108190357"

@rcaplanshopify rcaplanshopify force-pushed the rc/update-localized-fields-hook branch 2 times, most recently from 933408a to 6c51c6a Compare January 14, 2025 21:50
@rcaplanshopify
Copy link
Contributor Author

/snapit

@shopify-github-actions-access
Copy link
Contributor

🫰✨ Thanks @rcaplanshopify! Your snapshot has been published to npm.

Test the snapshot by updating your package.json with the newly published version:

"@shopify/ui-extensions-react": "0.0.0-snapshot-20250114215839"

@rcaplanshopify
Copy link
Contributor Author

/snapit

@shopify-github-actions-access
Copy link
Contributor

🫰✨ Thanks @rcaplanshopify! Your snapshot has been published to npm.

Test the snapshot by updating your package.json with the newly published version:

"@shopify/ui-extensions-react": "0.0.0-snapshot-20250114231812"

@rcaplanshopify rcaplanshopify force-pushed the rc/update-localized-fields-hook branch from 40d9896 to 243e14f Compare January 17, 2025 18:50
@rcaplanshopify rcaplanshopify force-pushed the rc/update-localized-fields-hook branch from 243e14f to b42540d Compare January 21, 2025 21:43
@rcaplanshopify rcaplanshopify changed the title Updates useLocalizedFields hook Updates localized field hooks in Unstable Jan 21, 2025
@rcaplanshopify rcaplanshopify marked this pull request as ready for review January 21, 2025 22:00
@@ -62,7 +62,7 @@ export interface Extension<Target extends ExtensionTarget = ExtensionTarget> {
/**
* The API version that was set in the extension config file.
*
* @example '2024-04', '2024-07', '2024-10', '2025-01', 'unstable'
* @example '2024-07', '2024-10', '2025-01', '2025-04', 'unstable'
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we want to add this yet. It's not a valid version yet so could be a little misleading. Usually we add this days before publishing.

@@ -917,6 +918,7 @@ export type StorefrontApiVersion =
| '2024-07'
| '2024-10'
| '2025-01'
| '2025-04'
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we want to add this yet. It's not a valid version yet so could be a little misleading. Usually we add this days before publishing.

@@ -24,6 +24,7 @@ export type ApiVersion =
| '2024-07'
| '2024-10'
| '2025-01'
| '2025-04'
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we want to add this yet. It's not a valid version yet so could be a little misleading. Usually we add this days before publishing.

{
title: 'useLocalizedField',
description:
'Returns the current localized fields and re-renders your component if the values change.',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'Returns the current localized fields and re-renders your component if the values change.',
'Returns the requested localized field and re-renders your component if the value changes.',

@rcaplanshopify rcaplanshopify force-pushed the rc/update-localized-fields-hook branch from 512608b to 2ed23b7 Compare January 21, 2025 22:48
@rcaplanshopify
Copy link
Contributor Author

The version updates have been dropped, and the typo has been fixed.

Screenshot 2025-01-21 at 3 00 03 PM

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.

2 participants