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

Build tooling 3/? - export conditions #12385

Draft
wants to merge 24 commits into
base: release-4.0
Choose a base branch
from
Draft

Conversation

phryneas
Copy link
Member

No description provided.

Copy link

changeset-bot bot commented Feb 20, 2025

🦋 Changeset detected

Latest commit: 95abc11

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 Major

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 Feb 20, 2025

⚠️ Docs preview not attached to branch

The preview was not built because the PR's base branch release-4.0 is not in the list of sources.

An Apollo team member can comment one of the following commands to dictate which branch to attach the preview to:

  • !docs set-base-branch version-2.6
  • !docs set-base-branch main

Build ID: 6e5ec58a966f50c9b6e14041

Copy link

netlify bot commented Feb 20, 2025

Deploy Preview for apollo-client-docs ready!

Name Link
🔨 Latest commit 95abc11
🔍 Latest deploy log https://app.netlify.com/sites/apollo-client-docs/deploys/67c1d6508fc5a2000840b9d9
😎 Deploy Preview https://deploy-preview-12385--apollo-client-docs.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.

Copy link

pkg-pr-new bot commented Feb 20, 2025

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

commit: 95abc11

Copy link
Contributor

github-actions bot commented Feb 20, 2025

size-limit report 📦

Path Size
import { ApolloClient, InMemoryCache, HttpLink } from "dist/__cjs/index.cjs" 0 B (-100% 🔽)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/__cjs/index.cjs" (production) 0 B (-100% 🔽)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" 0 B (-100% 🔽)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" (production) 0 B (-100% 🔽)
import { ApolloProvider } from "dist/react/index.js" 0 B (-100% 🔽)
import { ApolloProvider } from "dist/react/index.js" (production) 0 B (-100% 🔽)
import { useQuery } from "dist/react/index.js" 0 B (-100% 🔽)
import { useQuery } from "dist/react/index.js" (production) 0 B (-100% 🔽)
import { useLazyQuery } from "dist/react/index.js" 0 B (-100% 🔽)
import { useLazyQuery } from "dist/react/index.js" (production) 0 B (-100% 🔽)
import { useMutation } from "dist/react/index.js" 0 B (-100% 🔽)
import { useMutation } from "dist/react/index.js" (production) 0 B (-100% 🔽)
import { useSubscription } from "dist/react/index.js" 0 B (-100% 🔽)
import { useSubscription } from "dist/react/index.js" (production) 0 B (-100% 🔽)
import { useSuspenseQuery } from "dist/react/index.js" 0 B (-100% 🔽)
import { useSuspenseQuery } from "dist/react/index.js" (production) 0 B (-100% 🔽)
import { useBackgroundQuery } from "dist/react/index.js" 0 B (-100% 🔽)
import { useBackgroundQuery } from "dist/react/index.js" (production) 0 B (-100% 🔽)
import { useLoadableQuery } from "dist/react/index.js" 0 B (-100% 🔽)
import { useLoadableQuery } from "dist/react/index.js" (production) 0 B (-100% 🔽)
import { useReadQuery } from "dist/react/index.js" 0 B (-100% 🔽)
import { useReadQuery } from "dist/react/index.js" (production) 0 B (-100% 🔽)
import { useFragment } from "dist/react/index.js" 0 B (-100% 🔽)
import { useFragment } from "dist/react/index.js" (production) 0 B (-100% 🔽)
import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client" (CJS) 43.41 KB (+100% 🔺)
import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client" (production) (CJS) 38.83 KB (+100% 🔺)
import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client" 29.42 KB (+100% 🔺)
import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client" (production) 28.97 KB (+100% 🔺)
import { ApolloProvider } from "@apollo/client/react" 983 B (+100% 🔺)
import { ApolloProvider } from "@apollo/client/react" (production) 983 B (+100% 🔺)
import { useQuery } from "@apollo/client/react" 3.5 KB (+100% 🔺)
import { useQuery } from "@apollo/client/react" (production) 3.47 KB (+100% 🔺)
import { useLazyQuery } from "@apollo/client/react" 3.85 KB (+100% 🔺)
import { useLazyQuery } from "@apollo/client/react" (production) 3.82 KB (+100% 🔺)
import { useMutation } from "@apollo/client/react" 2.34 KB (+100% 🔺)
import { useMutation } from "@apollo/client/react" (production) 2.33 KB (+100% 🔺)
import { useSubscription } from "@apollo/client/react" 3.11 KB (+100% 🔺)
import { useSubscription } from "@apollo/client/react" (production) 3.09 KB (+100% 🔺)
import { useSuspenseQuery } from "@apollo/client/react" 4.31 KB (+100% 🔺)
import { useSuspenseQuery } from "@apollo/client/react" (production) 4.28 KB (+100% 🔺)
import { useBackgroundQuery } from "@apollo/client/react" 3.85 KB (+100% 🔺)
import { useBackgroundQuery } from "@apollo/client/react" (production) 3.82 KB (+100% 🔺)
import { useLoadableQuery } from "@apollo/client/react" 3.91 KB (+100% 🔺)
import { useLoadableQuery } from "@apollo/client/react" (production) 3.89 KB (+100% 🔺)
import { useReadQuery } from "@apollo/client/react" 1.87 KB (+100% 🔺)
import { useReadQuery } from "@apollo/client/react" (production) 1.86 KB (+100% 🔺)
import { useFragment } from "@apollo/client/react" 1.63 KB (+100% 🔺)
import { useFragment } from "@apollo/client/react" (production) 1.6 KB (+100% 🔺)

