Skip to content
This repository has been archived by the owner on May 10, 2021. It is now read-only.

Support for SSG preview mode #50

Merged
merged 6 commits into from
Oct 27, 2020
Merged

Support for SSG preview mode #50

merged 6 commits into from
Oct 27, 2020

Conversation

lindsaylevine
Copy link
Contributor

still a few question marks to address with finn re: serving *.json data files for these pages, no-cache, etc and 3 redirect tests to modify

@lindsaylevine lindsaylevine added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Oct 6, 2020
Copy link
Collaborator

@FinnWoelm FinnWoelm left a comment

Choose a reason for hiding this comment

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

This 👏 looks 👏 so 👏 cool!

lib/pages/getStaticProps/redirects.js Outdated Show resolved Hide resolved
lib/pages/getStaticProps/redirects.js Outdated Show resolved Hide resolved
lib/pages/getStaticProps/redirects.js Show resolved Hide resolved
lib/steps/setupRedirects.js Outdated Show resolved Hide resolved
lib/steps/setupRedirects.js Show resolved Hide resolved
lib/steps/setupRedirects.js Outdated Show resolved Hide resolved
lib/templates/netlifyFunction.js Outdated Show resolved Hide resolved
lib/pages/getStaticProps/setup.js Outdated Show resolved Hide resolved
@FinnWoelm
Copy link
Collaborator

What's the impact of this on anyone who does not yet have access to Netlify's cookie-based redirects? Or has the feature been rolled out to everyone?

@lindsaylevine
Copy link
Contributor Author

What's the impact of this on anyone who does not yet have access to Netlify's cookie-based redirects? Or has the feature been rolled out to everyone?

the cookie-based redirects won't officially be rolled out for another several weeks, i believe. need to touch base with them on that. realistically, we could merge because netlify would just ignore the condition on the redirect and so the redirect would just be moot, but we'd be generating pages for nothing in the meantime. should probably just keep open until it's officially rolled out?

@lindsaylevine lindsaylevine force-pushed the ssg-preview-mode branch 2 times, most recently from 9fbbaef to 7f6a0eb Compare October 14, 2020 11:07
Copy link
Collaborator

@FinnWoelm FinnWoelm left a comment

Choose a reason for hiding this comment

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

Nice work!! It's coming together!

PS: I think it would be really good to have some Cypress tests for this! 😊

lib/pages/getStaticProps/redirects.js Outdated Show resolved Hide resolved
lib/pages/getStaticProps/setup.js Show resolved Hide resolved
lib/steps/setupRedirects.js Show resolved Hide resolved
lib/steps/setupRedirects.js Outdated Show resolved Hide resolved
lib/helpers/setupNetlifyFunctionForPage.js Outdated Show resolved Hide resolved
@lindsaylevine lindsaylevine force-pushed the ssg-preview-mode branch 3 times, most recently from 63177b1 to 162374a Compare October 23, 2020 20:11
Copy link
Collaborator

@FinnWoelm FinnWoelm left a comment

Choose a reason for hiding this comment

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

Looks really really good aside from the major issue regarding optional catch-all routes at root-level, that we are discussing on Slack. We'll figure it out!! 💪

.gitignore Outdated Show resolved Hide resolved
cypress/fixtures/pages/previewTest/static.js Show resolved Hide resolved
cypress/integration/default_spec.js Show resolved Hide resolved
lib/helpers/setupNetlifyFunctionForPage.js Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
FinnWoelm and others added 3 commits October 24, 2020 19:03
Test that prerendered pages and static files from /public are correctly 
served under the redirect engine used with cookie-based redirects when 
having an optional catch-all route at root-level.
We do not need `existsSync` in the `setupNetlifyFunctionForPage` helper.
Copy link
Collaborator

@FinnWoelm FinnWoelm left a comment

Choose a reason for hiding this comment

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

Yay!!

On the README, I think it's better not to flag "Preview mode" so prominently under Caveats. The lacking support for netlify dev is a really minor edge case. IMO, it's better mentioned at the end of the Preview locally section:

Note: netlify dev does not yet fully support Next.js Preview Mode.

lib/helpers/isRouteWithFallback.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@FinnWoelm FinnWoelm left a comment

Choose a reason for hiding this comment

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

CONGRATULATIONS! 🎉 ✨ YOU HAVE DONE IT! 👏 👏

PS: Keeping my fingers crossed on /* /:splat 200 🤞😁

@lindsaylevine lindsaylevine merged commit c23aee5 into main Oct 27, 2020
lindsaylevine added a commit that referenced this pull request Oct 27, 2020
- Support for SSG Preview Mode ([#50](#50))
- Expose core setup logic to be required as a package ([#64](#64))
- Miscellaneous README cleanup
@lindsaylevine lindsaylevine deleted the ssg-preview-mode branch December 22, 2020 15:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants