-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rebuilt WasmBoy Debugger on top of PhosphorJS (#228)
relates to #197 relates to #225 closes #168 closes #198 This rebuilds the debugger on top of [PhosphorJs](http://phosphorjs.github.io/). This adds a much more productive UI/UX on desktop, and a more mobile friendly mobile UI. Also, moved to a vanilla rollup config. Also, this has a tons of fixes and improvements I found while migrating the debugger, and abstracts out a lot of code to be much more cleaner. # Example ![wasmboydebugger](https://user-images.githubusercontent.com/1448289/50895725-c23b7780-13bb-11e9-96ad-e7433cbacf7d.gif) <img width="360" alt="screen shot 2019-01-09 at 3 09 37 am" src="https://user-images.githubusercontent.com/1448289/50895812-0a5a9a00-13bc-11e9-80da-90959753db81.png">
- Loading branch information
Showing
107 changed files
with
4,784 additions
and
7,014 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
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
File renamed without changes.
File renamed without changes.
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,85 @@ | ||
import loadScript from 'load-script'; | ||
|
||
class DebuggerAnalyticsLib { | ||
constructor() { | ||
/*ROLLUP_REPLACE_DEBUGGER_DEV | ||
this.readyPromise = Promise.resolve(); | ||
return; | ||
ROLLUP_REPLACE_DEBUGGER_DEV*/ | ||
|
||
this.readyPromise = new Promise((resolve, reject) => { | ||
if (typeof window !== 'undefined') { | ||
loadScript('https://www.googletagmanager.com/gtag/js?id=UA-125276735-1', (err, script) => { | ||
if (err) { | ||
reject(err); | ||
} | ||
|
||
window.dataLayer = window.dataLayer || []; | ||
function gtag() { | ||
window.dataLayer.push(arguments); | ||
} | ||
gtag('js', new Date()); | ||
gtag('config', 'UA-125276735-1'); | ||
|
||
// Attach Analytics to this class | ||
this.gtag = gtag; | ||
resolve(); | ||
}); | ||
} else { | ||
reject(new Error('Not in a browser Environment')); | ||
} | ||
}); | ||
} | ||
|
||
_fireAnalyticsEvent(eventAction) { | ||
const fireEventTask = async () => { | ||
await this.readyPromise; | ||
|
||
if (this.gtag) { | ||
this.gtag('event', eventAction); | ||
} else { | ||
console.log('Analytics Event Action:', eventAction); | ||
} | ||
}; | ||
|
||
fireEventTask().catch(() => { | ||
// Do Nothing | ||
}); | ||
} | ||
|
||
// Define our events | ||
ROMLoadedAndStarted() { | ||
this._fireAnalyticsEvent('rom_loaded_and_started'); | ||
} | ||
|
||
loadROMSuccess() { | ||
this._fireAnalyticsEvent('load_rom_success'); | ||
} | ||
|
||
loadROMFail() { | ||
this._fireAnalyticsEvent('load_rom_fail'); | ||
} | ||
|
||
saveState() { | ||
this._fireAnalyticsEvent('save_state'); | ||
} | ||
|
||
loadState() { | ||
this._fireAnalyticsEvent('load_state'); | ||
} | ||
|
||
appliedOptions() { | ||
this._fireAnalyticsEvent('applied_options'); | ||
} | ||
|
||
googleDriveLoad() { | ||
this._fireAnalyticsEvent('google_drive_load'); | ||
} | ||
|
||
reload() { | ||
this._fireAnalyticsEvent('reload'); | ||
} | ||
} | ||
|
||
const DebuggerAnalytics = new DebuggerAnalyticsLib(); | ||
export default DebuggerAnalytics; |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.