Skip to content

Improve SEO lib with seo option in loader data response#591

Merged
cartogram merged 3 commits into
2023-01from
@cartogram/seo-in-loader
Feb 27, 2023
Merged

Improve SEO lib with seo option in loader data response#591
cartogram merged 3 commits into
2023-01from
@cartogram/seo-in-loader

Conversation

@cartogram
Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Fixes #577

This PR implements a new API for SEO as described in the above issue.

I've also added tests for this component which required react-testing setup in vitest, though I've kept this setup as minimal as possible to start.

WHAT is this pull request doing?

HOW to test your changes?

Post-merge steps

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

@github-actions

This comment has been minimized.

@cartogram cartogram requested a review from a team February 27, 2023 16:55
brand: product?.vendor,
name: product?.title,
},
} satisfies SeoConfig<Product>;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

satisfies FTW 👁️👁️

Comment thread packages/hydrogen/src/seo/seo.ts Outdated
if (handle === undefined || handle.seo === undefined) {
return [];
if (
routeMatch.data === undefined ||
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: if (!route?.data?.seo)

Copy link
Copy Markdown
Contributor

@juanpprieto juanpprieto left a comment

Choose a reason for hiding this comment

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

💯

@@ -0,0 +1,153 @@
import {createElement} from 'react';
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

rename to ts

@cartogram cartogram mentioned this pull request Feb 27, 2023
14 tasks
@cartogram cartogram merged commit 8b65706 into 2023-01 Feb 27, 2023
@cartogram cartogram deleted the @cartogram/seo-in-loader branch February 27, 2023 18:53
@github-actions github-actions Bot mentioned this pull request Feb 27, 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.

Improving SEO ergonomics and providing sensible defaults

2 participants