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

Use Yarn PnP #9476

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Use Yarn PnP #9476

wants to merge 2 commits into from

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented Jan 28, 2020

Summary

#10188 landed yarn v2 with node-modules linker. I wanna play with PnP - even if we don't land it for whatever reason, any errors raised by it is likely things we should fix on master.

Test plan

Green CI at some point.

.gitignore Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
@yordis

This comment has been minimized.

@macrozone

This comment has been minimized.

@SimenB

This comment has been minimized.

@macrozone

This comment has been minimized.

@nicolo-ribaudo
Copy link
Contributor

As a workaround for babel/babel#11118, you can use packageExtensions.

@SimenB
Copy link
Member Author

SimenB commented Feb 9, 2020

thanks @nicolo-ribaudo, did that and also (tried to) fix all the other errors we get from the tsc build.

@SimenB
Copy link
Member Author

SimenB commented Feb 10, 2020

Landed a bit of this in #9545, all the things yarn install complained about and the ones I noticed when running tests. Still a bunch of failures, will need to look more later again

package.json Outdated Show resolved Hide resolved
@SimenB
Copy link
Member Author

SimenB commented Oct 29, 2020

Can remove the packageExtensions as yarn does it automatically: https://github.com/yarnpkg/berry/pull/1847/files

@SimenB
Copy link
Member Author

SimenB commented Jan 1, 2023

@merceyz hey, happy new year! 😀 Would you be able to take a look at the error with lint and typescript?

@merceyz
Copy link
Contributor

merceyz commented Jan 28, 2023

Hey, happy (late) new year! 😄

there's a weird require

It's something alright, fixed in #13836.

WebAssembly is not defined, but AFAICT it should be part of TS proper?

It's in the DOM types so you need to either add /// <reference lib="dom" /> to the file or DOM to the tsconfig.json compilerOptions.lib option.
The reason it works with node_modules is most likely because @types/jsdom is hoisted to the root and contains /// <reference lib="dom" />.

Also seeing an error loading the test env, but I haven't dug into that one yet

Some of the examples aren't declaring jest-environment-jsdom as a dependency.

diff --git a/examples/angular/package.json b/examples/angular/package.json
index cb64e7476e..5c9fa12e7b 100644
--- a/examples/angular/package.json
+++ b/examples/angular/package.json
@@ -27,6 +27,7 @@
     "babel-jest": "workspace:^",
     "babel-plugin-transform-typescript-metadata": "*",
     "jest": "workspace:^",
+    "jest-environment-jsdom": "workspace:^",
     "jest-zone-patch": "*"
   }
 }
diff --git a/examples/jquery/package.json b/examples/jquery/package.json
index c7808e236c..7952a710b6 100644
--- a/examples/jquery/package.json
+++ b/examples/jquery/package.json
@@ -6,7 +6,8 @@
     "@babel/core": "^7.11.6",
     "@babel/preset-env": "^7.1.0",
     "babel-jest": "workspace:^",
-    "jest": "workspace:^"
+    "jest": "workspace:^",
+    "jest-environment-jsdom": "workspace:^"
   },
   "dependencies": {
     "jquery": "^3.2.1"
diff --git a/examples/react-testing-library/package.json b/examples/react-testing-library/package.json
index 9caf65477a..478ed69447 100644
--- a/examples/react-testing-library/package.json
+++ b/examples/react-testing-library/package.json
@@ -12,7 +12,8 @@
     "@babel/preset-react": "^7.12.1",
     "@testing-library/react": "^12.1.5",
     "babel-jest": "workspace:^",
-    "jest": "workspace:^"
+    "jest": "workspace:^",
+    "jest-environment-jsdom": "workspace:^"
   },
   "scripts": {
     "test": "jest"
diff --git a/examples/react/package.json b/examples/react/package.json
index f100ce09fc..a1c2e80e72 100644
--- a/examples/react/package.json
+++ b/examples/react/package.json
@@ -11,7 +11,8 @@
     "@babel/preset-env": "^7.1.0",
     "@babel/preset-react": "^7.12.1",
     "babel-jest": "workspace:^",
-    "jest": "workspace:^"
+    "jest": "workspace:^",
+    "jest-environment-jsdom": "workspace:^"
   },
   "scripts": {
     "test": "jest"
diff --git a/examples/typescript/package.json b/examples/typescript/package.json
index 3ca4c4463c..22cf5abfa7 100644
--- a/examples/typescript/package.json
+++ b/examples/typescript/package.json
@@ -14,7 +14,8 @@
     "@babel/preset-typescript": "^7.0.0",
     "@jest/globals": "workspace:^",
     "babel-jest": "workspace:^",
-    "jest": "workspace:^"
+    "jest": "workspace:^",
+    "jest-environment-jsdom": "workspace:^"
   },
   "scripts": {
     "test": "jest"

@SimenB
Copy link
Member Author

SimenB commented Jan 28, 2023

Thanks for taking a look!


The WebAssembly issue seems to be an old one: microsoft/TypeScript-DOM-lib-generator#826

Copy link

This PR is stale because it has been open 1 year with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Feb 13, 2024
Copy link

This PR was closed because it has been stalled for 30 days with no activity. Please open a new PR if the issue is still relevant, linking to this one.

@github-actions github-actions bot closed this Mar 14, 2024
@SimenB SimenB reopened this Mar 14, 2024
@SimenB SimenB added Pinned and removed Stale labels Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants