Skip to content

Add SSR for product page… and others? #5

Description

@real34

The goal here is to backport the UPWARD based routing system based on the remote urlResolver to allow the product page to be accessed directly without any errors.

It should display a product specific app shell (similar to https://github.com/magento-research/pwa-studio/blob/release/2.0/packages/venia-concept/templates/product-shell.mst for instance), ideally with a JSON-LD template.

Example: https://front-commerce-lite-upward.now.sh/product/SHOE-01 must not return an error (since the page works when accessed from the HP).

In the end, this issue might allow to explore page polymorphism and be easily extensible to other type of Things.

It also is a good first step to start working on interoperability across PWA solutions.

Resources which may help

See: https://github.com/magento-research/pwa-studio/blob/981eda64fd1ce197131f10c906e3c35ada11db8c/packages/venia-concept/venia-upward.yml#L74

In Front-Commerce, the query is:

{
  matchUrls(url: "hera-pullover-hoodie.html") {
    url
    type
    identifier
    target_path
    redirect_type
  }
  categoryUrl: matchUrls(url: "women/tops-women.html") {
    url
    type
    identifier
    target_path
    redirect_type
  }
}

https://demo.front-commerce.com/graphiql?query=%7B%0A%20%20matchUrls(url%3A%20%22hera-pullover-hoodie.html%22)%20%7B%0A%20%20%20%20url%0A%20%20%20%20type%0A%20%20%20%20identifier%0A%20%20%20%20target_path%0A%20%20%20%20redirect_type%0A%20%20%7D%0A%20%20categoryUrl%3A%20matchUrls(url%3A%20%22women%2Ftops-women.html%22)%20%7B%0A%20%20%20%20url%0A%20%20%20%20type%0A%20%20%20%20identifier%0A%20%20%20%20target_path%0A%20%20%20%20redirect_type%0A%20%20%7D%0A%7D

Note: I think Magento2 does not handle 301 redirection yet, and that is something that might need to be discussed in the PWA Studio issues to find a way to redirect people (doable in the resolver directly without any changes, but it may lead to updates in the UPWARD spec to ensure it does not cause issues during the resolution)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions