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

Nojira | Update nextjs to v13.4.20-canary.12; enable static export; remove use of next image #112

Closed
wants to merge 28 commits into from

Conversation

yvonnetangsu
Copy link
Member

@yvonnetangsu yvonnetangsu commented Aug 19, 2023

READY FOR REVIEW

Summary

  • Enable static export
  • Note: Previously, after updating to anything about next v13.4.9, I couldn't manually go to a page by typing in the URL (using internal links on the site works just fine). This seems to have fixed that problem. Also, previously, going to a non-existent page would show the "error" component, now, it shows the "not-found" component which is preferable.
  • Note: TBH I think the app directory still isn't 100% ready for production, but it's good to test things out 🤔

Review By (Date)

  • Whenever

Review Tasks

Setup tasks and/or behavior to test

  1. Go to the preview and see that all the interaction still works, and it looks the same as before
    https://deploy-preview-112--giving-campaign.netlify.app/
  2. Manually type initiatives after the above URL and hit enter, and check that you're taking to the initiative page instead of an error page
  3. Go to https://deploy-preview-112--giving-campaign.netlify.app/monkey and see that it shows the "Not found" temp page.
  4. See comments in the code

@netlify
Copy link

netlify bot commented Aug 19, 2023

Deploy Preview for giving-campaign ready!

Name Link
🔨 Latest commit a5a7fcf
🔍 Latest deploy log https://app.netlify.com/sites/giving-campaign/deploys/6515521c3f1fab0008789053
😎 Deploy Preview https://deploy-preview-112--giving-campaign.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@yvonnetangsu yvonnetangsu changed the title Nojira | Update nextjs to v13.4.18 and other packages Nojira | Update nextjs to v13.4.20-canary.12; enable static export Aug 30, 2023
@yvonnetangsu yvonnetangsu changed the title Nojira | Update nextjs to v13.4.20-canary.12; enable static export Nojira | Update nextjs to v13.4.20-canary.12; enable static export; remove use of next image Aug 30, 2023
@yvonnetangsu yvonnetangsu marked this pull request as ready for review August 30, 2023 19:56
@yvonnetangsu yvonnetangsu requested a review from sherakama August 30, 2023 20:40
@@ -14,7 +14,7 @@ type ParamsType = {
slug: string[];
};

async function generateStaticParams() {
export async function generateStaticParams() {
Copy link
Member Author

Choose a reason for hiding this comment

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

To use static export, I need to add export back here. Previously it generates a type error, but it seems ok now.

Comment on lines 2 to +4
const nextConfig = {
trailingSlash: true,
output: 'export',
Copy link
Member Author

Choose a reason for hiding this comment

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

To enable static export

Comment on lines +5 to +10
publish = "out"

[build.environment]
# For apps that use next export to generate static HTML
# set the NETLIFY_NEXT_PLUGIN_SKIP to true.
NETLIFY_NEXT_PLUGIN_SKIP="true"
Copy link
Member Author

Choose a reason for hiding this comment

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

These need to be set to use static export

Copy link
Member

Choose a reason for hiding this comment

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

What? Really? Link to Doxn?

Copy link
Member Author

@yvonnetangsu yvonnetangsu Aug 30, 2023

Choose a reason for hiding this comment

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

Here you go @sherakama
https://nextjs.org/docs/app/building-your-application/deploying/static-exports

It would also show me an error on the Netlify build page to do these two things

Copy link
Member Author

Choose a reason for hiding this comment

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

TBH I'm not 100% sure I want to go with this - but at least I finally get it to work once 😂 All the combination of things that blocked this from working before.....

@yvonnetangsu
Copy link
Member Author

yvonnetangsu commented Aug 30, 2023

@sherakama Another thing of interest - comparing deploy time before and after switching to static export + the nextjs update 🤔 ~1.5 min (before) vs ~30s (after)

Screenshot 2023-08-30 at 2 39 31 PM
Screenshot 2023-08-30 at 2 38 54 PM

…ra_update-package

* feature/GIVCAMP-201_blurry-bg-poster:
  eslint update and lint fix
  Image on left option
  linter and clean up
  more styles
  BlurryPoster and new MVP Homepage components; better typing for StoryblokData in some SB components
  Create Blurry Poster component
  GIVCAMP-199 | New homepage hero (#122)
  More finetuning responsive
  Clean up
  Play with hero animation
  make font size fluid; positioning of hero elements
  sr only H1
  New homepage hero
  GIVCAMP-198 | homepage Ideal fellow section with parallax explore (#121)
  GIVCAMP-197 | Changemaker card and section (#120)
  GIVCAMP-194 | Low budget data viz poc (#119)
  GIVCAMP-188 | Horizontal brochure poc; new CTA style (#118)
  Modularize import for heroicons (#117)

# Conflicts:
#	components/Storyblok/SbHomepage.tsx
#	package-lock.json
#	package.json
…ra_update-package

* feature/GIVCAMP-201_blurry-bg-poster:
  Revert old homepage; uninstall netlify nextjs plugin

# Conflicts:
#	components/Storyblok/SbHomepage.tsx
#	package-lock.json
#	package.json
@yvonnetangsu
Copy link
Member Author

@sherakama I merged the latest changes (some not yet in dev) into this branch because I created a new home page using the new SbHomepageMvp component. Merging this change in prevents any future builds in this PR from breaking and allows you to view the new homepage on your local 😄

Also, I uninstalled the netlify nextjs plugin as you suggested. The build log shows that it now automatically install the latest version - thanks!

@yvonnetangsu
Copy link
Member Author

I think I can close this one for now

@yvonnetangsu
Copy link
Member Author

@sherakama I previously had this PR which enables static export, and upgraded to 13.4.20-canary.12 which seems to be fine. No Safari button issue and 404 page seems ok too. Tagging you to see if there's anything we can use here.

@sherakama sherakama deleted the feature/nojira_update-package branch December 18, 2023 17:25
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