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

Add simpler unwrapping of createAsyncThunk promises #970

Merged
merged 4 commits into from
Apr 1, 2021

Conversation

markerikson
Copy link
Collaborator

This PR:

  • Adds a .unwrap() function attached to promises returned from createAsyncThunk
  • Merges back the changes from Remove unnecessary condition #846 into master, since they went into next

Fixes #775, fixes #910 .

@netlify
Copy link

netlify bot commented Apr 1, 2021

Deploy preview for redux-starter-kit-docs ready!

Built with commit 2563cb6

https://deploy-preview-970--redux-starter-kit-docs.netlify.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 1, 2021

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 2563cb6:

Sandbox Source
Vanilla Configuration
Vanilla Typescript Configuration
rsk-github-issues-example Configuration

@markerikson
Copy link
Collaborator Author

markerikson commented Apr 1, 2021

Hmm.

@hardfist , for some reason I'm seeing this failure in the CI action , at https://github.com/reduxjs/redux-toolkit/pull/970/checks?check_run_id=2242739748 :

> @reduxjs/toolkit@1.5.1 build-ci /home/runner/work/redux-toolkit/redux-toolkit
> node scripts/build.js && tsc && tsc -p src/query/tsconfig.json && api-extractor run

dir: /home/runner/work/redux-toolkit/redux-toolkit/dist
/home/runner/work/redux-toolkit/redux-toolkit/node_modules/esbuild/bin/esbuild:2
throw new Error(`esbuild: Failed to install correctly
^

Error: esbuild: Failed to install correctly

Make sure you don't have "ignore-scripts" set to true. You can check this with
"npm config get ignore-scripts". If that returns true you can reset it back to
false using "npm config set ignore-scripts false" and then reinstall esbuild.

If you're using npm v7, make sure your package-lock.json file contains either
"lockfileVersion": 1 or the code "hasInstallScript": true. If it doesn't have
either of those, then it is likely the case that a known bug in npm v7 has
corrupted your package-lock.json file. Regenerating your package-lock.json file
should fix this issue.

Strictly speaking, the build-ci step is, uh... "passing". but only because that somehow isn't returning an error code.

Any idea why we might be having an issue there?

* Regen package-lock

* Drop ignore-scripts flag

* Set NODE_ENV on pack
@github-actions
Copy link

github-actions bot commented Apr 1, 2021

Size Change: +211 B (0%)

Total Size: 84.9 kB

Filename Size Change
dist/redux-toolkit.cjs.development.js 11.7 kB +6 B (0%)
dist/redux-toolkit.cjs.production.min.js 5.65 kB +4 B (0%)
dist/redux-toolkit.esm.js 11.3 kB +3 B (0%)
dist/redux-toolkit.modern.development.js 9.2 kB +4 B (0%)
dist/redux-toolkit.modern.js 9.24 kB +9 B (0%)
dist/redux-toolkit.modern.production.min.js 4.31 kB +3 B (0%)
dist/redux-toolkit.umd.js 21.7 kB +109 B (0%)
dist/redux-toolkit.umd.min.js 11.6 kB +73 B (0%)
ℹ️ View Unchanged
Filename Size Change
dist/index.js 146 B 0 B

compressed-size-action

@markerikson markerikson merged commit 8301370 into master Apr 1, 2021
@markerikson markerikson deleted the feature/unwrap-thunks branch April 1, 2021 04:51
@hardfist
Copy link
Contributor

hardfist commented Apr 1, 2021

oh esbuild currently doesnt support npm7 because of npm bug

@hardfist
Copy link
Contributor

hardfist commented Apr 1, 2021

npm/cli#2606

@hardfist
Copy link
Contributor

hardfist commented Apr 1, 2021

you may need to use npm@6 before bug fixed

@markerikson
Copy link
Collaborator Author

Apparently the issue was just that we had --ignore-scripts in our workflow file, so the binary wasn't getting downloaded.

@hardfist
Copy link
Contributor

hardfist commented Apr 1, 2021

Apparently the issue was just that we had --ignore-scripts in our workflow file, so the binary wasn't getting downloaded.

i never expect this :)

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.

Throw error on rejection Allow to unwrap async thunks automatically
4 participants