Skip to content

Commit

Permalink
Nits:
Browse files Browse the repository at this point in the history
Changed WASM to refer to local copy of mappings.wasm
Warn only for Dev mode
  • Loading branch information
saphal1998 committed Dec 8, 2020
1 parent 9873685 commit 5fae37c
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/react-devtools-extensions/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const {getGitCommit} = require('./utils');

// These files are copied along with Webpack-bundled files
// to produce the final web extension
const STATIC_FILES = ['icons', 'popups', 'main.html', 'panel.html'];
const STATIC_FILES = ['icons', 'popups', 'main.html', 'panel.html', 'mappings.wasm'];

const preProcess = async (destinationPath, tempPath) => {
await remove(destinationPath); // Clean up from previously completed builds
Expand Down
3 changes: 2 additions & 1 deletion packages/react-devtools-extensions/chrome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"main.html",
"panel.html",
"build/react_devtools_backend.js",
"build/renderer.js"
"build/renderer.js",
"mappings.wasm"
],

"background": {
Expand Down
Binary file added packages/react-devtools-extensions/mappings.wasm
Binary file not shown.
4 changes: 3 additions & 1 deletion packages/react-devtools-extensions/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ function createPanelIfReactLoaded() {
return newHookLog
})
.catch(e => {
console.warn(e);
if (__DEV__) {
console.warn(e);
}
return Promise.resolve(hookLog);
});
}
Expand Down
1 change: 1 addition & 0 deletions packages/react-devtools-extensions/webpack.backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module.exports = {
node: {
// Don't define a polyfill on window.setImmediate
setImmediate: false,
fs: 'empty',
},
resolve: {
alias: {
Expand Down
1 change: 1 addition & 0 deletions packages/react-devtools-extensions/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module.exports = {
node: {
// Don't define a polyfill on window.setImmediate
setImmediate: false,
fs: 'empty',
},
resolve: {
alias: {
Expand Down
1 change: 0 additions & 1 deletion packages/react-devtools-shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"react-virtualized-auto-sizer": "^1.0.2",
"semver": "^6.3.0",
"source-map": "^0.7.3",
"fs": "*",
"@babel/traverse": "^7.12.5",
"@babel/parser": "^7.12.5"
}
Expand Down
3 changes: 2 additions & 1 deletion packages/react-devtools-shared/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,8 @@ export function getSourceMapURL(url: string, urlResponse: string): string {
* TODO: Bundle WASM in extension static files and use those instead of versioned URLs
*/
function initialiseSourceMaps() {
const wasmMappingsURL = 'https://unpkg.com/source-map@0.7.3/lib/mappings.wasm';
const wasmFileName = 'mappings.wasm'
const wasmMappingsURL = chrome.extension.getURL(wasmFileName);
SourceMapConsumer.initialize({ 'lib/mappings.wasm': wasmMappingsURL });
}
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6846,11 +6846,6 @@ fs.realpath@^1.0.0:
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=

fs@*:
version "0.0.2"
resolved "https://registry.yarnpkg.com/fs/-/fs-0.0.2.tgz#e1f244ef3933c1b2a64bd4799136060d0f5914f8"
integrity sha1-4fJE7zkzwbKmS9R5kTYGDQ9ZFPg=

fsevents@2.1.3, fsevents@~2.1.2:
version "2.1.3"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e"
Expand Down

0 comments on commit 5fae37c

Please sign in to comment.