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

unify algorithms for masking and migration #12139

Merged
merged 25 commits into from
Nov 19, 2024
Merged

Conversation

phryneas
Copy link
Member

No description provided.

Copy link

changeset-bot bot commented Nov 18, 2024

🦋 Changeset detected

Latest commit: dd9004f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@apollo/client Patch

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

@svc-apollo-docs
Copy link

svc-apollo-docs commented Nov 18, 2024

✅ Docs Preview Ready

No new or changed pages found.

Copy link

pkg-pr-new bot commented Nov 18, 2024

npm i https://pkg.pr.new/@apollo/client@12139

commit: dd9004f

Copy link
Contributor

github-actions bot commented Nov 18, 2024

size-limit report 📦

Path Size
dist/apollo-client.min.cjs 40.78 KB (+0.29% 🔺)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" 51.04 KB (-0.18% 🔽)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" (production) 47.9 KB (+0.52% 🔺)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" 36.3 KB (-0.2% 🔽)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" (production) 33.7 KB (+0.33% 🔺)
import { ApolloProvider } from "dist/react/index.js" 1.26 KB (0%)
import { ApolloProvider } from "dist/react/index.js" (production) 1.24 KB (0%)
import { useQuery } from "dist/react/index.js" 5.21 KB (0%)
import { useQuery } from "dist/react/index.js" (production) 4.3 KB (0%)
import { useLazyQuery } from "dist/react/index.js" 5.71 KB (0%)
import { useLazyQuery } from "dist/react/index.js" (production) 4.78 KB (0%)
import { useMutation } from "dist/react/index.js" 3.62 KB (0%)
import { useMutation } from "dist/react/index.js" (production) 2.85 KB (0%)
import { useSubscription } from "dist/react/index.js" 4.43 KB (0%)
import { useSubscription } from "dist/react/index.js" (production) 3.48 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" 5.51 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" (production) 4.17 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js" 5.01 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js" (production) 3.66 KB (0%)
import { useLoadableQuery } from "dist/react/index.js" 5.09 KB (0%)
import { useLoadableQuery } from "dist/react/index.js" (production) 3.74 KB (0%)
import { useReadQuery } from "dist/react/index.js" 3.42 KB (0%)
import { useReadQuery } from "dist/react/index.js" (production) 3.36 KB (0%)
import { useFragment } from "dist/react/index.js" 2.37 KB (0%)
import { useFragment } from "dist/react/index.js" (production) 2.31 KB (0%)

definition.selectionSet,
context
);
const [masked, changed] = disableWarningsSlot.withValue(true, () => {
Copy link
Member

Choose a reason for hiding this comment

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

Some things I see and wonder why I didn't think of it sooner 😆. Nice!

@phryneas phryneas marked this pull request as ready for review November 19, 2024 15:54
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.

Going to push a few minor updates before merging, but otherwise this looks great! Looking forward to getting this in. Thanks for the assist 🙂

Comment on lines 181 to 182
path: string | undefined,
migration: boolean
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
path: string | undefined,
migration: boolean
migration: boolean,
path?: string | undefined,

I think it might make sense to flip these around, which means we can keep path optional. Since migration is required anyways, might as well reduce a required argument in those areas we pass undefined anyways. Should reduce a touch of bundle size.

}

function addAccessorWarning(
data: Record<string, any>,
function getAccessorWarningDescriptor(
Copy link
Member

Choose a reason for hiding this comment

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

Love this refactor!

Probably petty, but now that we aren't passing data as the first argument, can we swap the value and fieldName arguments? Right now it feels inverse to me and my brain breaks 🤣

Copy link
Member Author

Choose a reason for hiding this comment

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

Switch around as you like :) I just wanted to keep data out to prevent potential memory leaks, and started writing to value so we don't keep a reference to the original value around forever

@github-actions github-actions bot added the auto-cleanup 🤖 label Nov 19, 2024
@jerelmiller jerelmiller merged commit 5a53e15 into release-3.12 Nov 19, 2024
41 of 45 checks passed
@jerelmiller jerelmiller deleted the pr/no-two-algorithms branch November 19, 2024 18:33
@github-actions github-actions bot mentioned this pull request Nov 19, 2024
This was referenced Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants