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 SEO lib with seo option in loader data response #591

Merged
merged 3 commits into from
Feb 27, 2023

Conversation

cartogram
Copy link
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
Contributor

Choose a reason for hiding this comment

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

satisfies FTW 👁️👁️

@@ -45,7 +45,18 @@ export function Seo({debug}: SeoProps) {
const routeInfo = {...routeMatch, ...location};

if (handle === undefined || handle.seo === undefined) {
return [];
if (
routeMatch.data === undefined ||
Copy link
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
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
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
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