-
-
Notifications
You must be signed in to change notification settings - Fork 811
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch
requestIdleCallback
for react-devtools-core
the `requestIdleCallback` have some problem on debug mode for Android, we can just let it use polyfill to avoid many issues until the problem is solved.
- Loading branch information
Showing
2 changed files
with
19 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
|
||
echo '\n\n## PATCH REACT DEVTOOLS\n' | ||
|
||
FILE='./node_modules/react-devtools-core/build/backend.js' | ||
SOURCE_MAP='./node_modules/react-devtools-core/build/backend.js.map' | ||
|
||
TARGET='window.requestIdleCallback' | ||
REPLACE='window.__REQUEST_IDLE_CALLBACK_REPLACED_BY_PATCH__' | ||
sed -i '' s/$TARGET/$REPLACE/g $FILE | ||
sed -i '' s/$TARGET/$REPLACE/g $SOURCE_MAP | ||
|
||
TARGET='window.cancelIdleCallback' | ||
REPLACE='window.__CANCEL_IDLE_CALLBACK_REPLACED_BY_PATCH__' | ||
sed -i '' s/$TARGET/$REPLACE/g $FILE | ||
sed -i '' s/$TARGET/$REPLACE/g $SOURCE_MAP |
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#!/bin/bash | ||
|
||
npm run build | ||
cd dist && npm i | ||
cd dist && npm i && cd - | ||
|
||
./scripts/patch-react-devtools.sh |