Skip to content

Commit

Permalink
make "find-in-page" feature work after p-queue@3.1.0 breaking update
Browse files Browse the repository at this point in the history
* see sindresorhus/p-queue#55
* "find-in-page" widget is built with "electron-renderer" webpack's target and so webpack won't ship the "events" shim automatically since "events" module is marked as external based on the target
  • Loading branch information
vladimiry committed Mar 2, 2019
1 parent 44a1b1e commit f77ac1b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@
"dugite": "1.85.0",
"electron": "4.0.6",
"electron-builder": "20.38.5",
"eventemitter3": "3.1.0",
"exports-loader": "0.7.0",
"fast-glob": "2.2.6",
"file-loader": "3.0.1",
Expand Down Expand Up @@ -252,6 +253,7 @@
"source-map-loader": "0.2.4",
"source-map-support": "0.5.10",
"spectron": "5.0.0",
"string-replace-loader": "2.1.1",
"style-loader": "0.23.1",
"stylus-loader": "3.0.2",
"to-string-loader": "1.1.5",
Expand Down
11 changes: 11 additions & 0 deletions src/webpack/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,17 @@ const baseConfig = buildBaseConfig(
},
},
},
{
// TODO explore runtime dependency-less "p-queue" alternatives:
// promise-work-queue (TS), queue-ts (TS), queueable (TS), task-queue (TS), run-queue, async-limiter, etc
test: /node_modules\/p-queue\/index\.js/,
loader: "string-replace-loader",
options: {
search: "require('events')",
replace: "require('eventemitter3')",
strict: true,
},
},
],
},
plugins: [
Expand Down
18 changes: 17 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4464,7 +4464,7 @@ event-stream@=3.3.4:
stream-combiner "~0.0.4"
through "~2.3.1"

eventemitter3@^3.0.0:
eventemitter3@3.1.0, eventemitter3@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163"
integrity sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==
Expand Down Expand Up @@ -10160,6 +10160,14 @@ sax@^1.2.4, sax@~1.2.4:
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==

schema-utils@^0.4.5:
version "0.4.7"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.4.7.tgz#ba74f597d2be2ea880131746ee17d0a093c68187"
integrity sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==
dependencies:
ajv "^6.1.0"
ajv-keywords "^3.1.0"

schema-utils@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770"
Expand Down Expand Up @@ -10881,6 +10889,14 @@ string-argv@^0.0.2:
resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.0.2.tgz#dac30408690c21f3c3630a3ff3a05877bdcbd736"
integrity sha1-2sMECGkMIfPDYwo/86BYd73L1zY=

string-replace-loader@2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/string-replace-loader/-/string-replace-loader-2.1.1.tgz#b72e7b57b6ef04efe615aff0ad989b5c14ca63d1"
integrity sha512-0Nvw1LDclF45AFNuYPcD2Jvkv0mwb/dQSnJZMvhqGrT+zzmrpG3OJFD600qfQfNUd5aqfp7fCm2mQMfF7zLbyQ==
dependencies:
loader-utils "^1.1.0"
schema-utils "^0.4.5"

string-width@^1.0.1, string-width@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
Expand Down

0 comments on commit f77ac1b

Please sign in to comment.