-
Notifications
You must be signed in to change notification settings - Fork 137
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
Create client for App Router #1527
Conversation
🦋 Changeset detectedLatest commit: 3a96ea8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📦 Next.js Bundle Analysis for @faustwp/getting-started-exampleThis analysis was generated by the Next.js Bundle Analysis action. 🤖 🎉 Global Bundle Size Decreased
DetailsThe 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 If you want further insight into what is behind the changes, give @next/bundle-analyzer a try! Four Pages Changed SizeThe following pages changed size from the code in this PR compared to its base branch:
DetailsOnly 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 Any third party scripts you have added directly to your app using the 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. |
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
---|---|---|---|
🟢 | Statements | 83.64% | 854/1021 |
🟡 | Branches | 68.53% | 516/753 |
🟢 | Functions | 84.51% | 120/142 |
🟢 | Lines | 83.3% | 823/988 |
Test suite run success
122 tests passing in 22 suites.
Report generated by 🧪jest coverage report action from 3a96ea8
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
---|---|---|---|
🟢 | Statements | 84.71% | 72/85 |
🔴 | Branches | 57.14% | 8/14 |
🟡 | Functions | 63.64% | 14/22 |
🟢 | Lines | 83.58% | 56/67 |
Test suite run success
15 tests passing in 5 suites.
Report generated by 🧪jest coverage report action from 3a96ea8
The tests that were created are failing because they are not being ran within a React Server context (this is coming from an Apollo Error). I've opened an issue on the Apollo Experimental App Router repo to get more info on how to best navigate this within their package: |
There is an assertion error in this package. Maybe you can mock this to return true. Not ideal though since it implies knowledge of internal logic. Alternatively you can remove the |
@theodesp It's also not exported, which makes it pretty tough to mock. Thoughts on leaving this test commented out until we hear more from apollographql/apollo-client-nextjs#81? |
@blakewilson Sounds good to me. That helps you keep moving. Let's ticket the test issue though, so we don't accidentally forget, and circle back soon. There's a merge conflict here now. |
Tasks
Description
This PR adds the
getClient
function to the@faustwp/experimental-app-router
package to be used to fetch data from WordPress in RSCs (React Server Components). Additionally, this PR adds a new example project calledapp-router
for testing changes and features to the experimental app router work.Related Issue(s):
Testing
npm install
at the monorepo rootnpm run build
from the monorepo root.env.local
file from the.env.local.sample
inexamples/next/app-router
npm run generate -w @faustwp/app-router-example
to generate your site's possible typesnpm run dev -w @faustwp/app-router-example
to start the example project on http://localhost:3000/[postSlug]
to see post data being queried.Screenshots
Documentation Changes
Dependant PRs