chore: Update starter example#2268
Conversation
|
📦 Next.js Bundle Analysis for @faustwp/getting-started-exampleThis analysis was generated by the Next.js Bundle Analysis action. 🤖
|
| Page | Size (compressed) |
|---|---|
global |
245.12 KB (🟡 +11.93 KB) |
Details
The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.
Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis
If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!
Two Pages Changed Size
The following pages changed size from the code in this PR compared to its base branch:
| Page | Size (compressed) | First Load | % of Budget (350 KB) |
|---|---|---|---|
/example |
10.23 KB |
255.35 KB | 72.96% (🟢 -8.02%) |
/preview |
259 B |
245.38 KB | 70.11% (+/- <0.01%) |
Details
Only the gzipped size is provided here based on an expert tip.
First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.
Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis
The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.
Pin @wordpress/block-library to exact 9.10.0 to prevent SCSS import breakage in E2E tests, add --webpack flag to bundle analysis build for Turbopack compatibility, and drop Node 18 from E2E matrix to match engines requirement.
# Conflicts: # package-lock.json
faustwp-getting-started to Next.js 16
faustwp-getting-started to Next.js 16f37406f to
d0c8eb9
Compare
The :global(.component *) block in ContentWrapper.module.scss targeted the literal un-mangled class .component, while ContentWrapper.js applies the mangled CSS module class — so these styles never matched. The block styles already work via global.scss importing _blocks.scss. Simply removing the dead :global block fixes the Next.js 16 purity error without needing any webpack overrides.
d0c8eb9 to
051c1f6
Compare
There was a problem hiding this comment.
Pull request overview
This PR upgrades the faustwp-getting-started example from Next.js 14 to Next.js 16, addressing breaking changes and refactoring GraphQL query patterns to improve maintainability.
Changes:
- Upgraded to Next.js 16.1.6 with corresponding dependency updates
- Refactored GraphQL queries to use a shared
GET_LAYOUT_QUERYfragment and multiple queries per template - Updated Next.js configuration for v16 compatibility (remotePatterns, sassOptions)
- Fixed CI/CD workflows to support Turbopack requirements and updated Node version matrix
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Upgraded Next.js to 16.1.6, pinned @wordpress/block-library to 9.10.0, updated engines to require Node >=20.9 |
| next.config.js | Replaced deprecated images.domains with remotePatterns, updated sassOptions includePaths |
| fragments/LayoutQuery.js | New shared GraphQL query fragment for layout data (general settings, menus) |
| wp-templates/tag.js | Refactored to use useFaustQuery with Component.queries array pattern |
| wp-templates/single.js | Refactored to use multiple queries with shared layout query |
| wp-templates/page.js | Refactored to use useFaustQuery with Component.queries array pattern |
| wp-templates/index.js | Changed front-page to static import, added ssr: false to other dynamic imports |
| wp-templates/front-page.js | Refactored to use shared layout query and useFaustQuery |
| wp-templates/category.js | Refactored to use useFaustQuery with Component.queries array pattern |
| components/NavigationMenu/*.scss | Updated SCSS import paths from 'styles/' to '../../styles/' |
| components/Hero/Hero.module.scss | Updated SCSS import paths from 'styles/' to '../../styles/' |
| components/Header/Header.module.scss | Updated SCSS import paths from 'styles/' to '../../styles/' |
| components/EntryHeader/EntryHeader.module.scss | Updated SCSS import paths from 'styles/' to '../../styles/' |
| components/ContentWrapper/ContentWrapper.module.scss | Removed inline WordPress block styles (now imported globally) |
| .github/workflows/nextjs-bundle-analysis.yml | Updated Node version to 20, added --webpack flag to build command |
| .github/workflows/e2e-next-faustwp-example.yml | Removed Node 18 from test matrix |
Comments suppressed due to low confidence (5)
examples/next/faustwp-getting-started/next.config.js:16
- The remotePatterns configuration is missing the
protocolproperty. According to Next.js documentation, remotePatterns should include a protocol field. For most WordPress installations, this should be 'https'. The configuration should look like:{ protocol: 'https', hostname: getWpHostname() }
remotePatterns: [
{
hostname: getWpHostname(),
},
examples/next/faustwp-getting-started/wp-templates/tag.js:46
- Missing nullish coalescing operator on
useFaustQuery(GET_LAYOUT_QUERY). This is inconsistent with the same pattern used in single.js, page.js, and front-page.js, where the result is protected with?? {}. Without this guard, the destructuring on line 45-46 could fail if the query returns undefined.
const { generalSettings, headerMenuItems, footerMenuItems } =
useFaustQuery(GET_LAYOUT_QUERY);
examples/next/faustwp-getting-started/wp-templates/category.js:46
- Missing nullish coalescing operator on
useFaustQuery(GET_LAYOUT_QUERY). This is inconsistent with the same pattern used in single.js, page.js, and front-page.js, where the result is protected with?? {}. Without this guard, the destructuring on line 45-46 could fail if the query returns undefined.
const { generalSettings, headerMenuItems, footerMenuItems } =
useFaustQuery(GET_LAYOUT_QUERY);
examples/next/faustwp-getting-started/wp-templates/tag.js:75
- Missing
keyprop on Post component within map function. React requires a unique key prop for each element in a list. The query returnsidfield (line 25) which should be used as the key:key={post.node.id}
<Post
title={post.node.title}
content={post.node.content}
date={post.node.date}
author={post.node.author?.node.name}
uri={post.node.uri}
featuredImage={post.node.featuredImage?.node}
/>
examples/next/faustwp-getting-started/wp-templates/category.js:75
- Missing
keyprop on Post component within map function. React requires a unique key prop for each element in a list. The query returnsidfield (line 25) which should be used as the key:key={post.node.id}
<Post
title={post.node.title}
content={post.node.content}
date={post.node.date}
author={post.node.author?.node.name}
uri={post.node.uri}
featuredImage={post.node.featuredImage?.node}
/>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Upgrades the
faustwp-getting-startedexample from Next.js 14 to 16 and addresses breaking changes.Changes
next@^16.1.6, replace deprecatedimages.domainswithremotePatterns, and adjustsassOptionsGET_LAYOUT_QUERYfragment and update all templates to use multiple queries with default variable values--webpackflag to bundle analysis build (required by@next/bundle-analyzer), pin@wordpress/block-libraryto exact9.10.0to prevent SCSS import failures in lockfile-free E2E runs, and drop Node 18 from the E2E matrix to matchengines >=20.9