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

Move whatwg-fetch from devDep to dep #1625

Merged
merged 1 commit into from
Jan 12, 2021
Merged

Conversation

Tobbe
Copy link
Member

@Tobbe Tobbe commented Jan 12, 2021

Fixes #1581

@github-actions
Copy link

@Tobbe
Copy link
Member Author

Tobbe commented Jan 12, 2021

Demonstrating that it doesn't work without this PR

tobbe@XPS9550 MINGW64 ~/dev/redwood
$ yarn create redwood-app whatwgfetch
yarn create v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
[...]
Done in 58.87s.

tobbe@XPS9550 MINGW64 ~/dev/redwood
$ cd whatwgfetch/

tobbe@XPS9550 MINGW64 ~/dev/redwood/whatwgfetch
$ yarn rw g page test
yarn run v1.22.4
$ C:\Users\tobbe\dev\redwood\whatwgfetch\node_modules\.bin\rw g page test
  √ Generating page files...
    √ Successfully wrote file `./web\src\pages\TestPage\TestPage.stories.js`
    √ Successfully wrote file `./web\src\pages\TestPage\TestPage.test.js`
    √ Successfully wrote file `./web\src\pages\TestPage\TestPage.js`
  √ Updating routes file...
Done in 4.37s.

tobbe@XPS9550 MINGW64 ~/dev/redwood/whatwgfetch
$ yarn why whatwg-fetch
yarn why v1.22.4
[1/4] Why do we have the module "whatwg-fetch"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
error We couldn't find a match!
Done in 1.48s.

tobbe@XPS9550 MINGW64 ~/dev/redwood/whatwgfetch
$ yarn rw test
[...]
$ C:\Users\tobbe\dev\redwood\whatwgfetch\node_modules\.bin\jest --passWithNoTests --watchAll --runInBand --config C:\Users\tobbe\dev\redwood\whatwgfetch\node_modules\@redwoodjs\core\config\jest.config.js --projects web api
 FAIL   web  web/src/pages/TestPage/TestPage.test.js
  ● Test suite failed to run

    Cannot find module 'whatwg-fetch' from '../node_modules/@redwoodjs/core/dist/configs/browser/jest.setup.js'

      at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:306:11)
      at Object.<anonymous> (../node_modules/@redwoodjs/core/dist/configs/browser/jest.setup.js:5:1)

Demonstrating that we get further with this PR

tobbe@XPS9550 MINGW64 ~/dev/redwood/whatwgfetch
$ yarn rw upgrade --pr 1625:0.22.1-3520c0b
yarn run v1.22.4
$ C:\Users\tobbe\dev\redwood\whatwgfetch\node_modules\.bin\rw upgrade --pr 1625:0.22.1-3520c0b
[...]
success Saved lockfile.
success Saved 2 new dependencies.
info Direct dependencies
└─ @redwoodjs/cli@0.22.1
info All dependencies
├─ @redwoodjs/cli@0.22.1
└─ whatwg-fetch@3.5.0
[...]
Done in 60.00s.

tobbe@XPS9550 MINGW64 ~/dev/redwood/whatwgfetch
$ yarn rw test
[...]
$ C:\Users\tobbe\dev\redwood\whatwgfetch\node_modules\.bin\jest --passWithNoTests --watchAll --runInBand --config C:\Users\tobbe\dev\redwood\whatwgfetch\node_modules\@redwoodjs\core\config\jest.config.js --projects web api
 FAIL   web  web/src/pages/TestPage/TestPage.test.js
  ● Test suite failed to run

    Cannot find module '@redwoodjs/router/dist/index' from '../node_modules/@redwoodjs/testing/dist/MockRouter.js'

    Require stack:
      C:/Users/tobbe/dev/redwood/whatwgfetch/node_modules/@redwoodjs/testing/dist/MockRouter.js
      src/Routes.js
      C:/Users/tobbe/dev/redwood/whatwgfetch/node_modules/@redwoodjs/testing/dist/MockProviders.js
      C:/Users/tobbe/dev/redwood/whatwgfetch/node_modules/@redwoodjs/testing/dist/customRender.js
      C:/Users/tobbe/dev/redwood/whatwgfetch/node_modules/@redwoodjs/testing/dist/index.js
      C:/Users/tobbe/dev/redwood/whatwgfetch/node_modules/@redwoodjs/core/dist/configs/browser/jest.setup.js

      at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:306:11)
      at Object.<anonymous> (../node_modules/@redwoodjs/testing/dist/MockRouter.js:31:14)

