-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pigment] Patch WyW's WeakRef usage (#41909)
- Loading branch information
1 parent
3152481
commit 357c50e
Showing
3 changed files
with
61 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,9 +114,9 @@ | |
"@mui/joy": "workspace:*", | ||
"@mui/material": "workspace:^", | ||
"@mui/utils": "workspace:^", | ||
"@pigment-css/react": "workspace:^", | ||
"@next/eslint-plugin-next": "^14.2.1", | ||
"@octokit/rest": "^20.1.0", | ||
"@pigment-css/react": "workspace:^", | ||
"@playwright/test": "1.43.1", | ||
"@types/enzyme": "^3.10.18", | ||
"@types/fs-extra": "^11.0.4", | ||
|
@@ -227,5 +227,10 @@ | |
], | ||
"sourceMap": false, | ||
"instrument": false | ||
}, | ||
"pnpm": { | ||
"patchedDependencies": { | ||
"@wyw-in-js/[email protected]": "patches/@[email protected]" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
diff --git a/esm/module.js b/esm/module.js | ||
index 527070166142e7fda5ed14e1f3465052c82f2a2b..122061e0d481066a2b5fd0c7ab2a8b1d523b1ef1 100644 | ||
--- a/esm/module.js | ||
+++ b/esm/module.js | ||
@@ -119,7 +119,7 @@ export class Module { | ||
this.services = services; | ||
this.moduleImpl = moduleImpl; | ||
this.cache = services.cache; | ||
- this.#entrypointRef = new WeakRef(entrypoint); | ||
+ this.#entrypointRef = entrypoint; | ||
this.idx = entrypoint.idx; | ||
this.id = entrypoint.name; | ||
this.filename = entrypoint.name; | ||
@@ -143,7 +143,7 @@ export class Module { | ||
this.debug('the whole exports was overridden with %O', value); | ||
} | ||
get entrypoint() { | ||
- const entrypoint = this.#entrypointRef.deref(); | ||
+ const entrypoint = this.#entrypointRef; | ||
invariant(entrypoint, `Module ${this.idx} is disposed`); | ||
return entrypoint; | ||
} | ||
diff --git a/lib/module.js b/lib/module.js | ||
index d2f2644c2469ac7ad0dbd1b9f58099eda4084b80..b8bad9c43c35bef14c3f6a277f8c9974607b2a00 100644 | ||
--- a/lib/module.js | ||
+++ b/lib/module.js | ||
@@ -127,7 +127,7 @@ class Module { | ||
this.services = services; | ||
this.moduleImpl = moduleImpl; | ||
this.cache = services.cache; | ||
- this.#entrypointRef = new WeakRef(entrypoint); | ||
+ this.#entrypointRef = entrypoint; | ||
this.idx = entrypoint.idx; | ||
this.id = entrypoint.name; | ||
this.filename = entrypoint.name; | ||
@@ -151,7 +151,7 @@ class Module { | ||
this.debug('the whole exports was overridden with %O', value); | ||
} | ||
get entrypoint() { | ||
- const entrypoint = this.#entrypointRef.deref(); | ||
+ const entrypoint = this.#entrypointRef; | ||
(0, _tsInvariant.invariant)(entrypoint, `Module ${this.idx} is disposed`); | ||
return entrypoint; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.