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

reuse playwright tests for integration tests of React Router and TanStack #426

Merged
merged 19 commits into from
Feb 14, 2025

Conversation

phryneas
Copy link
Member

No description provided.

@phryneas phryneas requested a review from a team as a code owner February 10, 2025 12:45
Copy link

changeset-bot bot commented Feb 10, 2025

⚠️ No Changeset found

Latest commit: e532b5b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

pkg-pr-new bot commented Feb 10, 2025

npm i https://pkg.pr.new/apollographql/apollo-client-nextjs/@apollo/client-react-streaming@426
npm i https://pkg.pr.new/apollographql/apollo-client-nextjs/@apollo/experimental-nextjs-app-support@426
npm i https://pkg.pr.new/apollographql/apollo-client-nextjs/@apollo/client-integration-react-router@426
npm i https://pkg.pr.new/apollographql/apollo-client-nextjs/@apollo/client-integration-tanstack-start@426

commit: c7cddb1

Copy link

vercel bot commented Feb 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
apollo__client-integration-react-router ✅ Ready (Inspect) Visit Preview Feb 14, 2025 9:57am
apollo__client-integration-tanstack-start ✅ Ready (Inspect) Visit Preview Feb 14, 2025 9:57am

Copy link

relativeci bot commented Feb 10, 2025

#468 Bundle Size — 1.3MiB (+3.95%).

c7cddb1(current) vs 5293db1 main#409(baseline)

Warning

Bundle contains 1 duplicate package – View duplicate packages

Warning

Bundle introduced one new package: process – View changed packages

Bundle metrics  Change 8 changes Regression 1 regression Improvement 3 improvements
                 Current
#468
     Baseline
#409
Regression  Initial JS 1.05MiB(+5.44%) 1016.91KiB
Improvement  Initial CSS 0B(-100%) 70B
Change  Cache Invalidation 80.16% 0.08%
No change  Chunks 34 34
Change  Assets 58(-1.69%) 59
Change  Modules 664(+4.4%) 636
Improvement  Duplicate Modules 89(-16.04%) 106
Change  Duplicate Code 3.91%(-16.81%) 4.7%
Improvement  Packages 25(-3.85%) 26
No change  Duplicate Packages 1 1
Bundle size by type  Change 2 changes Regression 2 regressions
                 Current
#468
     Baseline
#409
Regression  JS 1.29MiB (+100%) undefined
Regression  Other 9.23KiB (+100%) undefined

Bundle analysis reportBranch pr/refactor-testsProject dashboard


Generated by RelativeCIDocumentationReport issue

Copy link
Member

@jerelmiller jerelmiller left a comment

Choose a reason for hiding this comment

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

Super cool!

BASE_URL: ${{ github.event.deployment_status.environment_url }}

- name: "Run Playwright tests against Vercel deployment - React Router"
if: github.event.deployment_status.environment == 'Preview – apoll__client-integration-react-router'
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if: github.event.deployment_status.environment == 'Preview – apoll__client-integration-react-router'
if: github.event.deployment_status.environment == 'Preview – apollo__client-integration-react-router'

if: |
github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success' && (
github.event.deployment_status.environment == 'Preview – apollo__experimental-nextjs-app-support' ||
github.event.deployment_status.environment == 'Preview – apollo__client-integration-tanstack-start'
Copy link
Member

Choose a reason for hiding this comment

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

Does this need to include react router or is it intentionally omitted?

Copy link
Member Author

Choose a reason for hiding this comment

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

Very good call! I can't test this until it hits main, so this is a bit hazy to test (I'll probably cherry-pick this file over)

Comment on lines +39 to +41
<>
<p>{error.message}</p>
</>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<>
<p>{error.message}</p>
</>
<p>{error.message}</p>

The smallest of nitpicks since its in a test, but figured I'd comment anyways 🤣

context: { delay: 1000, ...(errorIn ? { error: errorIn } : {}) },
});
return {
queryRef,
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious how queryRef plays a role here since its not used in Child or RouteComponent. Would you mind explaining that one? Is just calling preloadQuery enough?

Copy link
Member Author

@phryneas phryneas Feb 14, 2025

Choose a reason for hiding this comment

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

Just calling preloadQuery won't do anything - the signal that the data should go over the network is the act of including the queryRef in the loader return value.
The queryRef will get hydrated on arrival in the browser and start filling the cache - for that part it doesn't matter if you actually use it.
Compare this to useBackgroundQuery without actually listening on the ref - the network request happens anyways.

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