From 4b0b2013b4eb014e4b59fe417ce0682f34a891ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Apr 2021 16:41:13 +1000 Subject: [PATCH 01/14] chore(deps-dev): bump kcd-scripts from 8.1.1 to 8.2.1 (#591) Bumps [kcd-scripts](https://github.com/kentcdodds/kcd-scripts) from 8.1.1 to 8.2.1. - [Release notes](https://github.com/kentcdodds/kcd-scripts/releases) - [Changelog](https://github.com/kentcdodds/kcd-scripts/blob/main/CHANGELOG.md) - [Commits](https://github.com/kentcdodds/kcd-scripts/compare/v8.1.1...v8.2.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 69f7f3c7..9e0ceb8a 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "docz-theme-default": "1.2.0", "docz-utils": "2.3.0", "eslint": "7.23.0", - "kcd-scripts": "8.1.1", + "kcd-scripts": "8.2.1", "prettier": "^2.2.1", "react": "17.0.2", "react-dom": "^17.0.1", From 9308747e3c64155176a56784a05cab11add67ede Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Apr 2021 16:41:55 +1000 Subject: [PATCH 02/14] chore(deps-dev): bump typescript from 4.2.3 to 4.2.4 (#592) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.2.3 to 4.2.4. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9e0ceb8a..ae1a06e5 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "react-dom": "^17.0.1", "react-test-renderer": "17.0.2", "ts-node": "^9.1.1", - "typescript": "4.2.3" + "typescript": "4.2.4" }, "peerDependencies": { "react": ">=16.9.0", From 9a6188ce2b4e0568c9302be2c7096fb455280e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Sat, 10 Apr 2021 07:04:25 +0200 Subject: [PATCH 03/14] chore: Update dependabot.yml (#593) --- .github/dependabot.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 411fc7f7..bb85b6f9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,8 +1,11 @@ -# config options: https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/enabling-and-disabling-version-updates - version: 2 updates: - - package-ecosystem: "npm" - directory: "/" + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily + + - package-ecosystem: npm + directory: / schedule: - interval: "daily" + interval: daily From 9594d5d15e849b6a88b362aab7ca56d1937f995e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sat, 10 Apr 2021 15:05:40 +1000 Subject: [PATCH 04/14] docs: add MichaelDeBoey as a contributor (#594) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 1 + 2 files changed, 10 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index a2dcb363..821ffece 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -510,6 +510,15 @@ "contributions": [ "code" ] + }, + { + "login": "MichaelDeBoey", + "name": "MichaΓ«l De Boey", + "avatar_url": "https://avatars.githubusercontent.com/u/6643991?v=4", + "profile": "https://michaeldeboey.be", + "contributions": [ + "maintenance" + ] } ], "skipCi": true, diff --git a/README.md b/README.md index d0f0a073..411ca55a 100644 --- a/README.md +++ b/README.md @@ -238,6 +238,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Mikhail Vasin

πŸ“–
Aleksandar Grbic

πŸ“–
Jonathan Holmes

πŸ’» +
MichaΓ«l De Boey

🚧 From 17b1f21ded145bfa7af2fd6330cef23e7c1c684a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 10 Apr 2021 16:23:30 +1000 Subject: [PATCH 05/14] chore(deps): bump actions/setup-node from v1 to v2.1.5 (#595) Bumps [actions/setup-node](https://github.com/actions/setup-node) from v1 to v2.1.5. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v1...46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/validate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index da53131f..1e5804c5 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -29,7 +29,7 @@ jobs: uses: actions/checkout@v2 - name: βŽ” Setup node - uses: actions/setup-node@v1 + uses: actions/setup-node@v2.1.5 with: node-version: ${{ matrix.node }} @@ -63,7 +63,7 @@ jobs: uses: actions/checkout@v2 - name: βŽ” Setup node - uses: actions/setup-node@v1 + uses: actions/setup-node@v2.1.5 with: node-version: 14 From ea1219b119776aedbe47bf772cbee7e4c3325b04 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 10 Apr 2021 16:29:44 +1000 Subject: [PATCH 06/14] chore(deps): bump styfle/cancel-workflow-action from 0.6.0 to 0.8.0 (#596) Bumps [styfle/cancel-workflow-action](https://github.com/styfle/cancel-workflow-action) from 0.6.0 to 0.8.0. - [Release notes](https://github.com/styfle/cancel-workflow-action/releases) - [Commits](https://github.com/styfle/cancel-workflow-action/compare/0.6.0...3d86a7cc43670094ac248017207be0295edbc31d) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/validate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 1e5804c5..0d91cc62 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest steps: - name: πŸ›‘ Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.6.0 + uses: styfle/cancel-workflow-action@0.8.0 with: access_token: ${{ secrets.GITHUB_TOKEN }} @@ -55,7 +55,7 @@ jobs: github.ref) && github.event_name == 'push' }} steps: - name: πŸ›‘ Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.6.0 + uses: styfle/cancel-workflow-action@0.8.0 with: access_token: ${{ secrets.GITHUB_TOKEN }} From dda812af4969f3cd65f01de0292a3aaf4076418a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 10 Apr 2021 16:33:51 +1000 Subject: [PATCH 07/14] chore(deps-dev): bump kcd-scripts from 8.2.1 to 8.3.0 (#597) Bumps [kcd-scripts](https://github.com/kentcdodds/kcd-scripts) from 8.2.1 to 8.3.0. - [Release notes](https://github.com/kentcdodds/kcd-scripts/releases) - [Changelog](https://github.com/kentcdodds/kcd-scripts/blob/main/CHANGELOG.md) - [Commits](https://github.com/kentcdodds/kcd-scripts/compare/v8.2.1...v8.3.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ae1a06e5..d5055fd3 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "docz-theme-default": "1.2.0", "docz-utils": "2.3.0", "eslint": "7.23.0", - "kcd-scripts": "8.2.1", + "kcd-scripts": "8.3.0", "prettier": "^2.2.1", "react": "17.0.2", "react-dom": "^17.0.1", From 3fbe19dd77ba733894e59fe050928a4d9a715efe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 10 Apr 2021 16:51:07 +1000 Subject: [PATCH 08/14] chore(deps-dev): bump eslint from 7.23.0 to 7.24.0 (#598) Bumps [eslint](https://github.com/eslint/eslint) from 7.23.0 to 7.24.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.23.0...v7.24.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d5055fd3..e8b6ad24 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "docz": "2.3.1", "docz-theme-default": "1.2.0", "docz-utils": "2.3.0", - "eslint": "7.23.0", + "eslint": "7.24.0", "kcd-scripts": "8.3.0", "prettier": "^2.2.1", "react": "17.0.2", From daee8d6dd026d1080c145310dd8f22acafce8e2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Sat, 10 Apr 2021 15:01:37 +0200 Subject: [PATCH 09/14] chore: update validate.yml (#599) --- .github/workflows/validate.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 0d91cc62..3aba5bd1 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -17,19 +17,17 @@ jobs: if: ${{ !contains(github.head_ref, 'all-contributors') }} strategy: matrix: - node: [10.13, 12, 14, 15] + node: [10.13, 10, 12, 14, 15] runs-on: ubuntu-latest steps: - name: πŸ›‘ Cancel Previous Runs uses: styfle/cancel-workflow-action@0.8.0 - with: - access_token: ${{ secrets.GITHUB_TOKEN }} - name: ⬇️ Checkout repo uses: actions/checkout@v2 - name: βŽ” Setup node - uses: actions/setup-node@v2.1.5 + uses: actions/setup-node@v2 with: node-version: ${{ matrix.node }} @@ -56,14 +54,12 @@ jobs: steps: - name: πŸ›‘ Cancel Previous Runs uses: styfle/cancel-workflow-action@0.8.0 - with: - access_token: ${{ secrets.GITHUB_TOKEN }} - name: ⬇️ Checkout repo uses: actions/checkout@v2 - name: βŽ” Setup node - uses: actions/setup-node@v2.1.5 + uses: actions/setup-node@v2 with: node-version: 14 From 080f66b9531b3f81bcf955b264425414de97faab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Apr 2021 18:21:42 +0100 Subject: [PATCH 10/14] chore(deps): bump styfle/cancel-workflow-action from 0.8.0 to 0.9.0 (#600) Bumps [styfle/cancel-workflow-action](https://github.com/styfle/cancel-workflow-action) from 0.8.0 to 0.9.0. - [Release notes](https://github.com/styfle/cancel-workflow-action/releases) - [Commits](https://github.com/styfle/cancel-workflow-action/compare/0.8.0...89f242ee29e10c53a841bfe71cc0ce7b2f065abc) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/validate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 3aba5bd1..cd3e56a5 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest steps: - name: πŸ›‘ Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.8.0 + uses: styfle/cancel-workflow-action@0.9.0 - name: ⬇️ Checkout repo uses: actions/checkout@v2 @@ -53,7 +53,7 @@ jobs: github.ref) && github.event_name == 'push' }} steps: - name: πŸ›‘ Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.8.0 + uses: styfle/cancel-workflow-action@0.9.0 - name: ⬇️ Checkout repo uses: actions/checkout@v2 From c8275e3288d86a958cffa354f32243ae5924d985 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Apr 2021 08:40:53 +0100 Subject: [PATCH 11/14] chore(deps-dev): bump kcd-scripts from 8.3.0 to 9.0.0 (#601) Bumps [kcd-scripts](https://github.com/kentcdodds/kcd-scripts) from 8.3.0 to 9.0.0. - [Release notes](https://github.com/kentcdodds/kcd-scripts/releases) - [Changelog](https://github.com/kentcdodds/kcd-scripts/blob/main/CHANGELOG.md) - [Commits](https://github.com/kentcdodds/kcd-scripts/compare/v8.3.0...v9.0.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e8b6ad24..113cd078 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "docz-theme-default": "1.2.0", "docz-utils": "2.3.0", "eslint": "7.24.0", - "kcd-scripts": "8.3.0", + "kcd-scripts": "9.0.0", "prettier": "^2.2.1", "react": "17.0.2", "react-dom": "^17.0.1", From ef1d731c2a0d7d78e3b33b183d5b5dd927785aae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Thu, 22 Apr 2021 03:41:12 +0200 Subject: [PATCH 12/14] chore: add tests for Node 16 (#604) --- .github/workflows/validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index cd3e56a5..373a2cf4 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -17,7 +17,7 @@ jobs: if: ${{ !contains(github.head_ref, 'all-contributors') }} strategy: matrix: - node: [10.13, 10, 12, 14, 15] + node: [10.13, 10, 12, 14, 16] runs-on: ubuntu-latest steps: - name: πŸ›‘ Cancel Previous Runs From 0543a9e878ae37313408da1f49e7514bd9a55e09 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Apr 2021 15:41:27 +1000 Subject: [PATCH 13/14] chore(deps-dev): bump kcd-scripts from 9.0.0 to 9.1.0 (#606) Bumps [kcd-scripts](https://github.com/kentcdodds/kcd-scripts) from 9.0.0 to 9.1.0. - [Release notes](https://github.com/kentcdodds/kcd-scripts/releases) - [Changelog](https://github.com/kentcdodds/kcd-scripts/blob/main/CHANGELOG.md) - [Commits](https://github.com/kentcdodds/kcd-scripts/compare/v9.0.0...v9.1.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 113cd078..7f8c147c 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "docz-theme-default": "1.2.0", "docz-utils": "2.3.0", "eslint": "7.24.0", - "kcd-scripts": "9.0.0", + "kcd-scripts": "9.1.0", "prettier": "^2.2.1", "react": "17.0.2", "react-dom": "^17.0.1", From 7b3867e667e83fb64bf98c8e5ed143eb9159fc0b Mon Sep 17 00:00:00 2001 From: Anton Zinovyev Date: Thu, 22 Apr 2021 12:14:10 +0300 Subject: [PATCH 14/14] fix(ssr): Add ability to run SSR tests in pure-node environment (#607) * fix(ssr): div container created only during hydration It allows to run tests in real node environment, where no DOM global objects exists. Fix: #605 * chore: add xobotyi to hall of fame %) --- .all-contributorsrc | 10 ++++++++++ README.md | 1 + src/server/pure.ts | 24 ++++++++++++------------ 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 821ffece..42bb9709 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -519,6 +519,16 @@ "contributions": [ "maintenance" ] + }, + { + "login": "xobotyi", + "name": "Anton Zinovyev", + "avatar_url": "https://avatars.githubusercontent.com/u/6178739?v=4", + "profile": "https://github.com/xobotyi", + "contributions": [ + "bug", + "code" + ] } ], "skipCi": true, diff --git a/README.md b/README.md index 411ca55a..a976ce7b 100644 --- a/README.md +++ b/README.md @@ -239,6 +239,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Aleksandar Grbic

πŸ“–
Jonathan Holmes

πŸ’»
MichaΓ«l De Boey

🚧 +
Anton Zinovyev

πŸ› πŸ’» diff --git a/src/server/pure.ts b/src/server/pure.ts index 1bacd008..b37b6df5 100644 --- a/src/server/pure.ts +++ b/src/server/pure.ts @@ -2,7 +2,7 @@ import ReactDOMServer from 'react-dom/server' import ReactDOM from 'react-dom' import { act } from 'react-dom/test-utils' -import { RendererProps, RendererOptions } from '../types/react' +import { RendererOptions, RendererProps } from '../types/react' import { createRenderHook } from '../core' import { createTestHarness } from '../helpers/createTestHarness' @@ -12,8 +12,8 @@ function createServerRenderer( { wrapper }: RendererOptions ) { let renderProps: TProps | undefined - let hydrated = false - const container = document.createElement('div') + let container: HTMLDivElement | undefined + let serverOutput: string = '' const testHarness = createTestHarness(rendererProps, wrapper, false) return { @@ -21,35 +21,35 @@ function createServerRenderer( renderProps = props act(() => { try { - const serverOutput = ReactDOMServer.renderToString(testHarness(props)) - container.innerHTML = serverOutput + serverOutput = ReactDOMServer.renderToString(testHarness(props)) } catch (e: unknown) { rendererProps.setError(e as Error) } }) }, hydrate() { - if (hydrated) { + if (container) { throw new Error('The component can only be hydrated once') } else { + container = document.createElement('div') + container.innerHTML = serverOutput act(() => { - ReactDOM.hydrate(testHarness(renderProps), container) + ReactDOM.hydrate(testHarness(renderProps), container!) }) - hydrated = true } }, rerender(props?: TProps) { - if (!hydrated) { + if (!container) { throw new Error('You must hydrate the component before you can rerender') } act(() => { - ReactDOM.render(testHarness(props), container) + ReactDOM.render(testHarness(props), container!) }) }, unmount() { - if (hydrated) { + if (container) { act(() => { - ReactDOM.unmountComponentAtNode(container) + ReactDOM.unmountComponentAtNode(container!) }) } },