From 8cc226662f42b38dbfd8714dac5bf200b80edacf Mon Sep 17 00:00:00 2001 From: Mark Erikson Date: Fri, 2 Apr 2021 16:20:22 -0400 Subject: [PATCH 1/9] Port build dependencies from master Former-commit-id: d875ba61e5802d3c0f033016545cee5095547412 --- package-lock.json.REMOVED.git-id | 2 +- package.json | 77 +++++++++++++++++--------------- 2 files changed, 43 insertions(+), 36 deletions(-) diff --git a/package-lock.json.REMOVED.git-id b/package-lock.json.REMOVED.git-id index 988058e33f3..dae1457441f 100644 --- a/package-lock.json.REMOVED.git-id +++ b/package-lock.json.REMOVED.git-id @@ -1 +1 @@ -2618868ad656fc320d4bca9cd6089f561b87c35d \ No newline at end of file +e4462bfb499861758fc942df7c5557d153bf581d \ No newline at end of file diff --git a/package.json b/package.json index c16e8e4c71a..a57914cae33 100644 --- a/package.json +++ b/package.json @@ -39,52 +39,58 @@ "format": "prettier --write \"{src,test}/**/*.{js,ts}\" index.d.ts \"**/*.md\"", "format:check": "prettier --list-different \"{src,test}/**/*.{js,ts}\" index.d.ts \"**/*.md\"", "lint": "eslint src test", - "pretest": "npm run build", "test": "jest", "test:watch": "npm test -- --watch", "test:cov": "npm test -- --coverage", "build": "rollup -c", - "prepare": "npm run clean && npm run format:check && npm run lint && npm test", + "pretest": "npm run build", + "prepublishOnly": "npm run clean && npm run format:check && npm run lint && npm test", "examples:lint": "eslint examples", "examples:test": "cross-env CI=true babel-node examples/testAll.js" }, "dependencies": { "loose-envify": "^1.4.0", - "symbol-observable": "^2.0.3" + "symbol-observable": "^2.0.3", + "@babel/runtime": "^7.9.2" }, "devDependencies": { - "@babel/cli": "^7.5.0", - "@babel/core": "^7.5.4", - "@babel/node": "^7.5.0", - "@babel/plugin-external-helpers": "^7.2.0", - "@babel/plugin-proposal-object-rest-spread": "^7.5.4", - "@babel/preset-env": "^7.5.4", - "@babel/preset-flow": "^7.0.0", - "@babel/register": "^7.4.4", - "@typescript-eslint/eslint-plugin": "^1.11.0", - "@typescript-eslint/parser": "^1.11.0", - "babel-core": "^7.0.0-bridge.0", - "babel-eslint": "^10.0.2", - "babel-jest": "^24.8.0", - "cross-env": "^5.2.0", - "eslint": "^5.16.0", - "eslint-config-react-app": "^4.0.1", - "eslint-plugin-flowtype": "^2.50.3", - "eslint-plugin-import": "^2.18.0", + "@babel/cli": "^7.8.4", + "@babel/core": "^7.9.0", + "@babel/node": "^7.8.7", + "@babel/plugin-external-helpers": "^7.8.3", + "@babel/plugin-proposal-object-rest-spread": "^7.9.5", + "@babel/plugin-transform-runtime": "^7.9.0", + "@babel/preset-env": "^7.9.5", + "@babel/preset-flow": "^7.9.0", + "@babel/preset-typescript": "^7.9.0", + "@babel/register": "^7.9.0", + "@rollup/plugin-babel": "^5.3.0", + "@rollup/plugin-node-resolve": "^7.1.3", + "@rollup/plugin-replace": "^2.3.2", + "@types/jest": "^25.2.1", + "@types/node": "^13.13.4", + "@typescript-eslint/eslint-plugin": "^2.29.0", + "@typescript-eslint/parser": "^2.29.0", + "babel-eslint": "^10.1.0", + "babel-jest": "^25.4.0", + "cross-env": "^7.0.2", + "eslint": "^6.8.0", + "eslint-config-react-app": "^5.2.1", + "eslint-import-resolver-typescript": "^2.0.0", + "eslint-plugin-flowtype": "^4.7.0", + "eslint-plugin-import": "^2.20.2", "eslint-plugin-jsx-a11y": "^6.2.3", - "eslint-plugin-react": "^7.14.2", - "eslint-plugin-react-hooks": "^1.6.1", - "glob": "^7.1.4", - "jest": "^24.8.0", - "prettier": "^1.18.2", - "rimraf": "^2.6.3", - "rollup": "^1.16.7", - "rollup-plugin-babel": "^4.3.3", - "rollup-plugin-node-resolve": "^5.2.0", - "rollup-plugin-replace": "^2.2.0", - "rollup-plugin-terser": "^5.1.1", - "rxjs": "^6.5.2", - "typescript": "^3.9.6", + "eslint-plugin-react": "^7.19.0", + "eslint-plugin-react-hooks": "^3.0.0", + "glob": "^7.1.6", + "jest": "^25.4.0", + "prettier": "^2.0.5", + "rimraf": "^3.0.2", + "rollup": "^2.7.2", + "rollup-plugin-terser": "^5.3.0", + "rollup-plugin-typescript2": "^0.27.0", + "rxjs": "^6.5.5", + "typescript": "^3.8.3", "typings-tester": "^0.3.2" }, "npmName": "redux", @@ -102,7 +108,8 @@ ] }, "jest": { - "testRegex": "(/test/.*\\.spec\\.js)$" + "testRegex": "(/test/.*\\.spec\\.[tj]s)$", + "coverageProvider": "v8" }, "sideEffects": false } From d99eb2c1d340effd0f88b42da12b1605e78608cd Mon Sep 17 00:00:00 2001 From: Mark Erikson Date: Fri, 2 Apr 2021 16:20:39 -0400 Subject: [PATCH 2/9] Fix initial build import dependencies Former-commit-id: ca670ca56c977e6b25d12ff2df32395c0376b57f --- rollup.config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 07297f2bc22..098286297ec 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,6 +1,6 @@ -import nodeResolve from 'rollup-plugin-node-resolve' -import babel from 'rollup-plugin-babel' -import replace from 'rollup-plugin-replace' +import nodeResolve from '@rollup/plugin-node-resolve' +import babel from '@rollup/plugin-babel' +import replace from '@rollup/plugin-replace' import { terser } from 'rollup-plugin-terser' import pkg from './package.json' From b7cdb649cee6d856136b19223892fae8e90eadc2 Mon Sep 17 00:00:00 2001 From: Mark Erikson Date: Fri, 2 Apr 2021 16:27:39 -0400 Subject: [PATCH 3/9] Port Rollup config from master to 4.x Former-commit-id: e6b5ebaf733783c467265fba0d3737d924caf561 --- rollup.config.js | 76 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 65 insertions(+), 11 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 098286297ec..9a32e514792 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -5,27 +5,67 @@ import { terser } from 'rollup-plugin-terser' import pkg from './package.json' +const extensions = ['.js'] + +const babelRuntimeVersion = pkg.dependencies['@babel/runtime'].replace( + /^[^0-9]*/, + '' +) + +const makeExternalPredicate = externalArr => { + if (externalArr.length === 0) { + return () => false + } + const pattern = new RegExp(`^(${externalArr.join('|')})($|/)`) + return id => pattern.test(id) +} + export default [ // CommonJS { input: 'src/index.js', output: { file: 'lib/redux.js', format: 'cjs', indent: false }, - external: [ + external: makeExternalPredicate([ ...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.peerDependencies || {}) - ], - plugins: [babel()] + ]), + plugins: [ + nodeResolve({ + extensions + }), + babel({ + extensions, + plugins: [ + ['@babel/plugin-transform-runtime', { version: babelRuntimeVersion }], + ], + babelHelpers: 'runtime' + }) + ] }, // ES { input: 'src/index.js', output: { file: 'es/redux.js', format: 'es', indent: false }, - external: [ + external: makeExternalPredicate([ ...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.peerDependencies || {}) - ], - plugins: [babel()] + ]), + plugins: [ + nodeResolve({ + extensions + }), + babel({ + extensions, + plugins: [ + [ + '@babel/plugin-transform-runtime', + { version: babelRuntimeVersion, useESModules: true } + ], + ], + babelHelpers: 'runtime' + }) + ] }, // ES for Browsers @@ -33,10 +73,17 @@ export default [ input: 'src/index.js', output: { file: 'es/redux.mjs', format: 'es', indent: false }, plugins: [ - nodeResolve(), + nodeResolve({ + extensions + }), replace({ 'process.env.NODE_ENV': JSON.stringify('production') }), + babel({ + extensions, + exclude: 'node_modules/**', + skipPreflightCheck: true + }), terser({ compress: { pure_getters: true, @@ -58,9 +105,12 @@ export default [ indent: false }, plugins: [ - nodeResolve(), + nodeResolve({ + extensions + }), babel({ - exclude: 'node_modules/**' + extensions, + exclude: 'node_modules/**', }), replace({ 'process.env.NODE_ENV': JSON.stringify('development') @@ -78,9 +128,13 @@ export default [ indent: false }, plugins: [ - nodeResolve(), + nodeResolve({ + extensions + }), babel({ - exclude: 'node_modules/**' + extensions, + exclude: 'node_modules/**', + skipPreflightCheck: true }), replace({ 'process.env.NODE_ENV': JSON.stringify('production') From 899f101a8b8408404e9958cd47a1758d9b336979 Mon Sep 17 00:00:00 2001 From: Mark Erikson Date: Fri, 2 Apr 2021 16:35:31 -0400 Subject: [PATCH 4/9] Copy CodeSandbox-CI and Github workflow settings Former-commit-id: 007f34edcc12979b80486c8b777e9b10400c8c1f --- .codesandbox/ci.json | 7 +++ .github/FUNDING.yml | 1 + .github/ISSUE_TEMPLATE/Bug_report.md | 39 +++++++++++++--- .github/ISSUE_TEMPLATE/Custom.md | 9 ---- .github/ISSUE_TEMPLATE/Feature_request.md | 36 +++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 5 +++ .github/ISSUE_TEMPLATE/documentation-edit.md | 13 ++++++ .github/ISSUE_TEMPLATE/documentation-new.md | 27 +++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 9 ++++ .github/PULL_REQUEST_TEMPLATE/bugfix.md | 34 ++++++++++++++ .../documentation-edit.md | 19 ++++++++ .../documentation-new.md | 37 +++++++++++++++ .github/workflows/size.yaml | 16 +++++++ .github/workflows/test.yaml | 45 +++++++++++++++++++ 14 files changed, 282 insertions(+), 15 deletions(-) create mode 100644 .codesandbox/ci.json create mode 100644 .github/FUNDING.yml delete mode 100644 .github/ISSUE_TEMPLATE/Custom.md create mode 100644 .github/ISSUE_TEMPLATE/Feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/documentation-edit.md create mode 100644 .github/ISSUE_TEMPLATE/documentation-new.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/bugfix.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/documentation-edit.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/documentation-new.md create mode 100644 .github/workflows/size.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.codesandbox/ci.json b/.codesandbox/ci.json new file mode 100644 index 00000000000..f86122cef48 --- /dev/null +++ b/.codesandbox/ci.json @@ -0,0 +1,7 @@ +{ + "sandboxes": [ + "vanilla", + "vanilla-ts" + ], + "node": "14" +} diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000000..ddfcd66c748 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: timdorr diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index a32167a58a7..0af257525b4 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -3,14 +3,41 @@ name: "\U0001F41BBug report" about: Something is wrong with Redux. --- -**Do you want to request a _feature_ or report a _bug_?** + + +### Prior Issues + +Are there any existing issues or PRs that relate to this problem? If so, link them here. + +### What is the current behavior? + +What does Redux do right now. + +### Steps to Reproduce + +If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://codesandbox.io or similar. + +### What is the expected behavior? + +What should Redux be doing? + +### Environment Details + +Which versions of Redux, and which browser and OS are affected by this issue? Did this work in previous versions of Redux? diff --git a/.github/ISSUE_TEMPLATE/Custom.md b/.github/ISSUE_TEMPLATE/Custom.md deleted file mode 100644 index 1af46015650..00000000000 --- a/.github/ISSUE_TEMPLATE/Custom.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -name: "\U0001F914Support/Usage Question" -about: For usage questions, please use Stack Overflow or Reactiflux! ---- - -This is a bug tracker, not a support system. For usage questions, please use Stack Overflow or Reactiflux where there are a lot more people ready to help you out. Thanks! - -https://stackoverflow.com/questions/tagged/redux -https://www.reactiflux.com/ diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md new file mode 100644 index 00000000000..ac4ce16fd61 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Feature_request.md @@ -0,0 +1,36 @@ +--- +name: 👍 Feature Request +about: I'd like Redux to do something new. +--- + + + +## New Features + +### What is the new or updated feature that you are suggesting? + +### Why should this feature be included? + +### What docs changes are needed to explain this? diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000000..8cffa4e1cf7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: 🤔 Questions and Help + url: https://redux.js.org/introduction/getting-started#help-and-discussion + about: This is a bug tracker, not a support system. For usage questions, please use our support resources. diff --git a/.github/ISSUE_TEMPLATE/documentation-edit.md b/.github/ISSUE_TEMPLATE/documentation-edit.md new file mode 100644 index 00000000000..a091b43ae2e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation-edit.md @@ -0,0 +1,13 @@ +--- +name: "\U0001F4DD Documentation Fix" +about: Fixing a problem in an existing docs page +--- + +## What docs page needs to be fixed? + +- **Section**: +- **Page**: + +## What is the problem? + +## What should be changed to fix the problem? diff --git a/.github/ISSUE_TEMPLATE/documentation-new.md b/.github/ISSUE_TEMPLATE/documentation-new.md new file mode 100644 index 00000000000..07c357190e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation-new.md @@ -0,0 +1,27 @@ +--- +name: "\U0001F4D6 New/Updated Documentation Content" +about: Adding a new docs page, or updating content in an existing docs page +--- + +## What docs page is being added or updated? + +- **Section**: +- **Page**: + +## For Adding New Content + +### What kind of content category is this page (tutorial, how-to, explanation, reference)? + +### Who is the intended target audience? + +#### What knowledge are we assuming they have? + +### What are the intended results or takeaways from reading this page? + +### What is the most critical info they should learn? + +## For Updating Existing Content + +### What updates should be made to the page? + +### Do these updates change any of the assumptions or target audience? If so, how do they change? diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000000..3e716ba1fb1 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,9 @@ +Thanks for the PR! + +To better assist you, please select the type of PR you want to create. + +Click the "Preview" tab above, and click on the link for the PR type: + +- [:bug: Bug fix or new feature](?template=bugfix.md) +- [:memo: Documentation Fix](?template=documentation-edit.md) +- [:book: New/Updated Documentation Content](?template=documentation-new.md) diff --git a/.github/PULL_REQUEST_TEMPLATE/bugfix.md b/.github/PULL_REQUEST_TEMPLATE/bugfix.md new file mode 100644 index 00000000000..4c1126132c9 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/bugfix.md @@ -0,0 +1,34 @@ +--- +name: :bug: Bug fix or new feature +about: Fixing a problem with Redux +--- + +## PR Type + +### Does this PR add a new _feature_, or fix a _bug_? + +### Why should this PR be included? + +## Checklist + +- [ ] Have you added an explanation of what your changes do and why you'd like us to include them? +- [ ] Is there an existing issue for this PR? + - _link issue here_ +- [ ] Have the files been linted and formatted? +- [ ] Have the docs been updated to match the changes in the PR? +- [ ] Have the tests been updated to match the changes in the PR? +- [ ] Have you run the tests locally to confirm they pass? + +## New Features + +### What new capabilities does this PR add? + +### What docs changes are needed to explain this? + +## Bug Fixes + +### What is the current behavior, and the steps to reproduce the issue? + +### What is the expected behavior? + +### How does this PR fix the problem? diff --git a/.github/PULL_REQUEST_TEMPLATE/documentation-edit.md b/.github/PULL_REQUEST_TEMPLATE/documentation-edit.md new file mode 100644 index 00000000000..8dcb0ac1c26 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/documentation-edit.md @@ -0,0 +1,19 @@ +--- +name: :memo: Documentation Fix +about: Fixing a problem in an existing docs page +--- + +## Checklist + +- [ ] Is there an existing issue for this PR? + - _link issue here_ +- [ ] Have the files been linted and formatted? + +## What docs page needs to be fixed? + +- **Section**: +- **Page**: + +## What is the problem? + +## What changes does this PR make to fix the problem? diff --git a/.github/PULL_REQUEST_TEMPLATE/documentation-new.md b/.github/PULL_REQUEST_TEMPLATE/documentation-new.md new file mode 100644 index 00000000000..444bce15663 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/documentation-new.md @@ -0,0 +1,37 @@ +--- +name: :book: New/Updated Documentation Content +about: Adding a new docs page, or updating content in an existing docs page +--- + +## PR Type + +**Does this PR add a _new_ page, or update an _existing_ page?** + +## Checklist + +- [ ] Is there an existing issue for this PR? + - _link issue here_ +- [ ] Have the files been linted and formatted? + +## What docs page is being added or updated? + +- **Section**: +- **Page**: + +## For Adding New Content + +### What kind of content category is this page (tutorial, how-to, explanation, reference)? + +### Who is the intended target audience? + +#### What knowledge are we assuming they have? + +### What are the intended results or takeaways from reading this page? + +### What is the most critical info they should learn? + +## For Updating Existing Content + +### What updates should be made to the page? + +### Do these updates change any of the assumptions or target audience? If so, how do they change? diff --git a/.github/workflows/size.yaml b/.github/workflows/size.yaml new file mode 100644 index 00000000000..bd2ef5575ae --- /dev/null +++ b/.github/workflows/size.yaml @@ -0,0 +1,16 @@ +name: Bundle Size + +on: [pull_request] + +jobs: + build: + name: Check compressed size + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2-beta + with: + fetch-depth: 1 + - uses: preactjs/compressed-size-action@v1 + with: + repo-token: '${{ secrets.GITHUB_TOKEN }}' diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000000..0a7f6c8ef96 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,45 @@ +name: Tests + +on: + push: + branches: [4.x] + pull_request: + branches: [4.x] + +jobs: + build: + name: Test Suite + runs-on: ubuntu-latest + + steps: + - name: Set up Node + uses: actions/setup-node@v1 + with: + node-version: 14.x + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.OS }}-npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.OS }}-npm- + ${{ runner.OS }}- + + - name: Install dependencies + run: npm ci + + - name: Check types + run: npm run check-types + + - name: Check formatting + run: npm run format:check + + - name: Lint code + run: npm run lint + + - name: Run test suite + run: npm test From d7b78eb01b798017840ae7919b8eed64fcc48db8 Mon Sep 17 00:00:00 2001 From: Mark Erikson Date: Fri, 2 Apr 2021 16:39:28 -0400 Subject: [PATCH 5/9] Remove check-types from CI action Former-commit-id: 9db147583185fdbe29912fc63708f2604fbc0f62 --- .github/workflows/test.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0a7f6c8ef96..81eb91a374e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -32,9 +32,6 @@ jobs: - name: Install dependencies run: npm ci - - name: Check types - run: npm run check-types - - name: Check formatting run: npm run format:check From 2f6906df2e891571fb369d058e7f8e953c739f68 Mon Sep 17 00:00:00 2001 From: Mark Erikson Date: Fri, 2 Apr 2021 16:43:36 -0400 Subject: [PATCH 6/9] Try tracking all build artifact file sizes Former-commit-id: 2f20a0419b876bcc8f911ee96b9e08d7b6eef3ae --- .github/workflows/size.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/size.yaml b/.github/workflows/size.yaml index bd2ef5575ae..2e1faf2cc10 100644 --- a/.github/workflows/size.yaml +++ b/.github/workflows/size.yaml @@ -14,3 +14,4 @@ jobs: - uses: preactjs/compressed-size-action@v1 with: repo-token: '${{ secrets.GITHUB_TOKEN }}' + pattern: './{dist,es,li}/*.js' From ca1e8aeb333dedcdd666bb3d82a27bbe6f0c485f Mon Sep 17 00:00:00 2001 From: Mark Erikson Date: Fri, 2 Apr 2021 16:46:41 -0400 Subject: [PATCH 7/9] Format all the things! Former-commit-id: f84bf675c58a032c6a7cf8f14ae533dbd263ffb0 --- docs/Troubleshooting.md.REMOVED.git-id | 2 +- docs/advanced/AsyncActions.md.REMOVED.git-id | 2 +- .../ExampleRedditAPI.md.REMOVED.git-id | 2 +- docs/advanced/Middleware.md.REMOVED.git-id | 2 +- .../UsageWithReactRouter.md.REMOVED.git-id | 2 +- docs/api/Store.md.REMOVED.git-id | 2 +- docs/api/applyMiddleware.md.REMOVED.git-id | 2 +- docs/api/bindActionCreators.md | 6 +- docs/api/combineReducers.md.REMOVED.git-id | 2 +- docs/api/compose.md | 5 +- docs/api/createStore.md | 2 +- docs/basics/Actions.md | 10 +- docs/basics/DataFlow.md | 12 +- docs/basics/ExampleTodoList.md.REMOVED.git-id | 2 +- docs/basics/Reducers.md.REMOVED.git-id | 2 +- docs/basics/Store.md | 2 +- docs/basics/UsageWithReact.md.REMOVED.git-id | 2 +- docs/faq/ImmutableData.md.REMOVED.git-id | 2 +- docs/faq/ReactRedux.md.REMOVED.git-id | 2 +- docs/introduction/CoreConcepts.md | 2 +- docs/introduction/Ecosystem.md.REMOVED.git-id | 2 +- docs/introduction/PriorArt.md.REMOVED.git-id | 2 +- docs/introduction/ThreePrinciples.md | 10 +- docs/recipes/CodeSplitting.md.REMOVED.git-id | 2 +- .../ComputingDerivedData.md.REMOVED.git-id | 2 +- .../ConfiguringYourStore.md.REMOVED.git-id | 2 +- .../ImplementingUndoHistory.md.REMOVED.git-id | 2 +- .../ReducingBoilerplate.md.REMOVED.git-id | 2 +- .../recipes/ServerRendering.md.REMOVED.git-id | 2 +- .../UsageWithTypescript.md.REMOVED.git-id | 2 +- .../UsingImmutableJS.md.REMOVED.git-id | 2 +- docs/recipes/UsingObjectSpreadOperator.md | 10 +- docs/recipes/WritingTests.md.REMOVED.git-id | 2 +- .../BeyondCombineReducers.md.REMOVED.git-id | 2 +- .../ImmutableUpdatePatterns.md.REMOVED.git-id | 2 +- .../InitializingState.md.REMOVED.git-id | 2 +- .../NormalizingStateShape.md.REMOVED.git-id | 2 +- ...factoringReducersExample.md.REMOVED.git-id | 2 +- .../ReusingReducerLogic.md.REMOVED.git-id | 2 +- .../UpdatingNormalizedData.md.REMOVED.git-id | 2 +- .../UsingCombineReducers.md.REMOVED.git-id | 2 +- index.d.ts.REMOVED.git-id | 2 +- src/applyMiddleware.js | 8 +- src/bindActionCreators.js | 2 +- src/combineReducers.js.REMOVED.git-id | 2 +- src/compose.js | 2 +- src/createStore.js.REMOVED.git-id | 2 +- src/index.js | 2 +- src/utils/actionTypes.js | 8 +- test/applyMiddleware.spec.js | 38 +++---- test/bindActionCreators.spec.js | 4 +- test/combineReducers.spec.js.REMOVED.git-id | 2 +- test/compose.spec.js | 104 ++++-------------- test/createStore.spec.js.REMOVED.git-id | 2 +- test/helpers/actionCreators.js | 18 +-- test/helpers/middleware.js | 2 +- test/helpers/reducers.js | 10 +- test/typescript.spec.js | 2 +- test/typescript/actionCreators.ts | 8 +- test/typescript/actions.ts | 10 +- test/typescript/compose.ts | 36 ++---- test/typescript/enhancers.ts | 2 +- test/typescript/injectedDispatch.ts | 8 +- test/typescript/middleware.ts.REMOVED.git-id | 2 +- test/typescript/reducers.ts.REMOVED.git-id | 2 +- test/typescript/store.ts | 28 ++--- 66 files changed, 171 insertions(+), 258 deletions(-) diff --git a/docs/Troubleshooting.md.REMOVED.git-id b/docs/Troubleshooting.md.REMOVED.git-id index 1e9aca6dd27..805e074589b 100644 --- a/docs/Troubleshooting.md.REMOVED.git-id +++ b/docs/Troubleshooting.md.REMOVED.git-id @@ -1 +1 @@ -3396f25b19f4d2e560ed90b0ed297fd99a7c35b7 \ No newline at end of file +c06ccbba45638215c49a3b7aebc99bf55167ce18 \ No newline at end of file diff --git a/docs/advanced/AsyncActions.md.REMOVED.git-id b/docs/advanced/AsyncActions.md.REMOVED.git-id index a76d468a1f7..06aec1b767c 100644 --- a/docs/advanced/AsyncActions.md.REMOVED.git-id +++ b/docs/advanced/AsyncActions.md.REMOVED.git-id @@ -1 +1 @@ -5e684f193c4f4266f940fc4a13ca258c785e65b1 \ No newline at end of file +2f81f76bc2af8a43c3cce5e45d39d60839d270af \ No newline at end of file diff --git a/docs/advanced/ExampleRedditAPI.md.REMOVED.git-id b/docs/advanced/ExampleRedditAPI.md.REMOVED.git-id index acb20114fe1..3d6562ec9ef 100644 --- a/docs/advanced/ExampleRedditAPI.md.REMOVED.git-id +++ b/docs/advanced/ExampleRedditAPI.md.REMOVED.git-id @@ -1 +1 @@ -49102d986df3bc216a45d7135a9b2512d7a495ce \ No newline at end of file +3ececd6913eabc9d8687e734f99c515713bb07dd \ No newline at end of file diff --git a/docs/advanced/Middleware.md.REMOVED.git-id b/docs/advanced/Middleware.md.REMOVED.git-id index e57b7fcc16b..a81a0fd3c40 100644 --- a/docs/advanced/Middleware.md.REMOVED.git-id +++ b/docs/advanced/Middleware.md.REMOVED.git-id @@ -1 +1 @@ -a573d2a32cfc6baaa712f47a489ba4db0ee50460 \ No newline at end of file +f8286779c4b42c238a5348f655b0d86b03d209a3 \ No newline at end of file diff --git a/docs/advanced/UsageWithReactRouter.md.REMOVED.git-id b/docs/advanced/UsageWithReactRouter.md.REMOVED.git-id index fedff7bb50a..574f84dc66f 100644 --- a/docs/advanced/UsageWithReactRouter.md.REMOVED.git-id +++ b/docs/advanced/UsageWithReactRouter.md.REMOVED.git-id @@ -1 +1 @@ -c41d02a13b6497029eaba6c07ff12cd5ff773af4 \ No newline at end of file +b6fb5d8f22cf43a990baee1bf0a18e052eefbd32 \ No newline at end of file diff --git a/docs/api/Store.md.REMOVED.git-id b/docs/api/Store.md.REMOVED.git-id index 910a1712999..cfb1c494447 100644 --- a/docs/api/Store.md.REMOVED.git-id +++ b/docs/api/Store.md.REMOVED.git-id @@ -1 +1 @@ -a1e3531009cbbed0d8e2b3bf76b2f96e0f6fe919 \ No newline at end of file +577bff063a66d635a83dedeb33ebf1d57bbc04e6 \ No newline at end of file diff --git a/docs/api/applyMiddleware.md.REMOVED.git-id b/docs/api/applyMiddleware.md.REMOVED.git-id index d6319e937a7..3e228a5de97 100644 --- a/docs/api/applyMiddleware.md.REMOVED.git-id +++ b/docs/api/applyMiddleware.md.REMOVED.git-id @@ -1 +1 @@ -39bb8971fca8a21d345eec00cebf9a7fc4830bbd \ No newline at end of file +d46240620d2877262ebbf93ab242de64442ef822 \ No newline at end of file diff --git a/docs/api/bindActionCreators.md b/docs/api/bindActionCreators.md index a0afb131b9f..9e266322122 100644 --- a/docs/api/bindActionCreators.md +++ b/docs/api/bindActionCreators.md @@ -33,14 +33,14 @@ For convenience, you can also pass an action creator as the first argument, and export function addTodo(text) { return { type: 'ADD_TODO', - text + text, } } export function removeTodo(id) { return { type: 'REMOVE_TODO', - id + id, } } ``` @@ -107,7 +107,7 @@ class TodoListContainer extends Component { } } -export default connect(state => ({ todos: state.todos }))(TodoListContainer) +export default connect((state) => ({ todos: state.todos }))(TodoListContainer) ``` #### Tips diff --git a/docs/api/combineReducers.md.REMOVED.git-id b/docs/api/combineReducers.md.REMOVED.git-id index b228106c48a..f559d06063b 100644 --- a/docs/api/combineReducers.md.REMOVED.git-id +++ b/docs/api/combineReducers.md.REMOVED.git-id @@ -1 +1 @@ -0a489a4c8f7cf620d54fdbf3a6d03cc78968e366 \ No newline at end of file +c332b93c5410c310e9aeedd24575c1db55e896bc \ No newline at end of file diff --git a/docs/api/compose.md b/docs/api/compose.md index bb9b65f8ad5..ce6d828ff4c 100644 --- a/docs/api/compose.md +++ b/docs/api/compose.md @@ -32,10 +32,7 @@ import reducer from '../reducers' const store = createStore( reducer, - compose( - applyMiddleware(thunk), - DevTools.instrument() - ) + compose(applyMiddleware(thunk), DevTools.instrument()) ) ``` diff --git a/docs/api/createStore.md b/docs/api/createStore.md index 569776cfa19..52372db2c36 100644 --- a/docs/api/createStore.md +++ b/docs/api/createStore.md @@ -40,7 +40,7 @@ const store = createStore(todos, ['Use Redux']) store.dispatch({ type: 'ADD_TODO', - text: 'Read the docs' + text: 'Read the docs', }) console.log(store.getState()) diff --git a/docs/basics/Actions.md b/docs/basics/Actions.md index 01bc6b9cdb0..abb23c5fa30 100644 --- a/docs/basics/Actions.md +++ b/docs/basics/Actions.md @@ -66,7 +66,7 @@ In Redux, action creators simply return an action: function addTodo(text) { return { type: ADD_TODO, - text + text, } } ``` @@ -79,7 +79,7 @@ In [traditional Flux](http://facebook.github.io/flux), action creators often tri function addTodoWithDispatch(text) { const action = { type: ADD_TODO, - text + text, } dispatch(action) } @@ -96,8 +96,8 @@ dispatch(completeTodo(index)) Alternatively, you can create a **bound action creator** that automatically dispatches: ```js -const boundAddTodo = text => dispatch(addTodo(text)) -const boundCompleteTodo = index => dispatch(completeTodo(index)) +const boundAddTodo = (text) => dispatch(addTodo(text)) +const boundCompleteTodo = (index) => dispatch(completeTodo(index)) ``` Now you'll be able to call them directly: @@ -131,7 +131,7 @@ export const SET_VISIBILITY_FILTER = 'SET_VISIBILITY_FILTER' export const VisibilityFilters = { SHOW_ALL: 'SHOW_ALL', SHOW_COMPLETED: 'SHOW_COMPLETED', - SHOW_ACTIVE: 'SHOW_ACTIVE' + SHOW_ACTIVE: 'SHOW_ACTIVE', } /* diff --git a/docs/basics/DataFlow.md b/docs/basics/DataFlow.md index 07f664685b8..1e512444e38 100644 --- a/docs/basics/DataFlow.md +++ b/docs/basics/DataFlow.md @@ -40,15 +40,15 @@ let previousState = { todos: [ { text: 'Read the docs.', - complete: false - } - ] + complete: false, + }, + ], } // The action being performed (adding a todo) let action = { type: 'ADD_TODO', - text: 'Understand the flow.' + text: 'Understand the flow.', } // Your reducer returns the next application state @@ -76,7 +76,7 @@ function visibleTodoFilter(state = 'SHOW_ALL', action) { let todoApp = combineReducers({ todos, - visibleTodoFilter + visibleTodoFilter, }) ``` @@ -92,7 +92,7 @@ It will then combine both sets of results into a single state tree: ```js return { todos: nextTodos, - visibleTodoFilter: nextVisibleTodoFilter + visibleTodoFilter: nextVisibleTodoFilter, } ``` diff --git a/docs/basics/ExampleTodoList.md.REMOVED.git-id b/docs/basics/ExampleTodoList.md.REMOVED.git-id index 69c75ad0d7e..19007b6ed3e 100644 --- a/docs/basics/ExampleTodoList.md.REMOVED.git-id +++ b/docs/basics/ExampleTodoList.md.REMOVED.git-id @@ -1 +1 @@ -72c1202d23c35fbdce4718f4719247ea13f9c8d3 \ No newline at end of file +833f0c92fd5acb6e192e456b42b2388e0858d45d \ No newline at end of file diff --git a/docs/basics/Reducers.md.REMOVED.git-id b/docs/basics/Reducers.md.REMOVED.git-id index 495592b9591..346c67e4af3 100644 --- a/docs/basics/Reducers.md.REMOVED.git-id +++ b/docs/basics/Reducers.md.REMOVED.git-id @@ -1 +1 @@ -6574b0ff60a65f8cf4609edab3bb63b8f9d9a88d \ No newline at end of file +1f3af108ea006f99b121bc9b7ad3c1a65637d572 \ No newline at end of file diff --git a/docs/basics/Store.md b/docs/basics/Store.md index 2a642d4b116..692ff0020c8 100644 --- a/docs/basics/Store.md +++ b/docs/basics/Store.md @@ -42,7 +42,7 @@ import { addTodo, toggleTodo, setVisibilityFilter, - VisibilityFilters + VisibilityFilters, } from './actions' // Log the initial state diff --git a/docs/basics/UsageWithReact.md.REMOVED.git-id b/docs/basics/UsageWithReact.md.REMOVED.git-id index 6bfc1977300..0aa6f374a03 100644 --- a/docs/basics/UsageWithReact.md.REMOVED.git-id +++ b/docs/basics/UsageWithReact.md.REMOVED.git-id @@ -1 +1 @@ -3bc00bb07f751419aeb4daf6e5806b0ba2d3c001 \ No newline at end of file +28e112ed93daf57e194277aef7a930644e19ed2b \ No newline at end of file diff --git a/docs/faq/ImmutableData.md.REMOVED.git-id b/docs/faq/ImmutableData.md.REMOVED.git-id index e3e291a69f2..d7486a41be6 100644 --- a/docs/faq/ImmutableData.md.REMOVED.git-id +++ b/docs/faq/ImmutableData.md.REMOVED.git-id @@ -1 +1 @@ -18878fbcf29891ec8666a7740ef4697375b9b0a7 \ No newline at end of file +002ff61fd3598fd3a419a1e8dfa4e8582645b9d3 \ No newline at end of file diff --git a/docs/faq/ReactRedux.md.REMOVED.git-id b/docs/faq/ReactRedux.md.REMOVED.git-id index 06dc88b5913..ad705a5170f 100644 --- a/docs/faq/ReactRedux.md.REMOVED.git-id +++ b/docs/faq/ReactRedux.md.REMOVED.git-id @@ -1 +1 @@ -db10cbc0164ada5be7c9ef99b84e058af88a1386 \ No newline at end of file +ef516d3a21db308c5c25ccd6d726fb12cff877cb \ No newline at end of file diff --git a/docs/introduction/CoreConcepts.md b/docs/introduction/CoreConcepts.md index 95d288c2e76..979fd52114a 100644 --- a/docs/introduction/CoreConcepts.md +++ b/docs/introduction/CoreConcepts.md @@ -67,7 +67,7 @@ And we write another reducer that manages the complete state of our app by calli function todoApp(state = {}, action) { return { todos: todos(state.todos, action), - visibilityFilter: visibilityFilter(state.visibilityFilter, action) + visibilityFilter: visibilityFilter(state.visibilityFilter, action), } } ``` diff --git a/docs/introduction/Ecosystem.md.REMOVED.git-id b/docs/introduction/Ecosystem.md.REMOVED.git-id index 81582a1f14f..272894c92c0 100644 --- a/docs/introduction/Ecosystem.md.REMOVED.git-id +++ b/docs/introduction/Ecosystem.md.REMOVED.git-id @@ -1 +1 @@ -9d5eafa60099d158e4e33deb83f9274e335ce7d7 \ No newline at end of file +62c6ee0946f1ab13bd413e694d3a2abb4240de66 \ No newline at end of file diff --git a/docs/introduction/PriorArt.md.REMOVED.git-id b/docs/introduction/PriorArt.md.REMOVED.git-id index 2d5e70b6082..6e1986d3dc7 100644 --- a/docs/introduction/PriorArt.md.REMOVED.git-id +++ b/docs/introduction/PriorArt.md.REMOVED.git-id @@ -1 +1 @@ -7de044220b8cf735faa64ef8a67ff7fb6f53d088 \ No newline at end of file +416311eba37cc5c2b0207be06988f83ca960a85a \ No newline at end of file diff --git a/docs/introduction/ThreePrinciples.md b/docs/introduction/ThreePrinciples.md index 92e7d2ddaab..bcf804e6f41 100644 --- a/docs/introduction/ThreePrinciples.md +++ b/docs/introduction/ThreePrinciples.md @@ -44,12 +44,12 @@ This ensures that neither the views nor the network callbacks will ever write di ```js store.dispatch({ type: 'COMPLETE_TODO', - index: 1 + index: 1, }) store.dispatch({ type: 'SET_VISIBILITY_FILTER', - filter: 'SHOW_COMPLETED' + filter: 'SHOW_COMPLETED', }) ``` @@ -76,14 +76,14 @@ function todos(state = [], action) { ...state, { text: action.text, - completed: false - } + completed: false, + }, ] case 'COMPLETE_TODO': return state.map((todo, index) => { if (index === action.index) { return Object.assign({}, todo, { - completed: true + completed: true, }) } return todo diff --git a/docs/recipes/CodeSplitting.md.REMOVED.git-id b/docs/recipes/CodeSplitting.md.REMOVED.git-id index 72670ad94ce..2b199cbadfa 100644 --- a/docs/recipes/CodeSplitting.md.REMOVED.git-id +++ b/docs/recipes/CodeSplitting.md.REMOVED.git-id @@ -1 +1 @@ -337a733013a8045eff85ca2a79ba73fe76382fae \ No newline at end of file +26d26564b9246c06ee029d5ae3f38a1555e57a11 \ No newline at end of file diff --git a/docs/recipes/ComputingDerivedData.md.REMOVED.git-id b/docs/recipes/ComputingDerivedData.md.REMOVED.git-id index 504eaf47f4f..67e59e57ada 100644 --- a/docs/recipes/ComputingDerivedData.md.REMOVED.git-id +++ b/docs/recipes/ComputingDerivedData.md.REMOVED.git-id @@ -1 +1 @@ -f535a8a97619603b267c69839b8e986dea4e6b4a \ No newline at end of file +1f2020c9d7c1cd206ca0aa1cab468b4bbe91c720 \ No newline at end of file diff --git a/docs/recipes/ConfiguringYourStore.md.REMOVED.git-id b/docs/recipes/ConfiguringYourStore.md.REMOVED.git-id index da4a3a81bd7..6245dc4e731 100644 --- a/docs/recipes/ConfiguringYourStore.md.REMOVED.git-id +++ b/docs/recipes/ConfiguringYourStore.md.REMOVED.git-id @@ -1 +1 @@ -363746d5bf7b91f05eb6af714d3d078a6dd3fd53 \ No newline at end of file +6d6f549fd22ea703431d3dd51ce725e7ce679450 \ No newline at end of file diff --git a/docs/recipes/ImplementingUndoHistory.md.REMOVED.git-id b/docs/recipes/ImplementingUndoHistory.md.REMOVED.git-id index badfc5707d7..d62b7214284 100644 --- a/docs/recipes/ImplementingUndoHistory.md.REMOVED.git-id +++ b/docs/recipes/ImplementingUndoHistory.md.REMOVED.git-id @@ -1 +1 @@ -d33491ea0b2210de25f56100f1a2a5ae6ae44b96 \ No newline at end of file +c478feab512ca4c20be73d79d0a612500e11f0e6 \ No newline at end of file diff --git a/docs/recipes/ReducingBoilerplate.md.REMOVED.git-id b/docs/recipes/ReducingBoilerplate.md.REMOVED.git-id index 1ad7777099c..5cab5a3bf54 100644 --- a/docs/recipes/ReducingBoilerplate.md.REMOVED.git-id +++ b/docs/recipes/ReducingBoilerplate.md.REMOVED.git-id @@ -1 +1 @@ -a851d648a911d0f1478c7ff0055aaaaf78ed75bc \ No newline at end of file +e390f528a3c5ed2a46996984b3a4768a4665cd77 \ No newline at end of file diff --git a/docs/recipes/ServerRendering.md.REMOVED.git-id b/docs/recipes/ServerRendering.md.REMOVED.git-id index d1d399fe622..f522d6e25da 100644 --- a/docs/recipes/ServerRendering.md.REMOVED.git-id +++ b/docs/recipes/ServerRendering.md.REMOVED.git-id @@ -1 +1 @@ -1e4de19d290b11cf02ff290eb3c6242eea4486e3 \ No newline at end of file +e3d608a268b152ab756d49e00bab04914b9f2f75 \ No newline at end of file diff --git a/docs/recipes/UsageWithTypescript.md.REMOVED.git-id b/docs/recipes/UsageWithTypescript.md.REMOVED.git-id index 7b8e07ce047..8cdc5dbe3a6 100644 --- a/docs/recipes/UsageWithTypescript.md.REMOVED.git-id +++ b/docs/recipes/UsageWithTypescript.md.REMOVED.git-id @@ -1 +1 @@ -e1476285b5e3e037de7b254b5605f1d4008c167e \ No newline at end of file +aafef961d3cf4c1985c28785241842ded97b3f54 \ No newline at end of file diff --git a/docs/recipes/UsingImmutableJS.md.REMOVED.git-id b/docs/recipes/UsingImmutableJS.md.REMOVED.git-id index c8ddba8daad..8533c6ca4ef 100644 --- a/docs/recipes/UsingImmutableJS.md.REMOVED.git-id +++ b/docs/recipes/UsingImmutableJS.md.REMOVED.git-id @@ -1 +1 @@ -0f657dc8e65f71f06f3bd58fe96cf5ff3fc5b156 \ No newline at end of file +b5d9e44d300eb8b581e66cc5a0a5faa65898a1c8 \ No newline at end of file diff --git a/docs/recipes/UsingObjectSpreadOperator.md b/docs/recipes/UsingObjectSpreadOperator.md index fa860b867a2..eaa32db9465 100644 --- a/docs/recipes/UsingObjectSpreadOperator.md +++ b/docs/recipes/UsingObjectSpreadOperator.md @@ -14,7 +14,7 @@ function todoApp(state = initialState, action) { switch (action.type) { case SET_VISIBILITY_FILTER: return Object.assign({}, state, { - visibilityFilter: action.filter + visibilityFilter: action.filter, }) default: return state @@ -40,9 +40,9 @@ function todoApp(state = initialState, action) { The advantage of using the object spread syntax becomes more apparent when you're composing complex objects. Below `getAddedIds` maps an array of `id` values to an array of objects with values returned from `getProduct` and `getQuantity`. ```js -return getAddedIds(state.cart).map(id => +return getAddedIds(state.cart).map((id) => Object.assign({}, getProduct(state.products, id), { - quantity: getQuantity(state.cart, id) + quantity: getQuantity(state.cart, id), }) ) ``` @@ -50,9 +50,9 @@ return getAddedIds(state.cart).map(id => Object spread lets us simplify the above `map` call to: ```js -return getAddedIds(state.cart).map(id => ({ +return getAddedIds(state.cart).map((id) => ({ ...getProduct(state.products, id), - quantity: getQuantity(state.cart, id) + quantity: getQuantity(state.cart, id), })) ``` diff --git a/docs/recipes/WritingTests.md.REMOVED.git-id b/docs/recipes/WritingTests.md.REMOVED.git-id index f528b4a3c3b..40eaebfc832 100644 --- a/docs/recipes/WritingTests.md.REMOVED.git-id +++ b/docs/recipes/WritingTests.md.REMOVED.git-id @@ -1 +1 @@ -4b87a534c878a43d94f2ba8834efa8e76fd7fd8b \ No newline at end of file +30c9120200f1f5102617f681822c8298f0a3a56f \ No newline at end of file diff --git a/docs/recipes/structuring-reducers/BeyondCombineReducers.md.REMOVED.git-id b/docs/recipes/structuring-reducers/BeyondCombineReducers.md.REMOVED.git-id index 04989b12f7b..d078460a31b 100644 --- a/docs/recipes/structuring-reducers/BeyondCombineReducers.md.REMOVED.git-id +++ b/docs/recipes/structuring-reducers/BeyondCombineReducers.md.REMOVED.git-id @@ -1 +1 @@ -2220bfe7f76445cb060903cc572ac6232bc55e05 \ No newline at end of file +2525a2394364d8450c652c99ce35d47e3d1e9eca \ No newline at end of file diff --git a/docs/recipes/structuring-reducers/ImmutableUpdatePatterns.md.REMOVED.git-id b/docs/recipes/structuring-reducers/ImmutableUpdatePatterns.md.REMOVED.git-id index 48b59545e24..b3c26431c03 100644 --- a/docs/recipes/structuring-reducers/ImmutableUpdatePatterns.md.REMOVED.git-id +++ b/docs/recipes/structuring-reducers/ImmutableUpdatePatterns.md.REMOVED.git-id @@ -1 +1 @@ -b6b4d0656ac2f9a1d3b2e6da4bcaec0404e61c63 \ No newline at end of file +88ab310ddd5498e645a58906bb6395ca93517f4d \ No newline at end of file diff --git a/docs/recipes/structuring-reducers/InitializingState.md.REMOVED.git-id b/docs/recipes/structuring-reducers/InitializingState.md.REMOVED.git-id index 66e30ea9c4c..700550dae88 100644 --- a/docs/recipes/structuring-reducers/InitializingState.md.REMOVED.git-id +++ b/docs/recipes/structuring-reducers/InitializingState.md.REMOVED.git-id @@ -1 +1 @@ -bd793942e4dfa4fd18aa7fad22a2fdd281e159c9 \ No newline at end of file +3388465d6514dcc68ce59e5d3d7d4fc452f3dde6 \ No newline at end of file diff --git a/docs/recipes/structuring-reducers/NormalizingStateShape.md.REMOVED.git-id b/docs/recipes/structuring-reducers/NormalizingStateShape.md.REMOVED.git-id index 0a83e9b49b5..99e06f05bdd 100644 --- a/docs/recipes/structuring-reducers/NormalizingStateShape.md.REMOVED.git-id +++ b/docs/recipes/structuring-reducers/NormalizingStateShape.md.REMOVED.git-id @@ -1 +1 @@ -5121ebb4571a3b743f5567b3edcd0d6fda261a81 \ No newline at end of file +eb9a26f8dfef517a6c1fc59bab5b6e7389656921 \ No newline at end of file diff --git a/docs/recipes/structuring-reducers/RefactoringReducersExample.md.REMOVED.git-id b/docs/recipes/structuring-reducers/RefactoringReducersExample.md.REMOVED.git-id index 735896208dd..941a5613f39 100644 --- a/docs/recipes/structuring-reducers/RefactoringReducersExample.md.REMOVED.git-id +++ b/docs/recipes/structuring-reducers/RefactoringReducersExample.md.REMOVED.git-id @@ -1 +1 @@ -7c6dd78179ccdf8ded37fc9f245a235bd2755d88 \ No newline at end of file +34da98e556350a097d73e1bbe89fc1039ac8660b \ No newline at end of file diff --git a/docs/recipes/structuring-reducers/ReusingReducerLogic.md.REMOVED.git-id b/docs/recipes/structuring-reducers/ReusingReducerLogic.md.REMOVED.git-id index 0fa2c6a6538..2c470b8af3d 100644 --- a/docs/recipes/structuring-reducers/ReusingReducerLogic.md.REMOVED.git-id +++ b/docs/recipes/structuring-reducers/ReusingReducerLogic.md.REMOVED.git-id @@ -1 +1 @@ -5c6f8127c858dfdf423eb7a9c73fa437273cdee9 \ No newline at end of file +586a6e7f0432d01756011add5709f11c9e98fcc7 \ No newline at end of file diff --git a/docs/recipes/structuring-reducers/UpdatingNormalizedData.md.REMOVED.git-id b/docs/recipes/structuring-reducers/UpdatingNormalizedData.md.REMOVED.git-id index 6593b99e063..df44fdd001c 100644 --- a/docs/recipes/structuring-reducers/UpdatingNormalizedData.md.REMOVED.git-id +++ b/docs/recipes/structuring-reducers/UpdatingNormalizedData.md.REMOVED.git-id @@ -1 +1 @@ -ceeff11d048c293bae946646831000b7d7cfdb7c \ No newline at end of file +f9b2f915a99f8a562620069b8dcc14e2a2e85430 \ No newline at end of file diff --git a/docs/recipes/structuring-reducers/UsingCombineReducers.md.REMOVED.git-id b/docs/recipes/structuring-reducers/UsingCombineReducers.md.REMOVED.git-id index ba553eb5c3f..ac7a35b7d56 100644 --- a/docs/recipes/structuring-reducers/UsingCombineReducers.md.REMOVED.git-id +++ b/docs/recipes/structuring-reducers/UsingCombineReducers.md.REMOVED.git-id @@ -1 +1 @@ -96f4d1e808f91e0b1e591566922739cadd962106 \ No newline at end of file +2aba579976b72410ce87d8ad379aa387ed7167c4 \ No newline at end of file diff --git a/index.d.ts.REMOVED.git-id b/index.d.ts.REMOVED.git-id index 2497d991db2..808591b4d0c 100644 --- a/index.d.ts.REMOVED.git-id +++ b/index.d.ts.REMOVED.git-id @@ -1 +1 @@ -1e3804ae97a94c7df4b0ef62d720b4a21a5d8409 \ No newline at end of file +b00c6f0885b9df7bf80500d9545dfb59f400a42c \ No newline at end of file diff --git a/src/applyMiddleware.js b/src/applyMiddleware.js index 3bfc647b455..8810762619d 100644 --- a/src/applyMiddleware.js +++ b/src/applyMiddleware.js @@ -17,7 +17,7 @@ import compose from './compose' * @returns {Function} A store enhancer applying the middleware. */ export default function applyMiddleware(...middlewares) { - return createStore => (...args) => { + return (createStore) => (...args) => { const store = createStore(...args) let dispatch = () => { throw new Error( @@ -28,14 +28,14 @@ export default function applyMiddleware(...middlewares) { const middlewareAPI = { getState: store.getState, - dispatch: (...args) => dispatch(...args) + dispatch: (...args) => dispatch(...args), } - const chain = middlewares.map(middleware => middleware(middlewareAPI)) + const chain = middlewares.map((middleware) => middleware(middlewareAPI)) dispatch = compose(...chain)(store.dispatch) return { ...store, - dispatch + dispatch, } } } diff --git a/src/bindActionCreators.js b/src/bindActionCreators.js index 0e47477deff..dd78819e561 100644 --- a/src/bindActionCreators.js +++ b/src/bindActionCreators.js @@ -1,5 +1,5 @@ function bindActionCreator(actionCreator, dispatch) { - return function() { + return function () { return dispatch(actionCreator.apply(this, arguments)) } } diff --git a/src/combineReducers.js.REMOVED.git-id b/src/combineReducers.js.REMOVED.git-id index b5b77fdb7af..b64e3f74b26 100644 --- a/src/combineReducers.js.REMOVED.git-id +++ b/src/combineReducers.js.REMOVED.git-id @@ -1 +1 @@ -bdbcfb2291b2957ab51f50b7f2c7f2609a71db20 \ No newline at end of file +dcf06f2829ebc3ab3c0c9f85735e81e32b36eeb6 \ No newline at end of file diff --git a/src/compose.js b/src/compose.js index be6cc34ef16..f256bb77cd6 100644 --- a/src/compose.js +++ b/src/compose.js @@ -11,7 +11,7 @@ export default function compose(...funcs) { if (funcs.length === 0) { - return arg => arg + return (arg) => arg } if (funcs.length === 1) { diff --git a/src/createStore.js.REMOVED.git-id b/src/createStore.js.REMOVED.git-id index 7dc5ec95c4d..190a92a4a78 100644 --- a/src/createStore.js.REMOVED.git-id +++ b/src/createStore.js.REMOVED.git-id @@ -1 +1 @@ -cef9a2ecaeff319d4986af24babf1c79ec9912c6 \ No newline at end of file +45b09aca009a5a9a2298800982c77b87e45b47ab \ No newline at end of file diff --git a/src/index.js b/src/index.js index efedbc4fede..277e57b8dce 100644 --- a/src/index.js +++ b/src/index.js @@ -32,5 +32,5 @@ export { bindActionCreators, applyMiddleware, compose, - __DO_NOT_USE__ActionTypes + __DO_NOT_USE__ActionTypes, } diff --git a/src/utils/actionTypes.js b/src/utils/actionTypes.js index 0d7d023de41..2c3788b6a5d 100644 --- a/src/utils/actionTypes.js +++ b/src/utils/actionTypes.js @@ -6,16 +6,12 @@ */ const randomString = () => - Math.random() - .toString(36) - .substring(7) - .split('') - .join('.') + Math.random().toString(36).substring(7).split('').join('.') const ActionTypes = { INIT: `@@redux/INIT${randomString()}`, REPLACE: `@@redux/REPLACE${randomString()}`, - PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}` + PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`, } export default ActionTypes diff --git a/test/applyMiddleware.spec.js b/test/applyMiddleware.spec.js index 2efdc9f83f1..d67bb527b6b 100644 --- a/test/applyMiddleware.spec.js +++ b/test/applyMiddleware.spec.js @@ -7,7 +7,7 @@ describe('applyMiddleware', () => { it('warns when dispatching during middleware setup', () => { function dispatchingMiddleware(store) { store.dispatch(addTodo('Dont dispatch in middleware setup')) - return next => action => next(action) + return (next) => (action) => next(action) } expect(() => @@ -17,9 +17,9 @@ describe('applyMiddleware', () => { it('wraps dispatch method with middleware once', () => { function test(spyOnMethods) { - return methods => { + return (methods) => { spyOnMethods(methods) - return next => action => next(action) + return (next) => (action) => next(action) } } @@ -36,13 +36,13 @@ describe('applyMiddleware', () => { expect(store.getState()).toEqual([ { id: 1, text: 'Use Redux' }, - { id: 2, text: 'Flux FTW!' } + { id: 2, text: 'Flux FTW!' }, ]) }) it('passes recursive dispatches through the middleware chain', () => { function test(spyOnMethods) { - return () => next => action => { + return () => (next) => (action) => { spyOnMethods(action) return next(action) } @@ -56,51 +56,51 @@ describe('applyMiddleware', () => { }) }) - it('works with thunk middleware', done => { + it('works with thunk middleware', (done) => { const store = applyMiddleware(thunk)(createStore)(reducers.todos) store.dispatch(addTodoIfEmpty('Hello')) expect(store.getState()).toEqual([ { id: 1, - text: 'Hello' - } + text: 'Hello', + }, ]) store.dispatch(addTodoIfEmpty('Hello')) expect(store.getState()).toEqual([ { id: 1, - text: 'Hello' - } + text: 'Hello', + }, ]) store.dispatch(addTodo('World')) expect(store.getState()).toEqual([ { id: 1, - text: 'Hello' + text: 'Hello', }, { id: 2, - text: 'World' - } + text: 'World', + }, ]) store.dispatch(addTodoAsync('Maybe')).then(() => { expect(store.getState()).toEqual([ { id: 1, - text: 'Hello' + text: 'Hello', }, { id: 2, - text: 'World' + text: 'World', }, { id: 3, - text: 'Maybe' - } + text: 'Maybe', + }, ]) done() }) @@ -111,7 +111,7 @@ describe('applyMiddleware', () => { const testCallArgs = ['test'] function multiArgMiddleware() { - return next => (action, callArgs) => { + return (next) => (action, callArgs) => { if (Array.isArray(callArgs)) { return action(...callArgs) } @@ -120,7 +120,7 @@ describe('applyMiddleware', () => { } function dummyMiddleware({ dispatch }) { - return next => action => dispatch(action, testCallArgs) + return (next) => (action) => dispatch(action, testCallArgs) } const store = createStore( diff --git a/test/bindActionCreators.spec.js b/test/bindActionCreators.spec.js index a9e2f2a6eab..54031dbbeef 100644 --- a/test/bindActionCreators.spec.js +++ b/test/bindActionCreators.spec.js @@ -9,7 +9,7 @@ describe('bindActionCreators', () => { beforeEach(() => { store = createStore(todos) actionCreatorFunctions = { ...actionCreators } - Object.keys(actionCreatorFunctions).forEach(key => { + Object.keys(actionCreatorFunctions).forEach((key) => { if (typeof actionCreatorFunctions[key] !== 'function') { delete actionCreatorFunctions[key] } @@ -53,7 +53,7 @@ describe('bindActionCreators', () => { bar: 'baz', wow: undefined, much: {}, - test: null + test: null, }, store.dispatch ) diff --git a/test/combineReducers.spec.js.REMOVED.git-id b/test/combineReducers.spec.js.REMOVED.git-id index 48519dc230b..52d8d7ef331 100644 --- a/test/combineReducers.spec.js.REMOVED.git-id +++ b/test/combineReducers.spec.js.REMOVED.git-id @@ -1 +1 @@ -e0e69aa110989ea78538979bdb3a277b89208354 \ No newline at end of file +cfd712da380142f8aba47f37add1db132a57febf \ No newline at end of file diff --git a/test/compose.spec.js b/test/compose.spec.js index 392b403f980..31003c1ff0f 100644 --- a/test/compose.spec.js +++ b/test/compose.spec.js @@ -3,103 +3,39 @@ import { compose } from '../' describe('Utils', () => { describe('compose', () => { it('composes from right to left', () => { - const double = x => x * 2 - const square = x => x * x + const double = (x) => x * 2 + const square = (x) => x * x expect(compose(square)(5)).toBe(25) - expect( - compose( - square, - double - )(5) - ).toBe(100) - expect( - compose( - double, - square, - double - )(5) - ).toBe(200) + expect(compose(square, double)(5)).toBe(100) + expect(compose(double, square, double)(5)).toBe(200) }) it('composes functions from right to left', () => { - const a = next => x => next(x + 'a') - const b = next => x => next(x + 'b') - const c = next => x => next(x + 'c') - const final = x => x - - expect( - compose( - a, - b, - c - )(final)('') - ).toBe('abc') - expect( - compose( - b, - c, - a - )(final)('') - ).toBe('bca') - expect( - compose( - c, - a, - b - )(final)('') - ).toBe('cab') + const a = (next) => (x) => next(x + 'a') + const b = (next) => (x) => next(x + 'b') + const c = (next) => (x) => next(x + 'c') + const final = (x) => x + + expect(compose(a, b, c)(final)('')).toBe('abc') + expect(compose(b, c, a)(final)('')).toBe('bca') + expect(compose(c, a, b)(final)('')).toBe('cab') }) it('throws at runtime if argument is not a function', () => { - const square = x => x * x + const square = (x) => x * x const add = (x, y) => x + y - expect(() => - compose( - square, - add, - false - )(1, 2) - ).toThrow() - expect(() => - compose( - square, - add, - undefined - )(1, 2) - ).toThrow() - expect(() => - compose( - square, - add, - true - )(1, 2) - ).toThrow() - expect(() => - compose( - square, - add, - NaN - )(1, 2) - ).toThrow() - expect(() => - compose( - square, - add, - '42' - )(1, 2) - ).toThrow() + expect(() => compose(square, add, false)(1, 2)).toThrow() + expect(() => compose(square, add, undefined)(1, 2)).toThrow() + expect(() => compose(square, add, true)(1, 2)).toThrow() + expect(() => compose(square, add, NaN)(1, 2)).toThrow() + expect(() => compose(square, add, '42')(1, 2)).toThrow() }) it('can be seeded with multiple arguments', () => { - const square = x => x * x + const square = (x) => x * x const add = (x, y) => x + y - expect( - compose( - square, - add - )(1, 2) - ).toBe(9) + expect(compose(square, add)(1, 2)).toBe(9) }) it('returns the first given argument if given no functions', () => { diff --git a/test/createStore.spec.js.REMOVED.git-id b/test/createStore.spec.js.REMOVED.git-id index 407db9f3029..88a67193fa8 100644 --- a/test/createStore.spec.js.REMOVED.git-id +++ b/test/createStore.spec.js.REMOVED.git-id @@ -1 +1 @@ -6a837c0d1d9dcadcfbc483465a928cac701ff99d \ No newline at end of file +9bbac18428e62d57a68306a56c5e17ce6e55f13d \ No newline at end of file diff --git a/test/helpers/actionCreators.js b/test/helpers/actionCreators.js index c75a7c30843..0954a756c3c 100644 --- a/test/helpers/actionCreators.js +++ b/test/helpers/actionCreators.js @@ -5,7 +5,7 @@ import { SUBSCRIBE_IN_MIDDLE, UNSUBSCRIBE_IN_MIDDLE, THROW_ERROR, - UNKNOWN_ACTION + UNKNOWN_ACTION, } from './actionTypes' export function addTodo(text) { @@ -13,8 +13,8 @@ export function addTodo(text) { } export function addTodoAsync(text) { - return dispatch => - new Promise(resolve => + return (dispatch) => + new Promise((resolve) => setImmediate(() => { dispatch(addTodo(text)) resolve() @@ -33,39 +33,39 @@ export function addTodoIfEmpty(text) { export function dispatchInMiddle(boundDispatchFn) { return { type: DISPATCH_IN_MIDDLE, - boundDispatchFn + boundDispatchFn, } } export function getStateInMiddle(boundGetStateFn) { return { type: GET_STATE_IN_MIDDLE, - boundGetStateFn + boundGetStateFn, } } export function subscribeInMiddle(boundSubscribeFn) { return { type: SUBSCRIBE_IN_MIDDLE, - boundSubscribeFn + boundSubscribeFn, } } export function unsubscribeInMiddle(boundUnsubscribeFn) { return { type: UNSUBSCRIBE_IN_MIDDLE, - boundUnsubscribeFn + boundUnsubscribeFn, } } export function throwError() { return { - type: THROW_ERROR + type: THROW_ERROR, } } export function unknownAction() { return { - type: UNKNOWN_ACTION + type: UNKNOWN_ACTION, } } diff --git a/test/helpers/middleware.js b/test/helpers/middleware.js index 06f074fffaa..6666333236d 100644 --- a/test/helpers/middleware.js +++ b/test/helpers/middleware.js @@ -1,4 +1,4 @@ export function thunk({ dispatch, getState }) { - return next => action => + return (next) => (action) => typeof action === 'function' ? action(dispatch, getState) : next(action) } diff --git a/test/helpers/reducers.js b/test/helpers/reducers.js index f0030fb2dd7..51c833b1c4e 100644 --- a/test/helpers/reducers.js +++ b/test/helpers/reducers.js @@ -4,7 +4,7 @@ import { GET_STATE_IN_MIDDLE, SUBSCRIBE_IN_MIDDLE, UNSUBSCRIBE_IN_MIDDLE, - THROW_ERROR + THROW_ERROR, } from './actionTypes' function id(state = []) { @@ -20,8 +20,8 @@ export function todos(state = [], action) { ...state, { id: id(state), - text: action.text - } + text: action.text, + }, ] default: return state @@ -34,9 +34,9 @@ export function todosReverse(state = [], action) { return [ { id: id(state), - text: action.text + text: action.text, }, - ...state + ...state, ] default: return state diff --git a/test/typescript.spec.js b/test/typescript.spec.js index e2f25f193e8..2b2c87d02a6 100644 --- a/test/typescript.spec.js +++ b/test/typescript.spec.js @@ -1,6 +1,6 @@ import { checkDirectory } from 'typings-tester' -describe('TypeScript definitions', function() { +describe('TypeScript definitions', function () { it('should compile against index.d.ts', () => { checkDirectory(__dirname + '/typescript') }) diff --git a/test/typescript/actionCreators.ts b/test/typescript/actionCreators.ts index e3594a0712d..6746e3c7f3a 100644 --- a/test/typescript/actionCreators.ts +++ b/test/typescript/actionCreators.ts @@ -3,7 +3,7 @@ import { Action, Dispatch, bindActionCreators, - ActionCreatorsMapObject + ActionCreatorsMapObject, } from 'redux' interface AddTodoAction extends Action { @@ -12,7 +12,7 @@ interface AddTodoAction extends Action { const addTodo: ActionCreator = (text: string) => ({ type: 'ADD_TODO', - text + text, }) const addTodoAction: AddTodoAction = addTodo('test') @@ -23,7 +23,7 @@ const addTodoViaThunk: ActionCreator = (text: string) => ( dispatch: Dispatch ) => ({ type: 'ADD_TODO', - text + text, }) declare const dispatch: Dispatch @@ -57,7 +57,7 @@ interface N extends ActionCreatorsMapObject { const boundActionCreators2 = bindActionCreators( { - addTodoViaThunk + addTodoViaThunk, }, dispatch ) diff --git a/test/typescript/actions.ts b/test/typescript/actions.ts index 1b701ce77db..0fd75437893 100644 --- a/test/typescript/actions.ts +++ b/test/typescript/actions.ts @@ -7,7 +7,7 @@ namespace FSA { const action: Action = { type: 'ACTION_TYPE', - payload: 'test' + payload: 'test', } const payload: string = action.payload @@ -20,7 +20,7 @@ namespace FreeShapeAction { const action: Action = { type: 'ACTION_TYPE', - text: 'test' + text: 'test', } const text: string = action['text'] @@ -34,7 +34,7 @@ namespace StringLiteralTypeAction { } const action: Action = { - type: 'A' + type: 'A', } const type: ActionType = action.type @@ -44,7 +44,7 @@ namespace EnumTypeAction { enum ActionType { A, B, - C + C, } interface Action extends ReduxAction { @@ -52,7 +52,7 @@ namespace EnumTypeAction { } const action: Action = { - type: ActionType.A + type: ActionType.A, } const type: ActionType = action.type diff --git a/test/typescript/compose.ts b/test/typescript/compose.ts index ae2fc5b32db..c453b78f217 100644 --- a/test/typescript/compose.ts +++ b/test/typescript/compose.ts @@ -6,28 +6,15 @@ const numberToNumber = (a: number): number => a + 2 const numberToString = (a: number): string => 'foo' const stringToNumber = (a: string): number => 5 -const t1: number = compose( - numberToNumber, - numberToNumber -)(5) -const t2: string = compose( - numberToString, - numberToNumber -)(5) -const t3: string = compose( - numberToString, - stringToNumber -)('f') +const t1: number = compose(numberToNumber, numberToNumber)(5) +const t2: string = compose(numberToString, numberToNumber)(5) +const t3: string = compose(numberToString, stringToNumber)('f') const t4: (a: string) => number = compose( (f: (a: string) => number) => (p: string) => 5, (f: (a: number) => string) => (p: string) => 4 )(numberToString) -const t5: number = compose( - stringToNumber, - numberToString, - numberToNumber -)(5) +const t5: number = compose(stringToNumber, numberToString, numberToNumber)(5) const t6: string = compose( numberToString, stringToNumber, @@ -47,15 +34,12 @@ const t7: string = compose( const multiArgFn = (a: string, b: number, c: boolean): string => 'foo' const t8: string = compose(multiArgFn)('bar', 42, true) -const t9: number = compose( - stringToNumber, - multiArgFn -)('bar', 42, true) -const t10: string = compose( - numberToString, - stringToNumber, - multiArgFn -)('bar', 42, true) +const t9: number = compose(stringToNumber, multiArgFn)('bar', 42, true) +const t10: string = compose(numberToString, stringToNumber, multiArgFn)( + 'bar', + 42, + true +) const t11: number = compose( stringToNumber, diff --git a/test/typescript/enhancers.ts b/test/typescript/enhancers.ts index 7259b4884bf..4f9b3b401e7 100644 --- a/test/typescript/enhancers.ts +++ b/test/typescript/enhancers.ts @@ -32,7 +32,7 @@ function stateExtension() { extraField: 'extra' } - const enhancer: StoreEnhancer<{}, ExtraState> = createStore => < + const enhancer: StoreEnhancer<{}, ExtraState> = (createStore) => < S, A extends Action = AnyAction >( diff --git a/test/typescript/injectedDispatch.ts b/test/typescript/injectedDispatch.ts index f115b699fe3..76565681ea4 100644 --- a/test/typescript/injectedDispatch.ts +++ b/test/typescript/injectedDispatch.ts @@ -16,7 +16,7 @@ declare function connect( * Inject default dispatch. */ function simple() { - const hoc: HOC<{ onClick(): void }> = connect(dispatch => { + const hoc: HOC<{ onClick(): void }> = connect((dispatch) => { return { onClick() { dispatch({ type: 'INCREMENT' }) @@ -24,7 +24,7 @@ function simple() { dispatch(Promise.resolve({ type: 'INCREMENT' })) // typings:expect-error dispatch('not-an-action') - } + }, } }) } @@ -58,7 +58,7 @@ function discriminated() { dispatch({ type: 'SOME_OTHER_TYPE' }) // typings:expect-error dispatch('not-an-action') - } + }, } } ) @@ -79,7 +79,7 @@ function promise() { dispatch(Promise.resolve({ type: 'INCREMENT' })) // typings:expect-error dispatch('not-an-action') - } + }, } }) } diff --git a/test/typescript/middleware.ts.REMOVED.git-id b/test/typescript/middleware.ts.REMOVED.git-id index c25d1fd76fc..6ab40261a8b 100644 --- a/test/typescript/middleware.ts.REMOVED.git-id +++ b/test/typescript/middleware.ts.REMOVED.git-id @@ -1 +1 @@ -7b1c48443c1f0e03751a219d2a4f97258efabfd5 \ No newline at end of file +c7800c3cf4e4daf979c60c00e60632dbd47f08d0 \ No newline at end of file diff --git a/test/typescript/reducers.ts.REMOVED.git-id b/test/typescript/reducers.ts.REMOVED.git-id index 3f1ea857197..d4ce5183504 100644 --- a/test/typescript/reducers.ts.REMOVED.git-id +++ b/test/typescript/reducers.ts.REMOVED.git-id @@ -1 +1 @@ -5a109eeecee5610220b77259d3b0ee175d8dbd74 \ No newline at end of file +7533903180d1ea16452a93bc52bfb4f6fa07f59e \ No newline at end of file diff --git a/test/typescript/store.ts b/test/typescript/store.ts index 60c1ceaa28d..685bfbf1b6a 100644 --- a/test/typescript/store.ts +++ b/test/typescript/store.ts @@ -7,7 +7,7 @@ import { StoreCreator, StoreEnhancerStoreCreator, Unsubscribe, - Observer + Observer, } from 'redux' import 'symbol-observable' @@ -33,9 +33,9 @@ const reducer: Reducer = ( a: 'a', b: { c: 'c', - d: 'd' + d: 'd', }, - c: brandedString + c: brandedString, }, action: Action ): State => { @@ -47,9 +47,9 @@ const reducerWithAction: Reducer = ( a: 'a', b: { c: 'c', - d: 'd' + d: 'd', }, - c: brandedString + c: brandedString, }, action: DerivedAction ): State => { @@ -65,19 +65,19 @@ const store: Store = createStore(reducer) const storeWithPreloadedState: Store = createStore(reducer, { a: 'a', b: { c: 'c', d: 'd' }, - c: brandedString + c: brandedString, }) // typings:expect-error const storeWithBadPreloadedState: Store = createStore(reducer, { b: { c: 'c' }, - c: brandedString + c: brandedString, }) const storeWithActionReducer = createStore(reducerWithAction) const storeWithActionReducerAndPreloadedState = createStore(reducerWithAction, { a: 'a', b: { c: 'c', d: 'd' }, - c: brandedString + c: brandedString, }) funcWithStore(storeWithActionReducer) funcWithStore(storeWithActionReducerAndPreloadedState) @@ -87,11 +87,11 @@ const storeWithActionReducerAndBadPreloadedState = createStore( reducerWithAction, { b: { c: 'c' }, - c: brandedString + c: brandedString, } ) -const enhancer: StoreEnhancer = next => next +const enhancer: StoreEnhancer = (next) => next const storeWithSpecificEnhancer: Store = createStore(reducer, enhancer) @@ -100,7 +100,7 @@ const storeWithPreloadedStateAndEnhancer: Store = createStore( { a: 'a', b: { c: 'c', d: 'd' }, - c: brandedString + c: brandedString, }, enhancer ) @@ -109,7 +109,7 @@ const storeWithPreloadedStateAndEnhancer: Store = createStore( const storeWithBadPreloadedStateAndEnhancer: Store = createStore( reducer, { - b: { c: 'c' } + b: { c: 'c' }, }, enhancer ) @@ -118,7 +118,7 @@ const storeWithBadPreloadedStateAndEnhancer: Store = createStore( store.dispatch({ type: 'ADD_TODO', - text: 'test' + text: 'test', }) /* getState */ @@ -146,7 +146,7 @@ observable = observable[Symbol.observable]() const observer: Observer = { next(state: State) { console.log('current state:', state) - } + }, } const unsubscribeFromObservable = observable.subscribe(observer).unsubscribe unsubscribeFromObservable() From 823d5335d5a6b3bbdf28090b7e028922ef6d4e62 Mon Sep 17 00:00:00 2001 From: Mark Erikson Date: Fri, 2 Apr 2021 16:47:46 -0400 Subject: [PATCH 8/9] Drop Travis from 4.x branch Former-commit-id: 718f675260a8d5bc930a04a2dc0169a6b445c47d --- .travis.yml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d85cbce942d..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: node -cache: npm -script: - - npm run examples:lint - - npm run examples:test From 9f4a0fe39b7badf4638aa659365f58161fba6152 Mon Sep 17 00:00:00 2001 From: Mark Erikson Date: Fri, 2 Apr 2021 16:49:49 -0400 Subject: [PATCH 9/9] Fix size check for lib folder Former-commit-id: 2068b8dec4e35003bc7a4ddb1c0e8f656cb8a284 --- .github/workflows/size.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/size.yaml b/.github/workflows/size.yaml index 2e1faf2cc10..5c2d03985be 100644 --- a/.github/workflows/size.yaml +++ b/.github/workflows/size.yaml @@ -14,4 +14,4 @@ jobs: - uses: preactjs/compressed-size-action@v1 with: repo-token: '${{ secrets.GITHUB_TOKEN }}' - pattern: './{dist,es,li}/*.js' + pattern: './{dist,es,lib}/*.js'