So with this PR it doesn't complain about whatwg-fetch missing anymore. But now it breaks on MockRouter instead. I don't think that's related to this PR though.

@Tobbe Tobbe merged commit 68fed52 into redwoodjs:main Jan 12, 2021
@thedavidprice
Copy link
Contributor

The package is also included in redwood/package.json.

We don't need both, do we?

@thedavidprice thedavidprice added this to the next release milestone Jan 12, 2021
@Tobbe
Copy link
Member Author

Tobbe commented Jan 12, 2021

@thedavidprice I noticed that too. I did dig in to it a little bit. It was added to that file by @peterp in this commit

commit da6ebb41bb02d5eaf43495726fcea0ce46397e34
Author: Peter Pistorius <peter.pistorius@gmail.com>
Date:   Sun Jun 14 14:31:26 2020 +0200

    Move testing things to global package.
diff --git a/package.json b/package.json
index 5dbbb66b..22d0ec86 100644
--- a/package.json
+++ b/package.json
@@ -16,11 +16,16 @@
     "@babel/runtime-corejs3": "^7.9.2",
     "babel-plugin-auto-import": "^1.0.5",
     "babel-plugin-module-resolver": "^4.0.0",
+    "bundlesize": "^0.18.0",
     "cross-env": "^7.0.2",
     "jest": "^25.2.3",
     "lerna": "^3.20.2",
     "nodemon": "^2.0.2",
-    "typescript": "^3.8.3"
+    "typescript": "^3.8.3",
+    "@testing-library/react": "10.2.1",
+    "@testing-library/jest-dom": "5.10.0",
+    "msw": "0.19.3",
+    "whatwg-fetch": "3.0.0"
   },
   "eslintConfig": {
     "extends": "@redwoodjs/eslint-config",
@@ -43,4 +48,4 @@
     "lint": "yarn eslint packages",
     "lint:fix": "yarn eslint --fix packages"
   }
-}
+}
\ No newline at end of file

If whatwg-fetch should be removed, should we remove the other packages too? Or should whatwg-fetch only be in this top level package.json, but moved to dependencies? The top level package.json doesn't have any other deps, only devDeps. @peterp What do you think?

@thedavidprice
Copy link
Contributor

Opened a new issue with the comment above here: #1631

