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

[PoC] Embed preview of all pages in Gatsby Admin #25637

Closed
wants to merge 2 commits into from

Conversation

mxstbr
Copy link
Contributor

@mxstbr mxstbr commented Jul 9, 2020

Note: based on #25635, until that is merged you'll also see those changes here

This is a proof of concept for a "sitemap" in Admin. It renders a list of all pages of a Gatsby site, including a preview of every one! 😱 Here is what the sitemap looks like for Admin itself (meta!):

Screenshot 2020-07-09 at 10 48 26

We don't necessarily have to merge this as-is, I'll leave that decision up to @shannonbux. However, this proves it's possible to show pages in Admin! 🎉

Technically, this uses the GatsbyPage provider I added to the recipes GraphQL API in #25248. I fetch that data and then render an <iframe> for every page for the "preview" 🙈 We should definitely not this for a list of all pages due to perf concerns with hundreds of iframes. However, doing it for one page at a time (or a truncated, scrollable list of pages where we only show 5-10 at a time) seems feasible!

@mxstbr mxstbr requested a review from shannonbux July 9, 2020 08:53
@mxstbr mxstbr requested a review from a team as a code owner July 9, 2020 08:53
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jul 9, 2020
@mxstbr mxstbr removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jul 9, 2020
@gatsby-cloud-staging
Copy link

Your pull request can be previewed in Gatsby Cloud: https://build-6f0bef91-196b-4ab4-ab91-9f35eb88b2d8.staging-previews.gtsb.io

@wardpeet
Copy link
Contributor

wardpeet commented Jul 9, 2020

Note: based on #25635, until that is merged you'll also see those changes here

You can use https://github.blog/changelog/2020-05-19-pull-request-retargeting/ & https://wchargin.github.io/posts/managing-dependent-pull-requests/ to make this flow better

@mxstbr mxstbr changed the title feat(gatsby-admin): render sitemap with all pages [POC] Embed preview of all pages in Gatsby Admin Jul 9, 2020
@mxstbr
Copy link
Contributor Author

mxstbr commented Jul 9, 2020

@pieh pointed out in chat that we can only really render 4 pages at a time in iframes:

There is some trickiness to displaying lot of actual iframes, because you will hit connection limit issue, because of some xhr polling or event source stuff that webpack-dev-server does - check #12225 (this mentions tab, but I assume iframe situation is kind of like tabs)


You can use https://github.blog/changelog/2020-05-19-pull-request-retargeting/ & https://wchargin.github.io/posts/managing-dependent-pull-requests/ to make this flow better

Ohhh I didn't realise GitHub added better support for this! Nice 👍

@mxstbr mxstbr changed the title [POC] Embed preview of all pages in Gatsby Admin [PoC] Embed preview of all pages in Gatsby Admin Jul 9, 2020
@mxstbr
Copy link
Contributor Author

mxstbr commented Jul 21, 2020

Closing for now as we're not going to ship this as-is!

@mxstbr mxstbr closed this Jul 21, 2020
@mxstbr mxstbr deleted the admin/render-sitemap branch July 21, 2020 05:53
@mxstbr mxstbr mentioned this pull request Jul 30, 2020
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