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

Improve type safety for SEO data utilities #763

Merged
merged 1 commit into from
Apr 6, 2023

Conversation

davidhousedev
Copy link
Contributor

WHY are these changes introduced?

This PR brings more consistency to the typing of the seo data utilities. This preserves internal consistency within the module and will hopefully help folks in userland who bring the seo data utility module into their own repos.

WHAT is this pull request doing?

Previously, the collection and product seo data utilities in the demo store inferred the types of the data they returned. In contrast, other seo data utililties annotated the return type with the SeoConfig generic.

I realized that the product and collection utilities were using extracted functions for creating the jsonLd values, but those functions returned the incorrect type. I removed the unnecessary array typing and was then able to add the return typing to collection and product.

Continuation of #757

Checklist

  • I've read the Contributing Guidelines
  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've added a changeset if this PR contains user-facing or noteworthy changes
  • I've added tests to cover my changes
  • I've added or updated the documentation

@davidhousedev
Copy link
Contributor Author

cc: @frehner @juanpprieto @benjaminsehl this is a re-open of #757

@davidhousedev davidhousedev changed the title return typed data from product and collection SEO utilities Improve type safety for SEO data utilities Apr 6, 2023
@frehner
Copy link
Contributor

frehner commented Apr 6, 2023

Thanks! Looks like the CI checks are running now, so that's good. Once they pass I'll merge in

@frehner
Copy link
Contributor

frehner commented Apr 6, 2023

Oxygen preview failed. ☹️ Oh well.

@frehner frehner merged commit 0f4d562 into Shopify:2023-01 Apr 6, 2023
@github-actions github-actions bot mentioned this pull request Apr 6, 2023
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.

None yet

2 participants