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

refactor(react-query-devtools): use superjson to display values #4085

Merged
merged 1 commit into from Oct 4, 2022

Conversation

aboqasem
Copy link
Contributor

@aboqasem aboqasem commented Aug 25, 2022

Fixes #1552

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 25, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit c42bf38:

Sandbox Source
@tanstack/query-example-react-basic Configuration
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-vue-basic Configuration

@codecov-commenter
Copy link

codecov-commenter commented Aug 25, 2022

Codecov Report

Merging #4085 (8d98084) into main (eab6e2c) will increase coverage by 0.45%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #4085      +/-   ##
==========================================
+ Coverage   96.36%   96.81%   +0.45%     
==========================================
  Files          45       57      +12     
  Lines        2281     2672     +391     
  Branches      640      784     +144     
==========================================
+ Hits         2198     2587     +389     
- Misses         80       83       +3     
+ Partials        3        2       -1     
Impacted Files Coverage Δ
src/core/queryCache.ts
src/devtools/theme.tsx
src/react/logger.native.ts
src/core/retryer.ts
src/devtools/utils.ts
src/react/useIsMutating.ts
src/core/mutation.ts
src/devtools/useMediaQuery.ts
src/react/reactBatchedUpdates.ts
src/devtools/tests/utils.tsx
... and 92 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

package.json Outdated Show resolved Hide resolved
@aboqasem aboqasem force-pushed the refactor/#1552-use-superjson branch 2 times, most recently from d37be88 to 90702b3 Compare August 26, 2022 11:31
@aboqasem aboqasem requested a review from TkDodo August 26, 2022 18:13
@TkDodo
Copy link
Collaborator

TkDodo commented Aug 26, 2022

not sure that there should be so many changes in package-lock.json, also, builds are failing. I would suggest reverting the changes to packge-lock (restoring what we have in main), then running npm install again.

@aboqasem
Copy link
Contributor Author

I tried and it produces similar result. Which version of npm should I use? Currently I have to npm i --legacy-peer-deps on 8.18.0.

@TkDodo
Copy link
Collaborator

TkDodo commented Aug 26, 2022

our .nvmrc uses node v16.14.2, so please use that

@aboqasem aboqasem force-pushed the refactor/#1552-use-superjson branch 2 times, most recently from ad6b3ad to a9a5889 Compare August 26, 2022 19:29
@TkDodo
Copy link
Collaborator

TkDodo commented Sep 11, 2022

sorry, I wanted to wait until we merged our beta branch with bundling changes. If you fix the merge conflicts, I'll merge this PR

@aboqasem aboqasem force-pushed the refactor/#1552-use-superjson branch from a9a5889 to c42bf38 Compare October 4, 2022 11:19
@TkDodo TkDodo merged commit 1bb13e2 into TanStack:main Oct 4, 2022
@omeraplak
Copy link

omeraplak commented Oct 4, 2022

Hey @TkDodo ,
We've got an error on the build with 4.10.0. Is this a known issue? Thank you

Error:

Error: R] Could not resolve "superjson"

    ../../node_modules/@tanstack/react-query-devtools/build/lib/utils.mjs:2:22:
      2 │ import SuperJSON from 'superjson';
        ╵                       ~~~~~~~~~~~

  You can mark the path "superjson" as external to exclude it from the bundle, which will remove this error.

CJS ⚡️ Build success in 678ms
CJS dist/index.js     5.17 KB
CJS dist/index.js.map 18.79 KB
ESM ⚡️ Build success in 724ms
ESM dist/esm/index.js     4.34 KB
ESM dist/esm/index.js.map 19.45 KB
IIFE Build failed
Error: Build failed with 1 error:
../../node_modules/@tanstack/react-query-devtools/build/lib/utils.mjs:2:22: ERROR: Could not resolve "superjson"
    at failureErrorWithLog (/home/runner/work/refine/refine/node_modules/esbuild/lib/main.js:1624:15)
    at /home/runner/work/refine/refine/node_modules/esbuild/lib/main.js:1266:28
    at runOnEndCallbacks (/home/runner/work/refine/refine/node_modules/esbuild/lib/main.js:1046:63)
    at buildResponseToResult (/home/runner/work/refine/refine/node_modules/esbuild/lib/main.js:1264:7)
    at /home/runner/work/refine/refine/node_modules/esbuild/lib/main.js:1377:14
    at /home/runner/work/refine/refine/node_modules/esbuild/lib/main.js:678:9
    at handleIncomingPacket (/home/runner/work/refine/refine/node_modules/esbuild/lib/main.js:775:9)
    at Socket.readFromStdout (/home/runner/work/refine/refine/node_modules/esbuild/lib/main.js:644:7)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:315:12)

link: https://github.com/pankod/refine/actions/runs/3182317318/jobs/5188210282#step:7:1296

edit: it's fixed with 4.10.1. Thank you @TkDodo

@TkDodo
Copy link
Collaborator

TkDodo commented Oct 4, 2022

yeah, we fixed it immediately. sorry 🙈

@aboqasem aboqasem deleted the refactor/#1552-use-superjson branch October 5, 2022 03:12
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.

Error displays as an empty object
4 participants