forked from firefox-devtools/profiler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Demangle symbols when reading them out of the symbol table.
This also adds our first wasm module and updates the configuration so that that's possible. I've used wasm-pack to publish a gecko-profiler-demangle module to npm instead of copying the generated code into this repository. I'm not sure if that was a good or a bad idea; I mostly did it so that our Flow and ESLint rules wouldn't be applied to the wasm-bindgen generated code. I've also needed to autogenerate a flow libdef for this module. wasm-bindgen doesn't create those automatically yet: rustwasm/wasm-bindgen#180 I could have created one manually and included it in the published package, but I don't know if wasm-pack would have included my additional files in the published package (via `wasm-pack publish`).
- Loading branch information
Showing
9 changed files
with
254 additions
and
21 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
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,21 @@ | ||
// This module replaces the wasm-pack generated module 'gecko-profiler-demangle' | ||
// in our tests. | ||
// The reason for this replacement is the fact that wasm-pack (or rather, | ||
// wasm-bindgen), when targeting the browser + webpack, generates an ES6 module | ||
// that node cannot deal with. Most importantly, it uses the syntax | ||
// "import * as wasm from './gecko_profiler_demangle_bg';" in order to load | ||
// the wasm module, which is currently only supported by webpack. | ||
// The long-term path to make this work correctly is to wait for node to | ||
// support ES6 modules (and WASM as ES6 modules) natively [1]. It's possible | ||
// that in the medium term, wasm-bindgen will get support for outputting JS | ||
// files which work in both webpack and in node natively [2]. | ||
// [1] https://medium.com/@giltayar/native-es-modules-in-nodejs-status-and-future-directions-part-i-ee5ea3001f71 | ||
// [2] https://github.com/rustwasm/wasm-bindgen/issues/233 | ||
|
||
// @flow | ||
|
||
// There's only one exported function. | ||
// Do the simplest thing possible: no demangling. | ||
export function demangle_any(s: string): string { | ||
return s; | ||
} |
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
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
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
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,137 @@ | ||
// flow-typed signature: f84c93c5335ad9c36684cc95ca54b099 | ||
// flow-typed version: <<STUB>>/@mstange/offline-plugin_v^5.0.6/flow_v0.70.0 | ||
|
||
/** | ||
* This is an autogenerated libdef stub for: | ||
* | ||
* '@mstange/offline-plugin' | ||
* | ||
* Fill this stub out by replacing all the `any` types. | ||
* | ||
* Once filled out, we encourage you to share your work with the | ||
* community by sending a pull request to: | ||
* https://github.com/flowtype/flow-typed | ||
*/ | ||
|
||
declare module '@mstange/offline-plugin' { | ||
declare module.exports: any; | ||
} | ||
|
||
/** | ||
* We include stubs for each file inside this npm package in case you need to | ||
* require those files directly. Feel free to delete any files that aren't | ||
* needed. | ||
*/ | ||
declare module '@mstange/offline-plugin/lib/app-cache' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module '@mstange/offline-plugin/lib/default-options' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module '@mstange/offline-plugin/lib/index' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module '@mstange/offline-plugin/lib/loaders/fonts-css' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module '@mstange/offline-plugin/lib/loaders/index' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module '@mstange/offline-plugin/lib/misc/async-waituntil' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module '@mstange/offline-plugin/lib/misc/get-uglify-plugin' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module '@mstange/offline-plugin/lib/misc/runtime-loader' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module '@mstange/offline-plugin/lib/misc/sw-loader' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module '@mstange/offline-plugin/lib/misc/sw-polyfill' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module '@mstange/offline-plugin/lib/misc/sw-template' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module '@mstange/offline-plugin/lib/misc/utils' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module '@mstange/offline-plugin/lib/service-worker' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module '@mstange/offline-plugin/runtime' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module '@mstange/offline-plugin/tpls/empty-entry' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module '@mstange/offline-plugin/tpls/runtime-template' { | ||
declare module.exports: any; | ||
} | ||
|
||
// Filename aliases | ||
declare module '@mstange/offline-plugin/lib/app-cache.js' { | ||
declare module.exports: $Exports<'@mstange/offline-plugin/lib/app-cache'>; | ||
} | ||
declare module '@mstange/offline-plugin/lib/default-options.js' { | ||
declare module.exports: $Exports<'@mstange/offline-plugin/lib/default-options'>; | ||
} | ||
declare module '@mstange/offline-plugin/lib/index.js' { | ||
declare module.exports: $Exports<'@mstange/offline-plugin/lib/index'>; | ||
} | ||
declare module '@mstange/offline-plugin/lib/loaders/fonts-css.js' { | ||
declare module.exports: $Exports<'@mstange/offline-plugin/lib/loaders/fonts-css'>; | ||
} | ||
declare module '@mstange/offline-plugin/lib/loaders/index.js' { | ||
declare module.exports: $Exports<'@mstange/offline-plugin/lib/loaders/index'>; | ||
} | ||
declare module '@mstange/offline-plugin/lib/misc/async-waituntil.js' { | ||
declare module.exports: $Exports<'@mstange/offline-plugin/lib/misc/async-waituntil'>; | ||
} | ||
declare module '@mstange/offline-plugin/lib/misc/get-uglify-plugin.js' { | ||
declare module.exports: $Exports<'@mstange/offline-plugin/lib/misc/get-uglify-plugin'>; | ||
} | ||
declare module '@mstange/offline-plugin/lib/misc/runtime-loader.js' { | ||
declare module.exports: $Exports<'@mstange/offline-plugin/lib/misc/runtime-loader'>; | ||
} | ||
declare module '@mstange/offline-plugin/lib/misc/sw-loader.js' { | ||
declare module.exports: $Exports<'@mstange/offline-plugin/lib/misc/sw-loader'>; | ||
} | ||
declare module '@mstange/offline-plugin/lib/misc/sw-polyfill.js' { | ||
declare module.exports: $Exports<'@mstange/offline-plugin/lib/misc/sw-polyfill'>; | ||
} | ||
declare module '@mstange/offline-plugin/lib/misc/sw-template.js' { | ||
declare module.exports: $Exports<'@mstange/offline-plugin/lib/misc/sw-template'>; | ||
} | ||
declare module '@mstange/offline-plugin/lib/misc/utils.js' { | ||
declare module.exports: $Exports<'@mstange/offline-plugin/lib/misc/utils'>; | ||
} | ||
declare module '@mstange/offline-plugin/lib/service-worker.js' { | ||
declare module.exports: $Exports<'@mstange/offline-plugin/lib/service-worker'>; | ||
} | ||
declare module '@mstange/offline-plugin/runtime.js' { | ||
declare module.exports: $Exports<'@mstange/offline-plugin/runtime'>; | ||
} | ||
declare module '@mstange/offline-plugin/tpls/empty-entry.js' { | ||
declare module.exports: $Exports<'@mstange/offline-plugin/tpls/empty-entry'>; | ||
} | ||
declare module '@mstange/offline-plugin/tpls/runtime-template.js' { | ||
declare module.exports: $Exports<'@mstange/offline-plugin/tpls/runtime-template'>; | ||
} |
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,32 @@ | ||
// flow-typed signature: e6f43a673a1ad489aea31817e5e11e45 | ||
// flow-typed version: <<STUB>>/gecko-profiler-demangle_v^0.1.0/flow_v0.70.0 | ||
|
||
/** | ||
* This is an autogenerated libdef stub for: | ||
* | ||
* 'gecko-profiler-demangle' | ||
* | ||
* Fill this stub out by replacing all the `any` types. | ||
* | ||
* Once filled out, we encourage you to share your work with the | ||
* community by sending a pull request to: | ||
* https://github.com/flowtype/flow-typed | ||
*/ | ||
|
||
declare module 'gecko-profiler-demangle' { | ||
declare module.exports: any; | ||
} | ||
|
||
/** | ||
* We include stubs for each file inside this npm package in case you need to | ||
* require those files directly. Feel free to delete any files that aren't | ||
* needed. | ||
*/ | ||
declare module 'gecko-profiler-demangle/gecko_profiler_demangle' { | ||
declare module.exports: any; | ||
} | ||
|
||
// Filename aliases | ||
declare module 'gecko-profiler-demangle/gecko_profiler_demangle.js' { | ||
declare module.exports: $Exports<'gecko-profiler-demangle/gecko_profiler_demangle'>; | ||
} |
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
Oops, something went wrong.