-
Notifications
You must be signed in to change notification settings - Fork 24
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
1780/Cleanup getStaticProps and getStaticPaths #1861
Conversation
The main piece is to remove the export script, since it doesn't work with fallback: true (https://nextjs.org/docs/advanced-features/static-html-export#caveats)
✔️ Deploy Preview for dev-partners-bloom ready! 🔨 Explore the source changes: c1f2072 🔍 Inspect the deploy log: https://app.netlify.com/sites/dev-partners-bloom/deploys/6154c9e2fd8e0700078ca619 😎 Browse the preview: https://deploy-preview-1861--dev-partners-bloom.netlify.app |
✔️ Deploy Preview for dev-bloom ready! 🔨 Explore the source changes: c1f2072 🔍 Inspect the deploy log: https://app.netlify.com/sites/dev-bloom/deploys/6154c9e24998c90008f758d6 😎 Browse the preview: https://deploy-preview-1861--dev-bloom.netlify.app |
✔️ Deploy Preview for dev-storybook-bloom ready! 🔨 Explore the source changes: c1f2072 🔍 Inspect the deploy log: https://app.netlify.com/sites/dev-storybook-bloom/deploys/6154c9e28fff2a000734e844 😎 Browse the preview: https://deploy-preview-1861--dev-storybook-bloom.netlify.app |
sites/public/pages/index.tsx
Outdated
<Hero | ||
title={heroTitle} | ||
buttonTitle={t("welcome.seeRentalListings")} | ||
buttonLink="/listings" | ||
allApplicationsClosed={ | ||
!props.listings.some(listingOpen) && !props.listings.some(openDateState) | ||
} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This piece has been updated on Alameda for some time now, since the current logic doesn't account for listings with no application due date. I'm not sure we really need this check here, and it gives us one less route where we're querying listings.
CHANGELOG.md
Outdated
@@ -46,6 +46,7 @@ All notable changes to this project will be documented in this file. The format | |||
|
|||
- Upgrade the public and partners sites to Next v11 and React v17 ([#1793](https://github.com/bloom-housing/bloom/pull/1793)) (Jared White) | |||
- **Breaking Change** | |||
- The cache revalidation piece doesn't actually change here, the main changes are is so that errors aren't swallowed on builds and fails them (should cover #1618) and I removed the export script, since it isn't valid with [fallback: true](https://nextjs.org/docs/advanced-features/static-html-export#caveats). So we'll have to change the build command to replace `export` with `start`. ([#1861](https://github.com/bloom-housing/bloom/pull/1861)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are is so
I'm a little confused as to why this one is titled cache revalidation / what is changing there? Maybe just the title needs to be changed? |
Updated title to be more appropriate for what changed. |
@emilyjablonski , updated change log and changed PR title. |
LGTM apart from the build issues, not sure if they were going to be resolved pre- or post-merge |
So the reason why the public build fails on this branch is because the build actually depends on the backend server. If you look at passing public builds, you'll see errors that are swallowed by the try catches. So I'll need to think about the best way to handle this that doesn't require adding the catch back in. |
* updates to allow for errors to stop builds The main piece is to remove the export script, since it doesn't work with fallback: true (https://nextjs.org/docs/advanced-features/static-html-export#caveats) * Update CHANGELOG.md * Update CHANGELOG.md * updates getStaticPaths to not error in test env * updates getStaticProps to not error in test env * fix: testing * fix: updated listings and id/slug and builds locally at least
Issue
Addresses #1780
Description
The cache revalidation piece doesn't actually change here, the main changes are is so that errors aren't swallowed on builds and fails them (should cover #1618) and I removed the export script, since it isn't valid with fallback: true. So we'll have to change the build command to replace
export
withstart
.This doesn't address the second part of #1780, which is to add applicationOpenDate to the form and check against that before displaying, since that feels separate enough to warrant another PR.
Type of change
How Can This Be Tested/Reviewed?
I tested locally by starting the back end, then building and starting public. If you have partners started, you should be able to add/edit a listing and after
CACHE_REVALIDATE
(set in your .env) expires, you should see the update after refreshing. You should also be able to stop the backend and continue to see listings and go to detail pages.Checklist:
yarn generate:client
if I made backend changes