@Tobbe Tobbe deleted the tobbe-whatwgfetch branch January 13, 2021 18:10
jtoar pushed a commit that referenced this pull request Oct 26, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [react-player](https://togithub.com/CookPete/react-player) | [`2.12.0`
->
`2.13.0`](https://renovatebot.com/diffs/npm/react-player/2.12.0/2.13.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/react-player/2.13.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/react-player/2.13.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/react-player/2.12.0/2.13.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react-player/2.12.0/2.13.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>CookPete/react-player (react-player)</summary>

###
[`v2.13.0`](https://togithub.com/CookPete/react-player/blob/HEAD/CHANGELOG.md#v2130)

[Compare
Source](https://togithub.com/CookPete/react-player/compare/v2.12.0...v2.13.0)

- Fix
[#&#8203;1604](https://togithub.com/CookPete/react-player/issues/1604) -
FilePlayer does not work if I passed an array of urls
[`#1612`](https://togithub.com/cookpete/react-player/pull/1612)
- fix: `src` sttribute become "undefinded" if `url` is an array
[`#1648`](https://togithub.com/cookpete/react-player/pull/1648)
- Adding keepPlaying to other player types
[`#1639`](https://togithub.com/cookpete/react-player/pull/1639)
-   CI [`#1654`](https://togithub.com/cookpete/react-player/pull/1654)
- Swap out broken youtube URL
[`#1659`](https://togithub.com/cookpete/react-player/pull/1659)
- Add keepPlaying to seekTo
[`#1620`](https://togithub.com/cookpete/react-player/pull/1620)
- Added forceDisableHls option for FilePlayer
[`#1625`](https://togithub.com/cookpete/react-player/pull/1625)
- added onPlaybackQualityChange prop
[`#1636`](https://togithub.com/cookpete/react-player/pull/1636)
- Update the list of supported YouTube domains
[`#1599`](https://togithub.com/cookpete/react-player/pull/1599)
- Fix
[#&#8203;1604](https://togithub.com/CookPete/react-player/issues/1604) -
FilePlayer does not work if I passed an array of urls
([#&#8203;1612](https://togithub.com/CookPete/react-player/issues/1612))
[`#1604`](https://togithub.com/cookpete/react-player/issues/1604)
- Support Wisita URLs with query params
[`#1591`](https://togithub.com/cookpete/react-player/issues/1591)
- Support vimeo manage links
[`#1593`](https://togithub.com/cookpete/react-player/issues/1593)
- Update readme
[`90237f5`](https://togithub.com/cookpete/react-player/commit/90237f51d43fc63870b0e6d0c86f4497f97ca586)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/redwoodjs/redwood).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMS41IiwidXBkYXRlZEluVmVyIjoiMzcuMzEuNSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
jtoar pushed a commit that referenced this pull request Nov 2, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [react-player](https://togithub.com/CookPete/react-player) | [`2.12.0`
->
`2.13.0`](https://renovatebot.com/diffs/npm/react-player/2.12.0/2.13.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/react-player/2.13.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/react-player/2.13.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/react-player/2.12.0/2.13.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react-player/2.12.0/2.13.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>CookPete/react-player (react-player)</summary>

###
[`v2.13.0`](https://togithub.com/CookPete/react-player/blob/HEAD/CHANGELOG.md#v2130)

[Compare
Source](https://togithub.com/CookPete/react-player/compare/v2.12.0...v2.13.0)

- Fix
[#&#8203;1604](https://togithub.com/CookPete/react-player/issues/1604) -
FilePlayer does not work if I passed an array of urls
[`#1612`](https://togithub.com/cookpete/react-player/pull/1612)
- fix: `src` sttribute become "undefinded" if `url` is an array
[`#1648`](https://togithub.com/cookpete/react-player/pull/1648)
- Adding keepPlaying to other player types
[`#1639`](https://togithub.com/cookpete/react-player/pull/1639)
-   CI [`#1654`](https://togithub.com/cookpete/react-player/pull/1654)
- Swap out broken youtube URL
[`#1659`](https://togithub.com/cookpete/react-player/pull/1659)
- Add keepPlaying to seekTo
[`#1620`](https://togithub.com/cookpete/react-player/pull/1620)
- Added forceDisableHls option for FilePlayer
[`#1625`](https://togithub.com/cookpete/react-player/pull/1625)
- added onPlaybackQualityChange prop
[`#1636`](https://togithub.com/cookpete/react-player/pull/1636)
- Update the list of supported YouTube domains
[`#1599`](https://togithub.com/cookpete/react-player/pull/1599)
- Fix
[#&#8203;1604](https://togithub.com/CookPete/react-player/issues/1604) -
FilePlayer does not work if I passed an array of urls
([#&#8203;1612](https://togithub.com/CookPete/react-player/issues/1612))
[`#1604`](https://togithub.com/cookpete/react-player/issues/1604)
- Support Wisita URLs with query params
[`#1591`](https://togithub.com/cookpete/react-player/issues/1591)
- Support vimeo manage links
[`#1593`](https://togithub.com/cookpete/react-player/issues/1593)
- Update readme
[`90237f5`](https://togithub.com/cookpete/react-player/commit/90237f51d43fc63870b0e6d0c86f4497f97ca586)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/redwoodjs/redwood).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMS41IiwidXBkYXRlZEluVmVyIjoiMzcuMzEuNSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

whatwg-fetch and breaking boilerplate tests through yarn rw tests
3 participants