@phryneas
Copy link
Member Author

There's still something going on with side-effects, we need to look into this - from running size-limit locally:


    dist/errors/index.js:1:7:
      1 │ import "../utilities/globals/index.js";
        ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  "sideEffects" is false in the enclosing "package.json" file:

    dist/package.json:20:2:
      20 │   "sideEffects": false,
         ╵   ~~~~~~~~~~~~~

▲ [WARNING] Ignoring this import because "dist/utilities/globals/index.js" was marked as having no side effects [ignored-bare-import]

    dist/cache/index.js:1:7:
      1 │ import "../utilities/globals/index.js";
        ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  "sideEffects" is false in the enclosing "package.json" file:

    dist/package.json:20:2:
      20 │   "sideEffects": false,
         ╵   ~~~~~~~~~~~~~

▲ [WARNING] Ignoring this import because "dist/utilities/globals/index.js" was marked as having no side effects [ignored-bare-import]

    dist/link/core/index.js:1:7:
      1 │ import "../../utilities/globals/index.js";
        ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  "sideEffects" is false in the enclosing "package.json" file:

    dist/package.json:20:2:
      20 │   "sideEffects": false,
         ╵   ~~~~~~~~~~~~~

▲ [WARNING] Ignoring this import because "dist/utilities/globals/index.js" was marked as having no side effects [ignored-bare-import]

    dist/link/http/index.js:1:7:
      1 │ import "../../utilities/globals/index.js";
        ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  "sideEffects" is false in the enclosing "package.json" file:

    dist/package.json:20:2:
      20 │   "sideEffects": false,
         ╵   ~~~~~~~~~~~~~

▲ [WARNING] Ignoring this import because "dist/utilities/globals/index.js" was marked as having no side effects [ignored-bare-import]

    dist/link/utils/index.js:1:7:
      1 │ import "../../utilities/globals/index.js";
        ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  "sideEffects" is false in the enclosing "package.json" file:

    dist/package.json:20:2:
      20 │   "sideEffects": false,
         ╵   ~~~~~~~~~~~~~

▲ [WARNING] Ignoring this import because "dist/cache/inmemory/fixPolyfills.js" was marked as having no side effects [ignored-bare-import]

    dist/cache/inmemory/inMemoryCache.js:4:7:
      4 │ import "./fixPolyfills.js";
        ╵        ~~~~~~~~~~~~~~~~~~~

  "sideEffects" is false in the enclosing "package.json" file:

    dist/package.json:20:2:
      20 │   "sideEffects": false,
         ╵   ~~~~~~~~~~~~~

▲ [WARNING] Ignoring this import because "dist/utilities/globals/index.js" was marked as having no side effects [ignored-bare-import]

    dist/react/index.js:1:7:
      1 │ import "../utilities/globals/index.js";
        ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Comment on lines 4 to 7
// Make builtins like Map and Set safe to use with non-extensible objects.
// TODO: this needs to be removed for 4.0, so we really don't have side effects.
// that means we have to find an alternative means for the React Native fixes in there.
import "./fixPolyfills.js";
Copy link
Member Author

Choose a reason for hiding this comment

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

pointing this out as a TODO

@@ -30,11 +30,56 @@
"url": "https://github.com/apollographql/apollo-client/issues"
},
"homepage": "https://www.apollographql.com/docs/react/",
"exports": {
".": "./src/index.ts",

Choose a reason for hiding this comment

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

Wouldn't these be pointing to compiled JS files instead of publishing the TS source files? Generally speaking, typescript projects should publish compiled JS to NPM

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.

3 participants